@qwik-custom-elements/core 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/README.md +82 -0
- package/dist/__tests__/config.test.d.ts +1 -0
- package/dist/__tests__/config.test.js +596 -0
- package/dist/__tests__/generator.test.d.ts +1 -0
- package/dist/__tests__/generator.test.js +1331 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +271 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +183 -0
- package/dist/generator.d.ts +6 -0
- package/dist/generator.js +720 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.js +1 -0
- package/package.json +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dmitry A. Efimenko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# @qwik-custom-elements/core
|
|
2
|
+
|
|
3
|
+
Deterministic generation orchestration for Qwik custom-element wrappers.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install @qwik-custom-elements/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quickstart
|
|
12
|
+
|
|
13
|
+
Create a `qwik-custom-elements.config.json` at your project root:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"projects": [
|
|
18
|
+
{
|
|
19
|
+
"id": "my-lib",
|
|
20
|
+
"adapter": "stencil",
|
|
21
|
+
"adapterPackage": "@qwik-custom-elements/adapter-stencil",
|
|
22
|
+
"source": {
|
|
23
|
+
"type": "PACKAGE_NAME",
|
|
24
|
+
"packageName": "my-stencil-lib"
|
|
25
|
+
},
|
|
26
|
+
"outDir": "./src/generated/my-lib"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then run the generator:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
npx qwik-custom-elements
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Generated Qwik wrapper files are written to the configured `outDir`. Re-run after upgrading the component library to regenerate.
|
|
39
|
+
|
|
40
|
+
## Support Policy
|
|
41
|
+
|
|
42
|
+
This package follows semantic versioning. See [COMPATIBILITY.md](../../COMPATIBILITY.md) for the tested combinations of core, adapters, Qwik, and Node.js.
|
|
43
|
+
|
|
44
|
+
Breaking changes always include an explicit `BREAKING` section in the release notes and require an update to `COMPATIBILITY.md` before merging.
|
|
45
|
+
|
|
46
|
+
## Ownership Boundary
|
|
47
|
+
|
|
48
|
+
`@qwik-custom-elements/core` owns the adapter-agnostic parts of generation:
|
|
49
|
+
|
|
50
|
+
- config loading and validation
|
|
51
|
+
- source discovery and path-safety checks
|
|
52
|
+
- CEM parsing into typed component metadata
|
|
53
|
+
- runtime-resolution orchestration and SSR capability coordination
|
|
54
|
+
- write planning and execution orchestration
|
|
55
|
+
- CLI entrypoints, summaries, and deterministic diagnostics
|
|
56
|
+
|
|
57
|
+
`@qwik-custom-elements/core` does not own framework-specific generated output shape.
|
|
58
|
+
|
|
59
|
+
In particular, core must not decide generated wrapper structure, generated barrel structure, runtime helper file shape, file extensions, or fallback wrapper generation based on adapter identity. Those responsibilities belong to adapters.
|
|
60
|
+
|
|
61
|
+
## Current Exports
|
|
62
|
+
|
|
63
|
+
This package currently exports:
|
|
64
|
+
|
|
65
|
+
- CLI helpers: `parseCliArgs`, `runCli`
|
|
66
|
+
- config APIs: `loadGeneratorConfig`, `validateGeneratorConfig`, `ConfigValidationError`
|
|
67
|
+
- generation APIs: `generateFromConfig`, `GenerationError`
|
|
68
|
+
- public types for config, generation results, planned writes, and run summaries
|
|
69
|
+
|
|
70
|
+
## Adapter Contract Direction
|
|
71
|
+
|
|
72
|
+
Core is responsible for producing one authoritative parsed component-metadata model and passing that metadata into adapter generation hooks.
|
|
73
|
+
|
|
74
|
+
Adapters are responsible for returning the generated file set for their frameworks.
|
|
75
|
+
|
|
76
|
+
## Documentation Expectations
|
|
77
|
+
|
|
78
|
+
Changes that alter core or adapter ownership boundaries should be reflected in:
|
|
79
|
+
|
|
80
|
+
- `docs/SYSTEM/decisions.md`
|
|
81
|
+
- `docs/SYSTEM/findings-log.md`
|
|
82
|
+
- the package README files for any affected packages
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|