Skip to content

Commit

Permalink
ng schematics preparations
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDanilov committed Sep 2, 2024
1 parent 43b9072 commit 1e9d274
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 19 deletions.
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"lfx-ng-schematics:lfx-component": {
"path": "projects/lfx-component-lib/src/lib/components"
}
},
"architect": {
Expand Down
105 changes: 100 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"storybook": "ng run lfx-component-lib:storybook",
"build-storybook": "ng run lfx-component-lib:build-storybook",
"chromatic": "npx chromatic --project-token=chpt_92f26893ce6e479",
"verdaccio": "npx verdaccio"
"verdaccio": "npx verdaccio",
"publish": "cd ./dist/lfx-component-lib && npm publish --registry http://localhost:4873"
},
"dependencies": {
"@angular/animations": "^18.0.0",
Expand All @@ -35,6 +36,7 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.1.2",
"@angular-devkit/schematics": "^18.2.2",
"@angular/cli": "^18.0.5",
"@angular/compiler-cli": "^18.0.0",
"@chromatic-com/storybook": "^1.6.1",
Expand Down
20 changes: 10 additions & 10 deletions projects/lfx-component-lib/documentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'error' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5210&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('error');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'error' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5210&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('error');\n }\n}"
},
{
"name": "meta",
Expand All @@ -38,7 +38,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Meta<ToastComponent>",
"defaultValue": "{\n title: 'LFX Components/Containers/Toast',\n component: ToastComponent,\n tags: ['autodocs'],\n render: (args) => ({\n template: `\n <lfx-toast type=\"${args.type}\">\n <h1>Title</h1>\n <p>Body paragraph</p>\n </lfx-toast>\n `,\n }),\n argTypes: {\n type: {\n control: 'select',\n options: ['notice', 'warning', 'success', 'error'] as IType[],\n },\n },\n args: {\n type: 'notice' as IType,\n },\n}"
"defaultValue": "{\n title: 'LFX Components/Containers/Toast',\n component: ToastComponent,\n tags: ['autodocs'],\n render: (args) => ({\n template: `\n <lfx-toast type=\"${args.type}\">\n <h1>Title</h1>\n <p>Body paragraph</p>\n </lfx-toast>\n `,\n }),\n argTypes: {\n type: {\n control: 'select',\n options: ['notice', 'warning', 'success', 'error'] as IType[],\n },\n },\n args: {\n // @ts-ignore\n type: 'notice' as IType,\n },\n}"
},
{
"name": "Notice",
Expand All @@ -48,7 +48,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'notice' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5198&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('notice');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'notice' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5198&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('notice');\n }\n}"
},
{
"name": "preview",
Expand Down Expand Up @@ -78,7 +78,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'success' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5207&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('success');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'success' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5207&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('success');\n }\n}"
},
{
"name": "Warning",
Expand All @@ -88,7 +88,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'warning' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5205&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('warning');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'warning' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5205&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('warning');\n }\n}"
}
],
"functions": [
Expand Down Expand Up @@ -157,7 +157,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'error' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5210&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('error');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'error' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5210&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('error');\n }\n}"
},
{
"name": "meta",
Expand All @@ -167,7 +167,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Meta<ToastComponent>",
"defaultValue": "{\n title: 'LFX Components/Containers/Toast',\n component: ToastComponent,\n tags: ['autodocs'],\n render: (args) => ({\n template: `\n <lfx-toast type=\"${args.type}\">\n <h1>Title</h1>\n <p>Body paragraph</p>\n </lfx-toast>\n `,\n }),\n argTypes: {\n type: {\n control: 'select',\n options: ['notice', 'warning', 'success', 'error'] as IType[],\n },\n },\n args: {\n type: 'notice' as IType,\n },\n}"
"defaultValue": "{\n title: 'LFX Components/Containers/Toast',\n component: ToastComponent,\n tags: ['autodocs'],\n render: (args) => ({\n template: `\n <lfx-toast type=\"${args.type}\">\n <h1>Title</h1>\n <p>Body paragraph</p>\n </lfx-toast>\n `,\n }),\n argTypes: {\n type: {\n control: 'select',\n options: ['notice', 'warning', 'success', 'error'] as IType[],\n },\n },\n args: {\n // @ts-ignore\n type: 'notice' as IType,\n },\n}"
},
{
"name": "Notice",
Expand All @@ -177,7 +177,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'notice' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5198&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('notice');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'notice' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5198&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('notice');\n }\n}"
},
{
"name": "Success",
Expand All @@ -187,7 +187,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'success' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5207&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('success');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'success' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5207&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('success');\n }\n}"
},
{
"name": "Warning",
Expand All @@ -197,7 +197,7 @@
"deprecated": false,
"deprecationMessage": "",
"type": "Story",
"defaultValue": "{\n args: {\n type: 'warning' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5205&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('warning');\n }\n}"
"defaultValue": "{\n args: {\n // @ts-ignore\n type: 'warning' as IType,\n },\n parameters: {\n design: {\n type: \"figspec\",\n url: \"https://www.figma.com/design/nj8rOxBtzQCa7KrvBxF4aF/Coherence-Design-System?node-id=772-5205&t=zfHib1d5XSXabYJp-4\",\n },\n },\n play: async ( {canvasElement} ) => {\n const element = getElement(canvasElement);\n await expect(element.classList).toContain('warning');\n }\n}"
}
],
"projects/lfx-component-lib/src/lib/containers/sections/__docs__/sections.stories.ts": [
Expand Down
4 changes: 2 additions & 2 deletions projects/lfx-component-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "lfx-component-lib",
"version": "0.0.14",
"version": "0.0.20",
"scripts": {
"build": "tsc -p tsconfig.schematics.json",
"postbuild": "copyfiles schematics/collection.json ../../dist/lfx-component-lib/"
"postbuild": "copyfiles schematics/collection.json schematics/*/schema.json schematics/*/files/** ../../dist/lfx-component-lib/"
},
"ng-add": {
"save": "true"
Expand Down
Loading

0 comments on commit 1e9d274

Please sign in to comment.