create-stencil-components 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +55 -0
  4. package/dist/index.mjs +396 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/templates/base/.editorconfig +15 -0
  7. package/dist/templates/base/.eslintignore +4 -0
  8. package/dist/templates/base/.gemini/settings.json +13 -0
  9. package/dist/templates/base/.husky/commit-msg +1 -0
  10. package/dist/templates/base/.husky/install.mjs +6 -0
  11. package/dist/templates/base/.husky/pre-commit +2 -0
  12. package/dist/templates/base/.mcp.json +12 -0
  13. package/dist/templates/base/.nvmrc +1 -0
  14. package/dist/templates/base/.prettierignore +2 -0
  15. package/dist/templates/base/.stylelintignore +0 -0
  16. package/dist/templates/base/AGENTS.md +118 -0
  17. package/dist/templates/base/CLAUDE.md +16 -0
  18. package/dist/templates/base/README.md +83 -0
  19. package/dist/templates/base/commitlint.config.mjs +1 -0
  20. package/dist/templates/base/docs/CODE_OF_CONDUCT.md +122 -0
  21. package/dist/templates/base/docs/CONTRIBUTING.md +103 -0
  22. package/dist/templates/base/docs/LICENSE.md +21 -0
  23. package/dist/templates/base/docs/RELEASE.md +95 -0
  24. package/dist/templates/base/docs/STYLE_GUIDE.md +128 -0
  25. package/dist/templates/base/eslint.config.mjs +37 -0
  26. package/dist/templates/base/gitignore +32 -0
  27. package/dist/templates/base/nx.json +36 -0
  28. package/dist/templates/base/package.json +43 -0
  29. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/CHANGELOG.md +0 -0
  30. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/README.md +74 -0
  31. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/project.json +144 -0
  32. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/my-component.scss +3 -0
  33. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/my-component.tsx +32 -0
  34. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/readme.md +19 -0
  35. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/test/my-component.e2e.ts +32 -0
  36. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/test/my-component.spec.ts +36 -0
  37. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components.d.ts +61 -0
  38. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/index.html +14 -0
  39. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/index.ts +12 -0
  40. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/main.scss +0 -0
  41. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/utils/utils.spec.ts +19 -0
  42. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/utils/utils.ts +3 -0
  43. package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/tsconfig.json +12 -0
  44. package/dist/templates/base/prettier.config.mjs +19 -0
  45. package/dist/templates/base/stylelint.config.mjs +25 -0
  46. package/dist/templates/base/tsconfig.base.json +23 -0
  47. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/CHANGELOG.md +0 -0
  48. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/README.md +108 -0
  49. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/ng-package.json +6 -0
  50. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/package.json +27 -0
  51. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/project.json +93 -0
  52. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/components-{{PROJECT_NAME_KEBAB}}.module.ts +20 -0
  53. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/directives/.gitkeep +0 -0
  54. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/index.ts +3 -0
  55. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/ng-package.json +6 -0
  56. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/directives/.gitkeep +0 -0
  57. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/index.ts +1 -0
  58. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/tsconfig.json +41 -0
  59. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +85 -0
  60. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +90 -0
  61. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/CHANGELOG.md +0 -0
  62. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/README.md +97 -0
  63. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/package.json +48 -0
  64. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/project.json +92 -0
  65. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/components/index.ts +1 -0
  66. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/index.ts +1 -0
  67. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/tsconfig.json +36 -0
  68. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/CHANGELOG.md +0 -0
  69. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/README.md +78 -0
  70. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/package.json +43 -0
  71. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/project.json +92 -0
  72. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/components/index.ts +1 -0
  73. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/index.ts +1 -0
  74. package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/tsconfig.json +39 -0
  75. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/CHANGELOG.md +0 -0
  76. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/README.md +108 -0
  77. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/ng-package.json +6 -0
  78. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/package.json +27 -0
  79. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/project.json +93 -0
  80. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/components-{{PROJECT_NAME_KEBAB}}.module.ts +20 -0
  81. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/directives/.gitkeep +0 -0
  82. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/index.ts +3 -0
  83. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/ng-package.json +6 -0
  84. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/directives/.gitkeep +0 -0
  85. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/index.ts +1 -0
  86. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/tsconfig.json +41 -0
  87. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +83 -0
  88. package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +72 -0
  89. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +83 -0
  90. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +67 -0
  91. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/CHANGELOG.md +0 -0
  92. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/README.md +97 -0
  93. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/package.json +48 -0
  94. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/project.json +92 -0
  95. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/components/index.ts +1 -0
  96. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/index.ts +1 -0
  97. package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/tsconfig.json +36 -0
  98. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +83 -0
  99. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +67 -0
  100. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/CHANGELOG.md +0 -0
  101. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/README.md +78 -0
  102. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/package.json +43 -0
  103. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/project.json +92 -0
  104. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/components/index.ts +1 -0
  105. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/index.ts +1 -0
  106. package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/tsconfig.json +39 -0
  107. package/dist/templates/variants/web-components/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +82 -0
  108. package/dist/templates/variants/web-components/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +58 -0
  109. package/package.json +60 -0
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html dir="ltr" lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
6
+ <title>{{PROJECT_NAME}}</title>
7
+
8
+ <script type="module" src="/build/components-{{PROJECT_NAME_KEBAB}}-core.esm.js"></script>
9
+ <script nomodule src="/build/components-{{PROJECT_NAME_KEBAB}}-core.js"></script>
10
+ </head>
11
+ <body>
12
+ <my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
13
+ </body>
14
+ </html>
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @fileoverview entry point for your component library
3
+ *
4
+ * This is the entry point for your component library. Use this file to export utilities,
5
+ * constants or data structure that accompany your components.
6
+ *
7
+ * DO NOT use this file to export your components. Instead, use the recommended approaches
8
+ * to consume components of this package as outlined in the `README.md`.
9
+ */
10
+
11
+ export { format } from './utils/utils';
12
+ export type * from './components.d.ts';
@@ -0,0 +1,19 @@
1
+ import { format } from './utils';
2
+
3
+ describe('format', () => {
4
+ it('returns empty string for no names defined', () => {
5
+ expect(format(undefined, undefined, undefined)).toEqual('');
6
+ });
7
+
8
+ it('formats just first names', () => {
9
+ expect(format('Joseph', undefined, undefined)).toEqual('Joseph');
10
+ });
11
+
12
+ it('formats first and last names', () => {
13
+ expect(format('Joseph', undefined, 'Publique')).toEqual('Joseph Publique');
14
+ });
15
+
16
+ it('formats first, middle and last names', () => {
17
+ expect(format('Joseph', 'Quincy', 'Publique')).toEqual('Joseph Quincy Publique');
18
+ });
19
+ });
@@ -0,0 +1,3 @@
1
+ export function format(first?: string, middle?: string, last?: string): string {
2
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "include": [
4
+ "src"
5
+ ],
6
+ "exclude": [
7
+ "coverage",
8
+ "dist",
9
+ "docs",
10
+ "node_modules"
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @see https://prettier.io/docs/configuration
3
+ * @type {import("prettier").Config}
4
+ */
5
+ const config = {
6
+ arrowParens: "avoid",
7
+ bracketSpacing: true,
8
+ bracketSameLine: false,
9
+ jsxSingleQuote: false,
10
+ quoteProps: "consistent",
11
+ printWidth: 180,
12
+ semi: true,
13
+ singleQuote: true,
14
+ tabWidth: 4,
15
+ trailingComma: "all",
16
+ useTabs: false
17
+ };
18
+
19
+ export default config;
@@ -0,0 +1,25 @@
1
+ /** @type {import('stylelint').Config} */
2
+ export default {
3
+ extends: ['stylelint-config-standard-scss'],
4
+ plugins: ['stylelint-use-logical'],
5
+ rules: {
6
+ 'block-no-empty': null,
7
+ 'custom-property-pattern': [
8
+ `^_?([a-z][a-z0-9]*)(-[a-z0-9]+)*$`,
9
+ {
10
+ message: (name) => `Expected custom property name "${name}" to be kebab-case`
11
+ }
12
+ ],
13
+ 'csstools/use-logical': ('always' || true) || ('ignore' || false || null),
14
+ 'declaration-empty-line-before': null,
15
+ 'media-feature-range-notation': null,
16
+ 'no-empty-source': null,
17
+ 'selector-class-pattern': null,
18
+ 'selector-pseudo-class-no-unknown': [
19
+ true,
20
+ {
21
+ ignorePseudoClasses: ['global', 'export']
22
+ }
23
+ ]
24
+ }
25
+ };
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowSyntheticDefaultImports": true,
4
+ "allowUnreachableCode": false,
5
+ "declaration": false,
6
+ "experimentalDecorators": true,
7
+ "lib": [
8
+ "dom",
9
+ "es2022"
10
+ ],
11
+ "moduleResolution": "bundler",
12
+ "module": "esnext",
13
+ "target": "es2022",
14
+ "noUnusedLocals": true,
15
+ "noUnusedParameters": true,
16
+ "jsx": "react",
17
+ "jsxFactory": "h",
18
+ "jsxFragmentFactory": "h.Fragment",
19
+ "noImplicitAny": true,
20
+ "skipLibCheck": true,
21
+ "resolveJsonModule": true
22
+ }
23
+ }
@@ -0,0 +1,108 @@
1
+ # @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-angular
2
+
3
+ ## Overview
4
+
5
+ Angular specific wrappers for the @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core package.
6
+
7
+ ## Tasks
8
+
9
+ The following is a list of available command line tasks:
10
+
11
+ | Task | Description |
12
+ | ------------- | ----------------------------------------------- |
13
+ | clean | Deletes build outputs of the package. |
14
+ | build | Builds the package. |
15
+ | format | Validates the form of the package. |
16
+ | format:fix | Performs a format fix of the package. |
17
+ | lint | Validates the code of the package. |
18
+ | lint:fix | Performs a validation fix of the package. |
19
+ | test | Performs a test run of the package. |
20
+
21
+ You can execute tasks within an [Nx](https://nx.dev) workspace using several methods. Here are the most common approaches:
22
+
23
+ **From the `workspace` root:**
24
+
25
+ Use the full package target path to run tasks:
26
+
27
+ ```sh
28
+ npx nx run components-{{PROJECT_NAME_KEBAB}}-angular:[task]
29
+ npx nx run components-{{PROJECT_NAME_KEBAB}}-angular:build
30
+ ```
31
+
32
+ **From within the package directory:**
33
+
34
+ Navigate to packages/components-{{PROJECT_NAME_KEBAB}}-angular and run the task directly:
35
+
36
+ ```sh
37
+ npx nx run [task]
38
+ npx nx run build
39
+ ```
40
+
41
+ ## Folder Hierarchy
42
+
43
+ The package structure is organized as follows:
44
+
45
+ ```text
46
+ ├── src/ # Directory for lazy loaded component implementations
47
+ ├── standalone/ # Directory for standalone component implementations
48
+ ├── ng-package.json # Ng-packagr configuration
49
+ ├── package.json # Root configuration: workspaces, dependencies, and scripts
50
+ ├── project.json # Project Nx build system configuration
51
+ ├── tsconfig.json # TypeScript configuration
52
+ ├── CHANGELOG.md # Changelog documentation
53
+ └── README.md # Package documentation
54
+ ```
55
+
56
+ ## Consumer Consumption
57
+
58
+ ### Prerequisite: Install Dependencies
59
+
60
+ ```sh
61
+ npm install @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-angular
62
+ ```
63
+
64
+ ### Using Framework Wrappers
65
+
66
+ **Registration**: In the Angular library's main module (or main.ts for standalone apps), use the Stencil loader to register the components with the browser:
67
+
68
+ ```ts
69
+ import { defineCustomElements } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core/loader';
70
+ defineCustomElements();
71
+ ```
72
+
73
+ **Usage**: In your Angular application, import the generated wrapper module or individual standalone components:
74
+
75
+ ```ts
76
+ import { MyComponent } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-angular/standalone';;
77
+
78
+ @Component({
79
+ selector: 'app-root',
80
+ standalone: true,
81
+ imports: [MyComponent], // Use the wrapper component here
82
+ template: `<my-component [first]="'Stencil'" [last]="'Angular'"></my-component>`
83
+ })
84
+ export class AppComponent { ... }
85
+ ```
86
+
87
+ ### Using Custom Elements Directly
88
+
89
+ **Registration**: In main.ts, import the loader to register all components with the browser's CustomElementRegistry.
90
+
91
+ ```ts
92
+ import { defineCustomElements } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core/loader';
93
+ defineCustomElements();
94
+ ```
95
+
96
+ **Usage**: Angular will error on unknown tags. You must add CUSTOM_ELEMENTS_SCHEMA to any module or component that uses the Stencil tags.
97
+
98
+ ```tsx
99
+ import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
100
+
101
+ @Component({
102
+ selector: 'app-root',
103
+ standalone: true,
104
+ schemas: [CUSTOM_ELEMENTS_SCHEMA], // Tells Angular to ignore unknown tags
105
+ template: `<my-component [first]="'Stencil'" [last]="'Angular'"></my-component>`
106
+ })
107
+ export class AppComponent { }
108
+ ```
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "lib": {
4
+ "entryFile": "src/index.ts"
5
+ }
6
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-angular",
3
+ "version": "0.0.0",
4
+ "description": "Angular specific wrappers for @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core",
5
+ "keywords": [
6
+ "angular",
7
+ "stencil",
8
+ "stenciljs"
9
+ ],
10
+ "scripts": {
11
+ "clean": "rimraf --glob dist src/directives/generated standalone/src/directives/generated",
12
+ "build": "ng-packagr -p ng-package.json -c tsconfig.json"
13
+ },
14
+ "dependencies": {
15
+ "tslib": "2.8.1"
16
+ },
17
+ "peerDependencies": {
18
+ "@angular/common": ">=19",
19
+ "@angular/core": ">=19",
20
+ "@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core": "*",
21
+ "rxjs": ">=7.8.2"
22
+ },
23
+ "devDependencies": {
24
+ "ng-packagr": "21.0.1"
25
+ },
26
+ "license": "MIT"
27
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "components-{{PROJECT_NAME_KEBAB}}-angular",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "namedInputs": {
5
+ "default": ["{projectRoot}/**/*"]
6
+ },
7
+ "targets": {
8
+ "clean": {
9
+ "cache": false,
10
+ "executor": "nx:run-script",
11
+ "inputs": [
12
+ {
13
+ "externalDependencies": ["rimraf"]
14
+ }
15
+ ],
16
+ "options": {
17
+ "script": "clean",
18
+ "cwd": "{projectRoot}"
19
+ }
20
+ },
21
+ "build": {
22
+ "cache": false,
23
+ "dependsOn": [
24
+ {
25
+ "projects": ["components-{{PROJECT_NAME_KEBAB}}-core"],
26
+ "target": "build"
27
+ },
28
+ "^lint"
29
+ ],
30
+ "executor": "nx:run-script",
31
+ "inputs": [
32
+ "default",
33
+ {
34
+ "externalDependencies": ["ng-packagr"]
35
+ }
36
+ ],
37
+ "options": {
38
+ "script": "build",
39
+ "cwd": "{projectRoot}"
40
+ },
41
+ "outputs": [
42
+ "{projectRoot}/dist",
43
+ "{projectRoot}/src/directives/generated",
44
+ "{projectRoot}/standalone/src/directives/generated"
45
+ ]
46
+ },
47
+ "format": {
48
+ "cache": false,
49
+ "executor": "nx:run-script",
50
+ "options": {
51
+ "script": "format",
52
+ "cwd": "{projectRoot}"
53
+ }
54
+ },
55
+ "format:fix": {
56
+ "cache": false,
57
+ "executor": "nx:run-script",
58
+ "options": {
59
+ "script": "format:fix",
60
+ "cwd": "{projectRoot}"
61
+ }
62
+ },
63
+ "lint": {
64
+ "cache": false,
65
+ "executor": "nx:run-commands",
66
+ "options": {
67
+ "commands": ["npm run lint:eslint", "npm run lint:stylelint"],
68
+ "cwd": "{projectRoot}",
69
+ "parallel": true
70
+ }
71
+ },
72
+ "lint:fix": {
73
+ "cache": false,
74
+ "executor": "nx:run-commands",
75
+ "options": {
76
+ "commands": ["npm run lint:eslint:fix", "npm run lint:stylelint:fix"],
77
+ "cwd": "{projectRoot}",
78
+ "parallel": true
79
+ }
80
+ },
81
+ "test": {
82
+ "cache": false,
83
+ "executor": "nx:run-script",
84
+ "inputs": [
85
+ "default"
86
+ ],
87
+ "options": {
88
+ "script": "test",
89
+ "cwd": "{projectRoot}"
90
+ }
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,20 @@
1
+ import { APP_INITIALIZER, NgModule } from '@angular/core';
2
+
3
+ import { CommonModule } from '@angular/common';
4
+ import { DIRECTIVES } from './directives/generated';
5
+ import { defineCustomElements } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core/loader';
6
+
7
+ @NgModule({
8
+ declarations: [...DIRECTIVES],
9
+ exports: [...DIRECTIVES],
10
+ imports: [CommonModule],
11
+ providers: [
12
+ {
13
+ provide: APP_INITIALIZER,
14
+ useFactory: () => defineCustomElements,
15
+ multi: true,
16
+ }
17
+ ],
18
+ })
19
+
20
+ export class Components{{PROJECT_NAME_PASCAL}}Module {}
@@ -0,0 +1,3 @@
1
+ export * from './directives/generated/components';
2
+ export { DIRECTIVES } from './directives/generated';
3
+ export * from './components-{{PROJECT_NAME_KEBAB}}.module';
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "lib": {
4
+ "entryFile": "src/index.ts"
5
+ }
6
+ }
@@ -0,0 +1 @@
1
+ export * from './directives/generated/components';
@@ -0,0 +1,41 @@
1
+ {
2
+ "angularCompilerOptions": {
3
+ "compilationMode": "partial",
4
+ "enableI18nLegacyMessageId": false,
5
+ "strictInjectionParameters": true,
6
+ "strictInputAccessModifiers": true,
7
+ "strictTemplates": true
8
+ },
9
+ "buildOnSave": false,
10
+ "compileOnSave": false,
11
+ "compilerOptions": {
12
+ "declaration": true,
13
+ "declarationDir": "./dist/types",
14
+ "esModuleInterop": true,
15
+ "experimentalDecorators": true,
16
+ "importHelpers": true,
17
+ "lib": [
18
+ "dom",
19
+ "es2022"
20
+ ],
21
+ "module": "esnext",
22
+ "moduleResolution": "bundler",
23
+ "noFallthroughCasesInSwitch": true,
24
+ "noImplicitOverride": true,
25
+ "noImplicitReturns": true,
26
+ "noPropertyAccessFromIndexSignature": true,
27
+ "outDir": "dist",
28
+ "skipLibCheck": true,
29
+ "strict": true,
30
+ "sourceMap": false,
31
+ "target": "es2022"
32
+ },
33
+ "files": [
34
+ "src/index.ts",
35
+ "standalone/src/index.ts"
36
+ ],
37
+ "exclude": [
38
+ "dist",
39
+ "node_modules"
40
+ ]
41
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core",
3
+ "version": "0.0.0",
4
+ "description": "Base set of atoms and modules for {{PROJECT_NAME_KEBAB}}",
5
+ "keywords": [
6
+ "components",
7
+ "stencil",
8
+ "stenciljs",
9
+ "web components"
10
+ ],
11
+ "main": "dist/index.cjs.js",
12
+ "module": "dist/index.js",
13
+ "es2015": "dist/esm/index.js",
14
+ "es2017": "dist/esm/index.js",
15
+ "types": "dist/types/index.d.ts",
16
+ "collection": "dist/collection/collection-manifest.json",
17
+ "collection:main": "dist/collection/index.js",
18
+ "unpkg": "dist/components-{{PROJECT_NAME_KEBAB}}-core/components-{{PROJECT_NAME_KEBAB}}-core.esm.js",
19
+ "exports": {
20
+ ".": {
21
+ "default": "./dist/index.mjs",
22
+ "import": "./dist/index.mjs",
23
+ "require": "./dist/index.cjs.js",
24
+ "types": "./dist/types/index.d.ts"
25
+ },
26
+ "./components/*.js": {
27
+ "import": "./dist/components/*.js",
28
+ "types": "./dist/types/components/*.d.ts"
29
+ },
30
+ "./components": {
31
+ "default": "./dist/index.js",
32
+ "import": "./dist/index.js",
33
+ "require": "./dist/index.cjs.js",
34
+ "types": "./dist/types/components.d.ts"
35
+ },
36
+ "./hydrate": {
37
+ "default": "./dist/hydrate/index.mjs",
38
+ "import": "./dist/hydrate/index.mjs",
39
+ "require": "./dist/hydrate/index.js",
40
+ "types": "./dist/hydrate/index.d.ts"
41
+ },
42
+ "./loader": {
43
+ "default": "./dist/loader/index.js",
44
+ "import": "./dist/loader/index.js",
45
+ "require": "./dist/loader/index.cjs",
46
+ "types": "./dist/loader/index.d.ts"
47
+ }
48
+ },
49
+ "files": [
50
+ "dist/"
51
+ ],
52
+ "scripts": {
53
+ "clean": "rimraf --glob coverage dist .stencil",
54
+ "build": "stencil build --ci",
55
+ "format": "prettier src/**/*.{ts,tsx} --check --config ../../prettier.config.mjs --ignore-path ../../.prettierignore",
56
+ "format:fix": "prettier src/**/*.{ts,tsx} --write --check --config ../../prettier.config.mjs --ignore-path ../../.prettierignore",
57
+ "generate": "stencil generate",
58
+ "lint:eslint": "eslint src --config ../../eslint.config.mjs",
59
+ "lint:stylelint": "stylelint src/**/*.{css,scss} --config ../../stylelint.config.mjs --ignore-path ../../.stylelintignore",
60
+ "lint:fix:eslint": "eslint src --config ../../eslint.config.mjs --fix",
61
+ "lint:fix:stylelint": "stylelint src/**/*.{css,scss} --config ../../stylelint.config.mjs --ignore-path ../../.stylelintignore --fix",
62
+ "server:dev": "stencil build --dev --watch --serve --no-open --ci",
63
+ "test": "stencil test --spec --coverage --no-cache",
64
+ "test:e2e": "stencil test --e2e",
65
+ "test:watch": "stencil test --spec --e2e --watchAll"
66
+ },
67
+ "dependencies": {
68
+ "tslib": "2.8.1"
69
+ },
70
+ "devDependencies": {
71
+ "@stencil/angular-output-target": "1.1.1",
72
+ "@stencil/core": "4.40.1",
73
+ "@stencil/react-output-target": "1.2.0",
74
+ "@stencil/sass": "3.2.3",
75
+ "@stencil/vue-output-target": "0.11.8",
76
+ "@types/jest": "29.5.14",
77
+ "@types/node": "25.0.3",
78
+ "jest": "29.7.0",
79
+ "jest-cli": "29.7.0",
80
+ "puppeteer": "24.33.1",
81
+ "sass": "1.97.0",
82
+ "stencil-inline-svg": "1.1.0"
83
+ },
84
+ "license": "MIT"
85
+ }
@@ -0,0 +1,90 @@
1
+ import { angularOutputTarget } from '@stencil/angular-output-target';
2
+ import { Config } from '@stencil/core';
3
+ import { reactOutputTarget } from '@stencil/react-output-target';
4
+ import { sass } from '@stencil/sass';
5
+ import { vueOutputTarget } from '@stencil/vue-output-target';
6
+ import { inlineSvg } from 'stencil-inline-svg';
7
+
8
+ const dev = process.argv.includes('--dev');
9
+
10
+ export const config: Config = {
11
+ namespace: 'components-{{PROJECT_NAME_KEBAB}}-core',
12
+ autoprefixCss: false,
13
+ buildEs5: 'prod',
14
+ devServer: {
15
+ port: 3333,
16
+ reloadStrategy: 'pageReload'
17
+ },
18
+ extras: {
19
+ enableImportInjection: true
20
+ },
21
+ globalStyle: 'src/main.scss',
22
+ hashFileNames: !dev,
23
+ hydratedFlag: {
24
+ selector: 'attribute'
25
+ },
26
+ outputTargets: [
27
+ angularOutputTarget({
28
+ componentCorePackage: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core',
29
+ directivesProxyFile: '../components-{{PROJECT_NAME_KEBAB}}-angular/src/directives/generated/components.ts',
30
+ directivesArrayFile: '../components-{{PROJECT_NAME_KEBAB}}-angular/src/directives/generated/index.ts',
31
+ outputType: 'component'
32
+ }),
33
+ angularOutputTarget({
34
+ componentCorePackage: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core',
35
+ customElementsDir: 'components', // match what is being exported in the package.json vs setting it to 'dist/components'
36
+ directivesProxyFile: '../components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/directives/generated/components.ts',
37
+ directivesArrayFile: '../components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/directives/generated/index.ts',
38
+ outputType: 'standalone'
39
+ }),
40
+ reactOutputTarget({
41
+ clientModule: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-react',
42
+ customElementsDir: 'components', // match what is being exported in the package.json vs setting it to 'dist/components'
43
+ esModules: true,
44
+ hydrateModule: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core/hydrate',
45
+ outDir: '../components-{{PROJECT_NAME_KEBAB}}-react/src/components/generated',
46
+ stencilPackageName: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core'
47
+ }),
48
+ vueOutputTarget({
49
+ componentCorePackage: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core',
50
+ hydrateModule: '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core/hydrate',
51
+ includeDefineCustomElements: false,
52
+ includeImportCustomElements: true,
53
+ includePolyfills: false,
54
+ proxiesFile: '../components-{{PROJECT_NAME_KEBAB}}-vue/src/components/generated/components.ts',
55
+ }),
56
+ {
57
+ type: 'dist'
58
+ },
59
+ {
60
+ type: 'dist-custom-elements',
61
+ dir: 'dist/components',
62
+ customElementsExportBehavior: 'single-export-module',
63
+ externalRuntime: false,
64
+ generateTypeDeclarations: false
65
+ },
66
+ {
67
+ type: 'dist-hydrate-script',
68
+ dir: 'dist/hydrate'
69
+ },
70
+ {
71
+ type: 'docs-readme',
72
+ },
73
+ {
74
+ type: 'docs-vscode',
75
+ file: 'dist/docs/components-{{PROJECT_NAME_KEBAB}}-core-vscode.json'
76
+ },
77
+ {
78
+ type: 'www',
79
+ dir: 'dist/www',
80
+ serviceWorker: null
81
+ },
82
+ ],
83
+ plugins: [
84
+ inlineSvg(),
85
+ sass()
86
+ ],
87
+ testing: {
88
+ browserHeadless: "shell",
89
+ },
90
+ };