Tools to scaffold web components on infor-design/enterprise-wc
.
- Git checkout this repo to a directory
- Visit the local repo's root and in cmd/terminal:
npm i && npm link
- Visit your
enterprise-wc
repo installation root in cmd/terminal and enter:
npm link ids-wc-tools
Now, ids-wc-scaffold
should be available as a command to run in the project
In your working directory root:
ids-wc-scaffold --namespace="ids-my-component-name"
Output should be similar to the following:
> <root>/src/ids-xyz not found; created directory.
> <root>/app/ids-xyz not found; created directory.
> <root>/src/ids-xyz/ids-xyz.js not found; created file.
> <root>/src/ids-xyz/ids-xyz.d.ts not found; created file.
> <root>/src/ids-xyz/ids-xyz.scss not found; created file.
> <root>/app/ids-xyz/README.md not found; created file.
> <root>/app/ids-xyz/example.html not found; created file.
> <root>/app/ids-xyz/index.html not found; created file.
> <root>/app/ids-xyz/index.js not found; created file.
> <root>/app/ids-xyz/index.yaml not found; created file.
Generates the runs through mappings
files of a given type (mixins/components) and:
- adds directories from
srcDirs.js
if they don't exist, - adds files from
srcFiles.js
if they don't exist - replaces all instances of patterns found in files using Regexp, and replaces the groups found in
replacement.js
(note: recursive patterns for capture groups are not tested/supported)
- add
mixins
cmd param to work with entries which can use regexp group to capture/transform; can be done with approach similar to existing[namespace]/replacements.js
- basic eslinting
-
mixins are already just about supported but waiting on a directory structure to input the structure within the
mappings
files. -
This project aims to eventually support validation but is not meant as a code analysis tool or tokenizer due to simple limitations of regex capture (not a substitute for proper tokenization) and time constraints;
For certain tasks of that nature to be done effectively, we would need to either import a solution-for or build a lexer/parser for ES7 which is not pragmatic in short term with scope/low priority of these tools.
Change requests are welcome but before introducing complexity, please keep the above in mind.