Skip to content

Commit 0b3612a

Browse files
authored
refactor: replace legacy schematics with Nx-generators (#56)
* chore: run `npm i --save-dev @nrwl/js` * chore: `nx.json` set default generator options * chore: run `npm i --save-dev @nrwl/angular` * chore: `nx.json` update default generator options * chore: sync version of all nx-packages * chore: `nx.json` fix invalid generator name * chore: delete legacy schematics (replaced by Nx-generators)
1 parent a6e7077 commit 0b3612a

16 files changed

+2182
-1028
lines changed

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# compiled schematics
2-
schematics/library-starter/*.js
3-
schematics/library-starter/*.js.map
4-
schematics/library-starter/*.d.ts
5-
61
# compiled output
72
/dist
83
/tmp

README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,24 @@
1313
1414
1. Run `npm ci` to install everything
1515

16-
2. Run `npm run add [your-library-name]` to create basic file structure
16+
2. Change `npmScope` inside `nx.json`
1717

18-
3. Fill in `projects/[your-library-name]/package.json` metadata for your newly generated library
18+
3. Create basic file structure via [Nx-generators](https://nx.dev/plugin-features/use-code-generators):
1919

20-
4. Add your email at [INSERT YOUR EMAIL HERE] in `CODE_OF_CONDUCT.md`
20+
- `nx g @nrwl/js:library [your-library-name]` - create Typescript library. See
21+
[available options](https://nx.dev/packages/js/generators/library#options).
22+
- `nx g @nrwl/angular:library [your-library-name]` - create Angular library. See
23+
[available options](https://nx.dev/packages/angular/generators/library#options).
2124

22-
5. Update `LICENSE` file according to your preferences
25+
4. Fill in `projects/[your-library-name]/package.json` metadata for your newly generated library
2326

24-
6. Updated root `package.json` metadata to represent your project
27+
5. Add your email at [INSERT YOUR EMAIL HERE] in `CODE_OF_CONDUCT.md`
2528

26-
7. Code your library and create demo for it
29+
6. Update `LICENSE` file according to your preferences
30+
31+
7. Update root `package.json` metadata to represent your project
32+
33+
8. Code your library and create demo for it
2734

2835
## Cool features
2936

nx.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,22 @@
2828
"libsDir": "projects",
2929
"appsDir": "projects"
3030
},
31-
"defaultProject": "demo"
31+
"defaultProject": "demo",
32+
"generators": {
33+
"@nrwl/js:library": {
34+
"buildable": true,
35+
"strict": true,
36+
"linter": "none",
37+
"unitTestRunner": "jest",
38+
"config": "workspace"
39+
},
40+
"@nrwl/angular:library": {
41+
"buildable": true,
42+
"compilationMode": "partial",
43+
"linter": "none",
44+
"unitTestRunner": "jest",
45+
"strict": true,
46+
"skipModule": true
47+
}
48+
}
3249
}

0 commit comments

Comments
 (0)