Skip to content

Commit 9369d95

Browse files
author
AlexD
authored
Merge pull request #15 from sir-alex/tech/ng-schematics-stories-generation
Verdaccio setup, NG schematics setup
2 parents 6cdee3f + 43b9072 commit 9369d95

File tree

8 files changed

+3363
-2740
lines changed

8 files changed

+3363
-2740
lines changed

package-lock.json

+1,047-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
"build-colors": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/build-colors.ts",
99
"build-constants": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/build-constants.ts",
1010
"start": "ng serve",
11-
"prebuild": "yarn run build-constants && yarn run build-typography && yarn run build-colors",
11+
"increase-patch": "npm version patch --prefix projects/lfx-component-lib",
12+
"prebuild": "npm run increase-patch && npm run build-constants && npm run build-typography && npm run build-colors",
1213
"build": "ng build",
14+
"postbuild": "npm run build --prefix projects/lfx-component-lib",
1315
"watch": "ng build --watch --configuration development",
1416
"test": "ng test",
1517
"storybook": "ng run lfx-component-lib:storybook",
1618
"build-storybook": "ng run lfx-component-lib:build-storybook",
17-
"chromatic": "npx chromatic --project-token=chpt_92f26893ce6e479"
19+
"chromatic": "npx chromatic --project-token=chpt_92f26893ce6e479",
20+
"verdaccio": "npx verdaccio"
1821
},
1922
"dependencies": {
2023
"@angular/animations": "^18.0.0",
@@ -48,6 +51,7 @@
4851
"@storybook/test": "^8.2.6",
4952
"@types/jasmine": "~5.1.0",
5053
"chromatic": "^11.7.1",
54+
"copyfiles": "^2.4.1",
5155
"jasmine-core": "~5.1.0",
5256
"karma": "~6.4.0",
5357
"karma-chrome-launcher": "~3.2.0",

projects/lfx-component-lib/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.1.0.
44

5+
## Installation with NG CLI
6+
`ng add lfx-component-lib`
7+
58
## Code scaffolding
69

710
Run `ng generate component component-name --project lfx-component-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project lfx-component-lib`.

projects/lfx-component-lib/package.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
{
2-
"name": "@emlimlf/lfx-component-lib",
3-
"version": "0.0.10",
2+
"name": "lfx-component-lib",
3+
"version": "0.0.14",
4+
"scripts": {
5+
"build": "tsc -p tsconfig.schematics.json",
6+
"postbuild": "copyfiles schematics/collection.json ../../dist/lfx-component-lib/"
7+
},
8+
"ng-add": {
9+
"save": "true"
10+
},
11+
"schematics": "./schematics/collection.json",
412
"peerDependencies": {
513
"@angular/common": "^18.1.0",
614
"@angular/core": "^18.1.0"
715
},
816
"dependencies": {
917
"tslib": "^2.3.0"
1018
},
19+
"devDependencies": {
20+
"copyfiles": "^2.4.1"
21+
},
1122
"sideEffects": false,
1223
"publishConfig": {
13-
"registry": "https://npm.pkg.github.com/@emlimlf"
14-
},
15-
"repository": {
16-
"type": "git",
17-
"url": "https://github.com/emlimlf/lfx-component-lib.git"
24+
"registry": "http://localhost:4873"
1825
},
1926
"exports": {
2027
"./color-palette.json": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3+
"schematics": {
4+
"ng-add": {
5+
"description": "Add LFX Component Lib to the project",
6+
"factory": "./ng-add/index#ngAdd"
7+
}
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2+
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
3+
4+
export function ngAdd(): Rule {
5+
return (tree: Tree, context: SchematicContext) => {
6+
context.logger.info('Installing dependencies...');
7+
context.addTask(new NodePackageInstallTask());
8+
return tree;
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"lib": [
5+
"es2018",
6+
"dom"
7+
],
8+
"declaration": true,
9+
"module": "commonjs",
10+
"moduleResolution": "node",
11+
"noEmitOnError": true,
12+
"noFallthroughCasesInSwitch": true,
13+
"noImplicitAny": true,
14+
"noImplicitThis": true,
15+
"noUnusedParameters": true,
16+
"noUnusedLocals": true,
17+
"rootDir": "schematics",
18+
"outDir": "../../dist/lfx-component-lib/schematics",
19+
"skipDefaultLibCheck": true,
20+
"skipLibCheck": true,
21+
"sourceMap": true,
22+
"strictNullChecks": true,
23+
"target": "es6",
24+
"types": [
25+
"jasmine",
26+
"node"
27+
]
28+
},
29+
"include": [
30+
"schematics/**/*"
31+
],
32+
"exclude": [
33+
"schematics/*/files/**/*"
34+
]
35+
}

0 commit comments

Comments
 (0)