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.
- package/LICENSE +21 -0
- package/LICENSE.md +21 -0
- package/README.md +55 -0
- package/dist/index.mjs +396 -0
- package/dist/index.mjs.map +1 -0
- package/dist/templates/base/.editorconfig +15 -0
- package/dist/templates/base/.eslintignore +4 -0
- package/dist/templates/base/.gemini/settings.json +13 -0
- package/dist/templates/base/.husky/commit-msg +1 -0
- package/dist/templates/base/.husky/install.mjs +6 -0
- package/dist/templates/base/.husky/pre-commit +2 -0
- package/dist/templates/base/.mcp.json +12 -0
- package/dist/templates/base/.nvmrc +1 -0
- package/dist/templates/base/.prettierignore +2 -0
- package/dist/templates/base/.stylelintignore +0 -0
- package/dist/templates/base/AGENTS.md +118 -0
- package/dist/templates/base/CLAUDE.md +16 -0
- package/dist/templates/base/README.md +83 -0
- package/dist/templates/base/commitlint.config.mjs +1 -0
- package/dist/templates/base/docs/CODE_OF_CONDUCT.md +122 -0
- package/dist/templates/base/docs/CONTRIBUTING.md +103 -0
- package/dist/templates/base/docs/LICENSE.md +21 -0
- package/dist/templates/base/docs/RELEASE.md +95 -0
- package/dist/templates/base/docs/STYLE_GUIDE.md +128 -0
- package/dist/templates/base/eslint.config.mjs +37 -0
- package/dist/templates/base/gitignore +32 -0
- package/dist/templates/base/nx.json +36 -0
- package/dist/templates/base/package.json +43 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/CHANGELOG.md +0 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/README.md +74 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/project.json +144 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/my-component.scss +3 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/my-component.tsx +32 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/readme.md +19 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/test/my-component.e2e.ts +32 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components/my-component/test/my-component.spec.ts +36 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/components.d.ts +61 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/index.html +14 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/index.ts +12 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/main.scss +0 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/utils/utils.spec.ts +19 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/src/utils/utils.ts +3 -0
- package/dist/templates/base/packages/components-{{PROJECT_NAME_KEBAB}}-core/tsconfig.json +12 -0
- package/dist/templates/base/prettier.config.mjs +19 -0
- package/dist/templates/base/stylelint.config.mjs +25 -0
- package/dist/templates/base/tsconfig.base.json +23 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/CHANGELOG.md +0 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/README.md +108 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/ng-package.json +6 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/package.json +27 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/project.json +93 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/components-{{PROJECT_NAME_KEBAB}}.module.ts +20 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/directives/.gitkeep +0 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/index.ts +3 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/ng-package.json +6 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/directives/.gitkeep +0 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/index.ts +1 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-angular/tsconfig.json +41 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +85 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +90 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/CHANGELOG.md +0 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/README.md +97 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/package.json +48 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/project.json +92 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/components/index.ts +1 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/index.ts +1 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/tsconfig.json +36 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/CHANGELOG.md +0 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/README.md +78 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/package.json +43 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/project.json +92 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/components/index.ts +1 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/index.ts +1 -0
- package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/tsconfig.json +39 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/CHANGELOG.md +0 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/README.md +108 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/ng-package.json +6 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/package.json +27 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/project.json +93 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/components-{{PROJECT_NAME_KEBAB}}.module.ts +20 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/directives/.gitkeep +0 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/src/index.ts +3 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/ng-package.json +6 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/directives/.gitkeep +0 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/standalone/src/index.ts +1 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/tsconfig.json +41 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +83 -0
- package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +72 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +83 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +67 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/CHANGELOG.md +0 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/README.md +97 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/package.json +48 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/project.json +92 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/components/index.ts +1 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/index.ts +1 -0
- package/dist/templates/variants/react/packages/components-{{PROJECT_NAME_KEBAB}}-react/tsconfig.json +36 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +83 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +67 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/CHANGELOG.md +0 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/README.md +78 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/package.json +43 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/project.json +92 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/components/index.ts +1 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/index.ts +1 -0
- package/dist/templates/variants/vue/packages/components-{{PROJECT_NAME_KEBAB}}-vue/tsconfig.json +39 -0
- package/dist/templates/variants/web-components/packages/components-{{PROJECT_NAME_KEBAB}}-core/package.json +82 -0
- package/dist/templates/variants/web-components/packages/components-{{PROJECT_NAME_KEBAB}}-core/stencil.config.ts +58 -0
- package/package.json +60 -0
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-react
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
React 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}}-react:[task]
|
|
29
|
+
npx nx run components-{{PROJECT_NAME_KEBAB}}-react:build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**From within the package directory:**
|
|
33
|
+
|
|
34
|
+
Navigate to packages/components-{{PROJECT_NAME_KEBAB}}-react 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/ # Source code
|
|
47
|
+
│ ├── components/ # Directory for component exports and implementation entry
|
|
48
|
+
│ │ └── generated/ # Directory for generated component outputs
|
|
49
|
+
│ │ └── index.ts # Barrel export for components
|
|
50
|
+
│ └── index.ts # Barrel export for components
|
|
51
|
+
├── package.json # Root configuration: workspaces, dependencies, and scripts
|
|
52
|
+
├── project.json # Project Nx build system configuration
|
|
53
|
+
├── tsconfig.json # TypeScript configuration
|
|
54
|
+
├── CHANGELOG.md # Changelog documentation
|
|
55
|
+
└── README.md # Package documentation
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Consumer Consumption
|
|
59
|
+
|
|
60
|
+
### Prerequisite: Install Dependencies
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npm install @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-react
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Using Framework Wrappers
|
|
67
|
+
|
|
68
|
+
**Local Registration**: Best for performance (tree-shaking). In your .tsx file:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import { MyComponent } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-react';
|
|
72
|
+
|
|
73
|
+
function App() {
|
|
74
|
+
return <MyComponent first="Stencil" last="React" />;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Using Custom Elements Directly
|
|
79
|
+
|
|
80
|
+
**Registration**: In main.tsx, import the loader to register all components with the browser's CustomElementRegistry.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { defineCustomElements } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core/loader';
|
|
84
|
+
defineCustomElements(); // Registers all tags (e.g., <my-component>)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Usage**: Once registered, you simply use the tag in your template without further imports.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<my-component first="Stencil" last="React"></my-component>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Which should you choose?
|
|
94
|
+
|
|
95
|
+
**React Wrappers**: Best for large-scale apps, TypeScript users, and those using React versions prior to 19.
|
|
96
|
+
|
|
97
|
+
**Direct Usage**: Best for simple integrations, lightweight projects, or if you are already using React 19+ which has improved custom element support.
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-react",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "React specific wrappers for @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"stencil",
|
|
8
|
+
"stenciljs"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/types/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/types/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"clean": "rimraf --glob dist src/components/generated",
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"format": "prettier src/**/*.{ts,tsx} --check --config ../../prettier.config.mjs --ignore-path ../../.prettierignore",
|
|
27
|
+
"format:fix": "prettier src/**/*.{ts,tsx} --write --check --config ../../prettier.config.mjs --ignore-path ../../.prettierignore",
|
|
28
|
+
"lint:eslint": "eslint src --config ../../eslint.config.mjs",
|
|
29
|
+
"lint:stylelint": "stylelint src/**/*.{css,scss} --config ../../stylelint.config.mjs --ignore-path ../../.stylelintignore",
|
|
30
|
+
"lint:fix:eslint": "eslint src --config ../../eslint.config.mjs --fix",
|
|
31
|
+
"lint:fix:stylelint": "stylelint src/**/*.{css,scss} --config ../../stylelint.config.mjs --ignore-path ../../.stylelintignore --fix",
|
|
32
|
+
"test": "echo 'No tests specified' && exit 0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"tslib": "2.8.1"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@stencil/react-output-target": "1.2.0",
|
|
39
|
+
"@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core": "*",
|
|
40
|
+
"react": ">=18"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "25.0.3",
|
|
44
|
+
"@types/react": ">=18"
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"sideEffects": false
|
|
48
|
+
}
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/project.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "components-{{PROJECT_NAME_KEBAB}}-react",
|
|
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": ["typescript"]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"options": {
|
|
38
|
+
"script": "build",
|
|
39
|
+
"cwd": "{projectRoot}"
|
|
40
|
+
},
|
|
41
|
+
"outputs": [
|
|
42
|
+
"{projectRoot}/dist",
|
|
43
|
+
"{projectRoot}/src/components/generated"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"format": {
|
|
47
|
+
"cache": false,
|
|
48
|
+
"executor": "nx:run-script",
|
|
49
|
+
"options": {
|
|
50
|
+
"script": "format",
|
|
51
|
+
"cwd": "{projectRoot}"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"format:fix": {
|
|
55
|
+
"cache": false,
|
|
56
|
+
"executor": "nx:run-script",
|
|
57
|
+
"options": {
|
|
58
|
+
"script": "format:fix",
|
|
59
|
+
"cwd": "{projectRoot}"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"lint": {
|
|
63
|
+
"cache": false,
|
|
64
|
+
"executor": "nx:run-commands",
|
|
65
|
+
"options": {
|
|
66
|
+
"commands": ["npm run lint:eslint", "npm run lint:stylelint"],
|
|
67
|
+
"cwd": "{projectRoot}",
|
|
68
|
+
"parallel": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"lint:fix": {
|
|
72
|
+
"cache": false,
|
|
73
|
+
"executor": "nx:run-commands",
|
|
74
|
+
"options": {
|
|
75
|
+
"commands": ["npm run lint:eslint:fix", "npm run lint:stylelint:fix"],
|
|
76
|
+
"cwd": "{projectRoot}",
|
|
77
|
+
"parallel": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"test": {
|
|
81
|
+
"cache": false,
|
|
82
|
+
"executor": "nx:run-script",
|
|
83
|
+
"inputs": [
|
|
84
|
+
"default"
|
|
85
|
+
],
|
|
86
|
+
"options": {
|
|
87
|
+
"script": "test",
|
|
88
|
+
"cwd": "{projectRoot}"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generated/components.js';
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/index.js';
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-react/tsconfig.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"buildOnSave": false,
|
|
3
|
+
"compileOnSave": false,
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"allowUnreachableCode": false,
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationDir": "./dist/types",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"emitDecoratorMetadata": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"jsx": "react",
|
|
13
|
+
"lib": [
|
|
14
|
+
"dom",
|
|
15
|
+
"es2022"
|
|
16
|
+
],
|
|
17
|
+
"module": "esnext",
|
|
18
|
+
"moduleResolution": "bundler",
|
|
19
|
+
"noImplicitAny": true,
|
|
20
|
+
"noImplicitReturns": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"outDir": "dist",
|
|
24
|
+
"removeComments": false,
|
|
25
|
+
"rootDir": "src",
|
|
26
|
+
"sourceMap": false,
|
|
27
|
+
"target": "es2022"
|
|
28
|
+
},
|
|
29
|
+
"include": [
|
|
30
|
+
"src"
|
|
31
|
+
],
|
|
32
|
+
"exclude": [
|
|
33
|
+
"dist",
|
|
34
|
+
"node_modules"
|
|
35
|
+
]
|
|
36
|
+
}
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/CHANGELOG.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-vue
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Vue specific wrappers for the @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-vue 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}}-vue:[task]
|
|
29
|
+
npx nx run components-{{PROJECT_NAME_KEBAB}}-vue:build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**From within the package directory:**
|
|
33
|
+
|
|
34
|
+
Navigate to packages/components-{{PROJECT_NAME_KEBAB}}-vue 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/ # Source code
|
|
47
|
+
│ ├── components/ # Directory for component exports and implementation entry
|
|
48
|
+
│ │ └── generated/ # Directory for generated component outputs
|
|
49
|
+
│ │ └── index.ts # Barrel export for components
|
|
50
|
+
│ └── index.ts # Barrel export for components
|
|
51
|
+
├── package.json # Root configuration: workspaces, dependencies, and scripts
|
|
52
|
+
├── project.json # Project Nx build system configuration
|
|
53
|
+
├── tsconfig.json # TypeScript configuration
|
|
54
|
+
├── CHANGELOG.md # Changelog documentation
|
|
55
|
+
└── README.md # Package documentation
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Consumer Consumption
|
|
59
|
+
|
|
60
|
+
### Prerequisite: Install Dependencies
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npm install @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-vue
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Using Framework Wrappers
|
|
67
|
+
|
|
68
|
+
**Local Registration**: Best for performance (tree-shaking). In your .vue file:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
<script>
|
|
72
|
+
import { MyComponent } from '@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-vue';
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<MyComponent first="Stencil" last="Vue" />
|
|
77
|
+
</template>
|
|
78
|
+
```
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-vue",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Vue specific wrappers for @{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"stencil",
|
|
7
|
+
"stenciljs",
|
|
8
|
+
"vue"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/types/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/types/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"clean": "rimraf --glob dist src/components/generated",
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"format": "prettier src/**/*.{ts,tsx} --check --config ../../prettier.config.mjs --ignore-path ../../.prettierignore",
|
|
27
|
+
"format:fix": "prettier src/**/*.{ts,tsx} --write --check --config ../../prettier.config.mjs --ignore-path ../../.prettierignore",
|
|
28
|
+
"lint:eslint": "eslint src --config ../../eslint.config.mjs",
|
|
29
|
+
"lint:stylelint": "stylelint src/**/*.{css,scss} --config ../../stylelint.config.mjs --ignore-path ../../.stylelintignore",
|
|
30
|
+
"lint:fix:eslint": "eslint src --config ../../eslint.config.mjs --fix",
|
|
31
|
+
"lint:fix:stylelint": "stylelint src/**/*.{css,scss} --config ../../stylelint.config.mjs --ignore-path ../../.stylelintignore --fix",
|
|
32
|
+
"test": "echo 'No tests specified' && exit 0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"tslib": "2.8.1"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@stencil/vue-output-target": "0.11.8",
|
|
39
|
+
"@{{ORGANIZATION_NAME}}/components-{{PROJECT_NAME_KEBAB}}-core": "*"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"sideEffects": false
|
|
43
|
+
}
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/project.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "components-{{PROJECT_NAME_KEBAB}}-vue",
|
|
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": ["typescript"]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"options": {
|
|
38
|
+
"script": "build",
|
|
39
|
+
"cwd": "{projectRoot}"
|
|
40
|
+
},
|
|
41
|
+
"outputs": [
|
|
42
|
+
"{projectRoot}/dist",
|
|
43
|
+
"{projectRoot}/src/components/generated"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"format": {
|
|
47
|
+
"cache": false,
|
|
48
|
+
"executor": "nx:run-script",
|
|
49
|
+
"options": {
|
|
50
|
+
"script": "format",
|
|
51
|
+
"cwd": "{projectRoot}"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"format:fix": {
|
|
55
|
+
"cache": false,
|
|
56
|
+
"executor": "nx:run-script",
|
|
57
|
+
"options": {
|
|
58
|
+
"script": "format:fix",
|
|
59
|
+
"cwd": "{projectRoot}"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"lint": {
|
|
63
|
+
"cache": false,
|
|
64
|
+
"executor": "nx:run-commands",
|
|
65
|
+
"options": {
|
|
66
|
+
"commands": ["npm run lint:eslint", "npm run lint:stylelint"],
|
|
67
|
+
"cwd": "{projectRoot}",
|
|
68
|
+
"parallel": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"lint:fix": {
|
|
72
|
+
"cache": false,
|
|
73
|
+
"executor": "nx:run-commands",
|
|
74
|
+
"options": {
|
|
75
|
+
"commands": ["npm run lint:eslint:fix", "npm run lint:stylelint:fix"],
|
|
76
|
+
"cwd": "{projectRoot}",
|
|
77
|
+
"parallel": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"test": {
|
|
81
|
+
"cache": false,
|
|
82
|
+
"executor": "nx:run-script",
|
|
83
|
+
"inputs": [
|
|
84
|
+
"default"
|
|
85
|
+
],
|
|
86
|
+
"options": {
|
|
87
|
+
"script": "test",
|
|
88
|
+
"cwd": "{projectRoot}"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generated/components.js';
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/index.js';
|
package/dist/templates/variants/all/packages/components-{{PROJECT_NAME_KEBAB}}-vue/tsconfig.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"buildOnSave": false,
|
|
3
|
+
"compileOnSave": false,
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"allowUnreachableCode": false,
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationDir": "./dist/types",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"emitDecoratorMetadata": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"jsx": "preserve",
|
|
13
|
+
"jsxImportSource": "vue",
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"lib": [
|
|
16
|
+
"dom",
|
|
17
|
+
"es2022"
|
|
18
|
+
],
|
|
19
|
+
"module": "esnext",
|
|
20
|
+
"moduleResolution": "bundler",
|
|
21
|
+
"noImplicitAny": true,
|
|
22
|
+
"noImplicitReturns": true,
|
|
23
|
+
"noUnusedLocals": true,
|
|
24
|
+
"noUnusedParameters": true,
|
|
25
|
+
"outDir": "dist",
|
|
26
|
+
"removeComments": false,
|
|
27
|
+
"rootDir": "src",
|
|
28
|
+
"skipLibCheck": true,
|
|
29
|
+
"sourceMap": false,
|
|
30
|
+
"target": "es2022"
|
|
31
|
+
},
|
|
32
|
+
"include": [
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
35
|
+
"exclude": [
|
|
36
|
+
"dist",
|
|
37
|
+
"node_modules"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
File without changes
|
package/dist/templates/variants/angular/packages/components-{{PROJECT_NAME_KEBAB}}-angular/README.md
ADDED
|
@@ -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
|
+
```
|