我按照步骤,符合 https://github.com/dart-lang/custom-element-apigen:
- 已安装节点/npm (v3.5.3)
- 鲍尔 (v1.7.2) 已安装
- 已安装水解 (v1.21.4)
- 使用以下内容创建的
.bowerrc
{
"directory": "lib/src"
}
-
bower install --save paper-datatable
(https://github.com/David-Mulder/paper-datatable) 已执行 -
使用以下内容创建的
apigen.yaml
files_to_generate:
- paper-datatablepaper-datatable.html
- custom_element_apigen库插件在pubspec.yaml上
dependencies:
custom_element_apigen: ^0.2.1+1
-
pub run custom_element_apigen:update apigen.yaml
命令已执行。
此命令中的错误
第一个错误:在 Windows 上不起作用。有关 https://github.com/dart-lang/custom-element-apigen/issues/43 的详细信息。
作为解决方法,我创建了包含以下内容的process_elements.bat
(而不是process_elements.sh
):
node packagescustom_element_apigensrcjsanalyze.js %1
我编辑了generate_dart_api.dart
并将呼叫.bat
更改为.sh
:
'D:/Users/Administrador/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/custom_element_apigen-0.2.1+1/lib/src/js/process_elements.bat', [inputPath]);
然后,我得到了一个工作轮!
第二个错误,我没有解决!
现在,执行命令c:dart-sdkbinpub run custom_element_apigen:update apigen.yaml
时出现以下问题:
D:UsersAdministradorWebstormProjectsFacilis>c:dart-sdkbinpub run custom_e
lement_apigen:update apigen.yaml
←[32m1 of 1: libsrcpaper-datatablepaper-datatable.html←[0mUnhandled exception
:
Failed to parse element files!
exit code: 0
stderr:
stdout:
D:UsersAdministradorWebstormProjectsFacilis>node packagescustom_element_api
gensrcjsanalyze.js libsrcpaper-datatablepaper-datatable.html
{"imports":["lib/src/polymer/polymer.html","lib/src/paper-datatable/paper-datata
ble-column.html","lib/src/paper-datatable/paper-datatable-edit-dialog.html","lib
/src/paper-datatable/datatable-icons.html","lib/src/paper-checkbox/paper-checkbo
x.html","lib/src/paper-tooltip/paper-tooltip.html"],"elements":{"PaperDatatable"
:{"name":"paper-datatable","properties":{"data":{"hasGetter":true,"hasSetter":tr
ue,"name":"data","type":"Array","description":"nArray of objects containing the
data to be shown in the table.nn"},"multiSelection":{"hasGetter":true,"hasSet
ter":true,"name":"multiSelection","type":"Boolean","description":"nWhether to a
llow selection of more than one row.nn"},"progress":{"hasGetter":true,"hasSett
er":true,"name":"progress","type":"Boolean","description":"nWhether to show the
progress bar. As the progress bar is often not used in standalonen`<paper-data
table>'s the `<paper-progress>` element isn't included by default and needs to b
enmanually imported.nn"},"resizeBehavior":{"hasGetter":true,"hasSetter":true,
"name":"resizeBehavior","type":"String","description":"nOverflow, fixed or 'dyn
amic-columns'nn"},"selectable":{"hasGetter":true,"hasSetter":true,"name":"sele
ctable","type":"Boolean","description":"nWhether to show checkboxes on the left
to allow row selection.nn"},"selectedItem":{"hasGetter":true,"hasSetter":true
,"name":"selectedItem","type":"Object","description":"nIf `multi-selection` is
off then this contains the selected row.nn"},"selectedItems":{"hasGetter":true
,"hasSetter":true,"name":"selectedItems","type":"Array","description":"nIf `mul
ti-selection` is on then this contains an array of the selected rows.nn"},"sel
ectedKey":{"hasGetter":true,"hasSetter":true,"name":"selectedKey","type":"Object
","description":"nIf `multi-selection` is off then this contains the key of the
selected row.nn"},"selectedKeys":{"hasGetter":true,"hasSetter":true,"name":"s
electedKeys","type":"Array","description":"nIf `multi-selection` then this cont
ains an array of selected row keys.nn"},"listeners":{"hasGetter":true,"hasSett
er":true,"name":"listeners","type":"Object","description":""},"observers":{"hasG
etter":true,"hasSetter":true,"name":"observers","type":"Array","description":""}
},"methods":{"customRowStyle":{"name":"customRowStyle","type":null,"description"
:"nMethod that can be overwritten to apply a custom style to specific rows.nn
IMPORTANT: This is a property, not a method you should call directly.ntttt
","isVoid":true,"args":[{"name":"rowItem","description":""}]},"deselect":{"name"
:"deselect","type":null,"description":"nDeselect the specified item. Ignore the
`notify` parameter.nn","isVoid":true,"args":[{"name":"item","description":""}
,{"name":"notify","description":""}]},"deselectAll":{"name":"deselectAll","type"
:null,"description":"nDeselect all currently selected items. Ignore the `notify
` parameter.ntttt ","isVoid":true,"args":[{"name":"notify","description":""
}]},"filter":{"name":"filter","type":null,"description":"nThe filter attribute
can be used to specify a filter which will be applied to the `data`.nNote that
selections should fully ignore filtering, and a filter only affects which data i
snvisible.nnThe function takes three arguments: `item`, `key` and `items` per
the JS filter function.nnFor a demo please see [here](demo/filter.html).nnI
MPORTANT: This is a property, not a method you should call directly.nn","isVoi
d":true,"args":[]},"reload":{"name":"reload","type":null,"description":"nIf you
have been changing data on the `data` property outside of the official Polymer
functionsncalling this function *may* get you the updates you want.ntttt "
,"isVoid":true,"args":[]},"reset":{"name":"reset","type":null,"description":"nH
ardcore reset of the entire element. Sets `data` to `[]` and resets all cells.n
tttt ","isVoid":true,"args":[]},"select":{"name":"select","type":null,"descr
iption":"nSelect the specified item. Ignore the `notify` parameter.nn","isVoi
d":true,"args":[{"name":"item","description":""},{"name":"notify","description":
""}]},"sort":{"name":"sort","type":null,"description":"nSort the specified colu
mn, where `column` is a reference to the actual `<paper-datatable-column>`nelem
ent.ntttt ","isVoid":true,"args":[{"name":"column","description":""}]},"tog
gleAll":{"name":"toggleAll","type":null,"description":"nTriggered by clicking t
he top left checkmark. If all are checked it will deselect all checked items.nI
f some or none are checked it will select all itemsntttt ","isVoid":true,"a
rgs":[]},"ready":{"name":"ready","type":null,"description":"","isVoid":true,"arg
s":[]}},"description":"n# Paper DatatablennA [material design implementation
of a data table](https://www.google.com/design/spec/components/data-tables.html)
.nn","behaviors":["Polymer.IronResizableBehavior"]}},"behaviors":{},"path":"li
b\src\paper-datatable\paper-datatable.html"}
#0 _parseError (package:custom_element_apigen/generate_dart_api.dart:202:3)
#1 _parseFile.<_parseFile_async_body> (package:custom_element_apigen/genera
te_dart_api.dart:160:5)
#2 _RootZone.runUnary (dart:async/zone.dart:1149)
#3 _Future._propagateToListeners.handleValueCallback (dart:async/future_imp
l.dart:502)
#4 _Future._propagateToListeners (dart:async/future_impl.dart:585)
#5 _Future._completeWithValue (dart:async/future_impl.dart:376)
#6 Future.wait.<anonymous closure> (dart:async/future.dart:299)
#7 _RootZone.runUnary (dart:async/zone.dart:1149)
#8 _Future._propagateToListeners.handleValueCallback (dart:async/future_imp
l.dart:502)
#9 _Future._propagateToListeners (dart:async/future_impl.dart:585)
#10 _Future._completeWithValue (dart:async/future_impl.dart:376)
#11 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:
430)
#12 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#13 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#14 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#15 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dar
t:151)
我做错了什么吗?还是这是一个错误?
谢谢!
这是一个错误,该软件包未经在Windows上测试,因为它主要由聚合物飞镖团队使用。
看起来总的来说,修复程序只需要像您已经做的那样加载.bat
文件,然后调整路径以使用正确的目录分隔符。
请参阅 https://github.com/dart-lang/custom-element-apigen/issues/43。