ngxs / schematics Goto Github PK
View Code? Open in Web Editor NEW:wrench: Schematics for @ngxs/store
License: MIT License
:wrench: Schematics for @ngxs/store
License: MIT License
ng add @ngxs/store
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
When running ng add @ngxs/schematics
, Angular tries to add 1.0.0
to the package.json. Since the 0.0.1-alpha.0
was just released, that doesn't make any sense.
For a workaround: Just change the package.json version to 0.0.1-alpha.0
.
I would expect the command to install the latest version.
Run ng add @ngxs/schematics
It seems a waste of time and prone to errors to have to define your ngxs/schematics version before every release.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
File: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid regExp for packageRules[0].packagePatterns:
^@angular-.,^@schematics/.``
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
Package not found on npm repository
package found
npm i @ngxs/schematics
npm ERR! code E404
npm ERR! 404 Not Found: @ngxs/schematics@latest
Libs:
- @angular/core version: X.Y.Z
- @ngxs/store version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: v10.13.0
- Platform:
Others:
Just testing ngxs and this project...
Thank you!
Alexandre
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[x] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
In my opinion, ng generate @ngxs/schematics ...
is kind of a long command. Would you be possible to have a sorter one, e.g ng generate ngxs ...
(inspired from nrwl)
N.A.
N.A.
It is faster to type ng generate ngxs
comparing to ng generate @ngxs/schematics
.
Libs:
- @angular/core version: 7.1.0
- @ngxs/store version: 3.3.1
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 8.14.0
- Platform: Mac, Windows
Others:
N.A.
Add @ngxs/schematics
documentation in https://github.com/ngxs/store/tree/master/docs/plugins
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
The provided schematics do not have a 'schema' property referencing a schema.json for each schematic.
Just schema.d.ts which provides typing but emits no usable code.
Each schematic has a schema property populated with the path to a JSON file providing schematic defaults.
Required for use with Angular Console and prompts provided by the CLI; can be used for additional schematic validation internally
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
@ngxs/schematics added to Dependencies
@ngxs/schematics should be added to devDependencies
Libs:
- @angular/core version: X.Y.Z
- @ngxs/store version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
Currently the store
, state
and actions
schematics generate within a folder named after the name provided.
For example, ng generate @ngxs/schematics:store sample --path=app/src/sample/store
generates:
src/app/src/sample/store/sample/sample.actions.ts
src/app/src/sample/store/sample/sample.state.spec.ts
src/app/src/sample/store/sample/sample.state.ts
It does not allow me to generate these files directly into the app/src/sample/store
folder but always creates the subfolder.
I would like to be able to specify --flat=true to generate the files directly into the target.
For example, ng generate @ngxs/schematics:store sample --path=app/src/sample/store --flat=true
would generate:
src/app/src/sample/store/sample.actions.ts
src/app/src/sample/store/sample.state.spec.ts
src/app/src/sample/store/sample.state.ts
Not to force a directory structure on the user and to align with an option available in @angular/schematics
.
--project
is provided, schematics should derive sourceRoot
and projectType
from angular.json
for that project.ng g @ngxs/schematics:store --name=store/auth --spec --project=auth -d
should generate:
CREATE libs/auth/src/libs/store/auth/auth.actions.ts
CREATE libs/auth/src/libs/store/auth/auth.state.spec.ts
CREATE libs/auth/src/libs/store/auth/auth.state.ts
Workaround
ng g @ngxs/schematics:store --name=store/auth --spec --project=auth --sourceRoot=libs/auth/src/libs -d
--name
consists path
, it should not add extra path prefix. i.e., store/auth/auth.actions.ts -> store/auth.actions.ts
ng g @ngxs/schematics:store --name=store/auth --spec --project=auth -d
should generate
CREATE libs/auth/src/libs/store/auth.actions.ts
CREATE libs/auth/src/libs/store/auth.state.spec.ts
CREATE libs/auth/src/libs/store/auth.state.ts
--name
is not provided, first arg should be treated as --name
ng g @ngxs/schematics:store store/auth --spec --project=auth -d
--spec=true
should be default. if users don't need spec , they can provide --spec=false
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
The option --lint-fix
is not accepted by the schematic @ngxs/schematics:store
.
Allow the files generated by schematics to be automatically linted similar to @ng/cli
.
Run these commands to see difference:
ng g @ngxs/schematics:store --name=test --path=app/store --lint-fix=true
ng g c test --lint-fix=true
After generated files are checked in, the linting by IDE (using project configuration) causes additional changes in subsequent commits.
Libs:
- @angular/core version: 8.2.0
- @ngxs/store version: 3.5.0
For Tooling issues:
- Node version: v10.16.0
- Platform: Linux
Others:
Fedora release 29 (5.1.18-200.fc29.x86_64)
[ x] Bug report
have "style":"scss"
in angular.json
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
and
"cli": {
"defaultCollection": "@ngxs/schematics"
}
ng g c xyz
creating an component with css
types of styles instead of scss
:
CREATE src/app/xyz/xyz.component.html (22 bytes)
CREATE src/app/xyz/xyz.component.spec.ts (607 bytes)
CREATE src/app/xyz/xyz.component.ts (257 bytes)
CREATE src/app/xyz/xyz.component.css (0 bytes)
component gets generated with scss
styles type
CREATE src/app/xyz/xyz.component.html (22 bytes)
CREATE src/app/xyz/xyz.component.spec.ts (607 bytes)
CREATE src/app/xyz/xyz.component.ts (257 bytes)
CREATE src/app/xyz/xyz.component.scss (0 bytes)
ng g my-app --style=scss
ng add @ngxs/schematics
ng g c xyz
respect the angular cli styles config:
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
OS: win32 x64
Angular: 7.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
@ngxs/schematics: ^0.0.1-alpha.5
@angular-devkit/architect 0.13.5
@angular-devkit/build-angular 0.13.5
@angular-devkit/build-optimizer 0.13.5
@angular-devkit/build-webpack 0.13.5
@angular-devkit/core 7.3.5
@angular-devkit/schematics 7.3.5
@angular/cdk 7.3.3
@angular/cli 7.3.5
@angular/fire 5.1.1
@angular/flex-layout 7.0.0-beta.23
@angular/material 7.3.3
@angular/pwa 0.13.5
@ngtools/webpack 7.3.5
@schematics/angular 7.3.5
@schematics/update 0.13.5
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0
For Tooling issues:
I tried this on a new clean Angular 13 app, but I get an error after I try ng add @ngxs/schematics:
Skipping installation: Package already installed An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID [error] Error: NOT SUPPORTED: keyword "id", use "$id" for schema ID at Object.code (D:\Code\ngtemp\node_modules\ajv\dist\vocabularies\core\id.js:6:15) at keywordCode (D:\Code\ngtemp\node_modules\ajv\dist\compile\validate\index.js:454:13) at D:\Code\ngtemp\node_modules\ajv\dist\compile\validate\index.js:222:17 at CodeGen.code (D:\Code\ngtemp\node_modules\ajv\dist\compile\codegen\index.js:439:13) at CodeGen.block (D:\Code\ngtemp\node_modules\ajv\dist\compile\codegen\index.js:568:18) at iterateKeywords (D:\Code\ngtemp\node_modules\ajv\dist\compile\validate\index.js:219:9) at groupKeywords (D:\Code\ngtemp\node_modules\ajv\dist\compile\validate\index.js:208:13) at D:\Code\ngtemp\node_modules\ajv\dist\compile\validate\index.js:192:13 at CodeGen.code (D:\Code\ngtemp\node_modules\ajv\dist\compile\codegen\index.js:439:13) at CodeGen.block (D:\Code\ngtemp\node_modules\ajv\dist\compile\codegen\index.js:568:18)
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
While running checking in the files generated by schematics on my linux machine, noticed that all line-ending were DOS style. See attached image.
The generated files should follow the default line-endings of the OS.
Add schematics to an existing Angular project on a Linux machine.
ng g @ngxs/schematics:store --name=app --path=app/store
Check the line endings on generated files.
While making changes to generated files, too many EOL related changes show up - depending upon the editor & git
configuration.
For now, I am running dos2unix
on generated files.
Libs:
- @angular/core version: 8.2.0
- @ngxs/store version: 3.5.0
For Tooling issues:
- Node version: v10.16.0
- Platform: Linux
Others:
Fedora release 29 (5.1.18-200.fc29.x86_64)
$ ng g ngxs-schematics:store folder/test_state --spec
[CREATE] ./app/folder/test_state.state.ts
[CREATE] ./app/folder/test_state.actions.ts
[CREATE] ./app/folder/test_state.state.spec.ts
[UPDATE] ./app/app.module.ts
Proper storage generation
ng g ngxs-schematics:example --type [ simple | best-practise ]
$ ng g ngxs-schematics:example --type simple
[CREATE] ./app/store/app.state.ts
$ ng g ngxs-schematics:example --type best-practise
[CREATE] ./app/store/app.state.ts
[CREATE] ./app/store/app.actions.ts
[CREATE] ./app/store/app.state.spec.ts
[CREATE] ./app/store/auth/auth.state.ts
[CREATE] ./app/store/auth/auth.actions.ts
[CREATE] ./app/store/auth/auth.state.spec.ts
[CREATE] ./app/store/dashboard/dashboard.state.ts
[CREATE] ./app/store/dashboard/dashboard.actions.ts
[CREATE] ./app/store/dashboard/dashboard.state.spec.ts
ng g @ngxs/schematics:state states/test
CREATE src/states/test/test.state.spec.ts (685 bytes)
CREATE src/states/test/test.state.ts (337 bytes)
ng g @ngxs/schematics:state states/test
CREATE src/app/states/test.state.spec.ts (146 bytes)
CREATE src/app/states/test.state.ts (22 bytes)
I'd like to be able to use NGXS' schematics the same way I use Angular's schematics. Right now, if I want the same result, I have to run a command like this :
ng g @ngxs/schematics:actions --name logout --sourceRoot src/app --path actions --spec true
With Angular's schematics, the commands looks like this :
ng g class classes/test
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.