@nextwebwg/html-next-converter 1.0.0-alpha.3
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 +25 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +29 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +179 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Next Web Working Group
|
|
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,25 @@
|
|
|
1
|
+
# `@nextwebwg/html-next-converter`
|
|
2
|
+
|
|
3
|
+
Converts a Declarative Components application or library graph into Vue 3.5 single-file components.
|
|
4
|
+
Once converted, HTML Next is gone: each `.vue` file imports only Vue, the components it nests, and
|
|
5
|
+
its own controller, which is copied beside it. Props, state, computed values, bindings, structural
|
|
6
|
+
directives, slots, events, and methods map to Vue's own facilities, and styles become
|
|
7
|
+
`<style scoped>`.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
html-next-convert vue components/button.html components/card.html --mode library --out-dir generated
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Application conversion emits an `application.ts` entry for the selected graph roots. Library
|
|
14
|
+
conversion emits an `index.ts` entry whose named exports are independently consumable. Both modes
|
|
15
|
+
emit `html-next.conversion.json`, which records the input entries, output entry, every artifact, and
|
|
16
|
+
the target version.
|
|
17
|
+
|
|
18
|
+
Publish the `.vue` files together with the `.js` and `.d.ts` your Vue build produces from them
|
|
19
|
+
(for example `vite build` with `@vitejs/plugin-vue`, and `vue-tsc --declaration --emitDeclarationOnly`).
|
|
20
|
+
|
|
21
|
+
A construct Vue conversion does not map yet, or an invalid definition, produces the source-located
|
|
22
|
+
`HTC001` diagnostic with the underlying code. Colliding generated paths produce `HTC002` before any
|
|
23
|
+
output is written, and an unsupported target version produces `HTC003` before the graph is loaded.
|
|
24
|
+
|
|
25
|
+
React is in development. Svelte is not supported.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { convertComponents } from "./index.js";
|
|
4
|
+
function usage() {
|
|
5
|
+
return "Usage: html-next-convert vue <component.html...> --mode <application|library> --out-dir <directory>";
|
|
6
|
+
}
|
|
7
|
+
async function main(argv) {
|
|
8
|
+
const target = argv[0];
|
|
9
|
+
const modeIndex = argv.indexOf("--mode");
|
|
10
|
+
const mode = argv[modeIndex + 1];
|
|
11
|
+
const outIndex = argv.indexOf("--out-dir");
|
|
12
|
+
const outDirectory = argv[outIndex + 1];
|
|
13
|
+
if (target === undefined || !["vue"].includes(target) ||
|
|
14
|
+
mode === undefined || !["application", "library"].includes(mode) ||
|
|
15
|
+
modeIndex < 2 || outIndex !== modeIndex + 2 || outDirectory === undefined ||
|
|
16
|
+
outIndex !== argv.length - 2)
|
|
17
|
+
throw new Error(usage());
|
|
18
|
+
await convertComponents({ mode, entries: argv.slice(1, modeIndex), target, outDirectory });
|
|
19
|
+
}
|
|
20
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
21
|
+
try {
|
|
22
|
+
await main(process.argv.slice(2));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAA8C,MAAM,YAAY,CAAC;AAE3F,SAAS,KAAK;IACZ,OAAO,qGAAqG,CAAC;AAC/G,CAAC;AAED,KAAK,UAAU,IAAI,CAAC,IAAuB;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAgC,CAAC;IACtD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC,C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
+
export type ConversionGraph = "application" | "library";
|
|
3
|
+
interface BaseConvertOptions {
|
|
4
|
+
readonly entries: readonly string[];
|
|
5
|
+
readonly target: FrameworkTarget;
|
|
6
|
+
readonly targetVersion?: string;
|
|
7
|
+
readonly outDirectory: string;
|
|
8
|
+
readonly root?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApplicationConvertOptions extends BaseConvertOptions {
|
|
11
|
+
readonly mode: "application";
|
|
12
|
+
}
|
|
13
|
+
export interface LibraryConvertOptions extends BaseConvertOptions {
|
|
14
|
+
readonly mode: "library";
|
|
15
|
+
}
|
|
16
|
+
export type ConvertOptions = ApplicationConvertOptions | LibraryConvertOptions;
|
|
17
|
+
export interface ConversionEntry {
|
|
18
|
+
readonly source: string;
|
|
19
|
+
readonly tag: string;
|
|
20
|
+
readonly artifact: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ConversionOutput {
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly kind: "component" | "controller" | "entry" | "inventory";
|
|
25
|
+
readonly source?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ConversionManifest {
|
|
28
|
+
readonly mode: "framework-conversion";
|
|
29
|
+
readonly target: FrameworkTarget;
|
|
30
|
+
readonly targetVersion: string;
|
|
31
|
+
readonly graph: ConversionGraph;
|
|
32
|
+
readonly entries: readonly ConversionEntry[];
|
|
33
|
+
readonly output: {
|
|
34
|
+
readonly entry: string;
|
|
35
|
+
readonly inventory: "html-next.conversion.json";
|
|
36
|
+
readonly artifacts: readonly ConversionOutput[];
|
|
37
|
+
};
|
|
38
|
+
readonly components: readonly {
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly tag: string;
|
|
41
|
+
readonly source: string;
|
|
42
|
+
readonly artifact: string;
|
|
43
|
+
/** The copied controller module the component imports, if it has one. */
|
|
44
|
+
readonly controller?: string;
|
|
45
|
+
}[];
|
|
46
|
+
}
|
|
47
|
+
export declare class FrameworkOutputCollisionError extends Error {
|
|
48
|
+
readonly target: FrameworkTarget;
|
|
49
|
+
readonly artifact: string;
|
|
50
|
+
readonly sources: readonly [string, string];
|
|
51
|
+
readonly code = "HTC002";
|
|
52
|
+
constructor(target: FrameworkTarget, artifact: string, sources: readonly [string, string]);
|
|
53
|
+
}
|
|
54
|
+
export declare class FrameworkDuplicateEntryError extends Error {
|
|
55
|
+
readonly source: string;
|
|
56
|
+
readonly code = "HTC002";
|
|
57
|
+
constructor(source: string);
|
|
58
|
+
}
|
|
59
|
+
export declare class FrameworkTargetVersionError extends Error {
|
|
60
|
+
readonly target: FrameworkTarget;
|
|
61
|
+
readonly requested: string;
|
|
62
|
+
readonly supported: string;
|
|
63
|
+
readonly code = "HTC003";
|
|
64
|
+
constructor(target: FrameworkTarget, requested: string, supported: string);
|
|
65
|
+
}
|
|
66
|
+
export declare class FrameworkConversionError extends Error {
|
|
67
|
+
readonly target: FrameworkTarget;
|
|
68
|
+
readonly source: string;
|
|
69
|
+
readonly tag: string;
|
|
70
|
+
readonly reason?: string | undefined;
|
|
71
|
+
readonly code = "HTC001";
|
|
72
|
+
constructor(target: FrameworkTarget, source: string, tag: string, reason?: string | undefined);
|
|
73
|
+
}
|
|
74
|
+
export declare function convertComponents(options: ConvertOptions): Promise<ConversionManifest>;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC;AACpC,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,CAAC;AAMxD,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC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,EACX,MAAM,CAAC,EAAE,MAAM,YAAA,EAMzB;CACF;AA6BD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyG5F"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
import { addControllerGraph, generateVueComponent, HtmlDiagnosticError, loadNodeComponents, } from "@nextwebwg/html-next";
|
|
5
|
+
const targetVersions = {
|
|
6
|
+
vue: "3.5",
|
|
7
|
+
};
|
|
8
|
+
export class FrameworkOutputCollisionError extends Error {
|
|
9
|
+
target;
|
|
10
|
+
artifact;
|
|
11
|
+
sources;
|
|
12
|
+
code = "HTC002";
|
|
13
|
+
constructor(target, artifact, sources) {
|
|
14
|
+
super(`${sources[1]}: HTC002: ${target} output \`${artifact}\` collides with output from ${sources[0]}. Rename one component so each generated artifact has a distinct path.`);
|
|
15
|
+
this.target = target;
|
|
16
|
+
this.artifact = artifact;
|
|
17
|
+
this.sources = sources;
|
|
18
|
+
this.name = "FrameworkOutputCollisionError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class FrameworkDuplicateEntryError extends Error {
|
|
22
|
+
source;
|
|
23
|
+
code = "HTC002";
|
|
24
|
+
constructor(source) {
|
|
25
|
+
super(`${source}: HTC002: component entry is listed more than once.`);
|
|
26
|
+
this.source = source;
|
|
27
|
+
this.name = "FrameworkDuplicateEntryError";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class FrameworkTargetVersionError extends Error {
|
|
31
|
+
target;
|
|
32
|
+
requested;
|
|
33
|
+
supported;
|
|
34
|
+
code = "HTC003";
|
|
35
|
+
constructor(target, requested, supported) {
|
|
36
|
+
super(`HTC003: ${target} ${requested} is not supported; this converter targets ${target} ${supported}.`);
|
|
37
|
+
this.target = target;
|
|
38
|
+
this.requested = requested;
|
|
39
|
+
this.supported = supported;
|
|
40
|
+
this.name = "FrameworkTargetVersionError";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export class FrameworkConversionError extends Error {
|
|
44
|
+
target;
|
|
45
|
+
source;
|
|
46
|
+
tag;
|
|
47
|
+
reason;
|
|
48
|
+
code = "HTC001";
|
|
49
|
+
constructor(target, source, tag, reason) {
|
|
50
|
+
super(`${source}: HTC001: ${target} conversion of <${tag}> failed${reason === undefined ? "" : `: ${reason}`}`);
|
|
51
|
+
this.target = target;
|
|
52
|
+
this.source = source;
|
|
53
|
+
this.tag = tag;
|
|
54
|
+
this.reason = reason;
|
|
55
|
+
this.name = "FrameworkConversionError";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function emit(root, artifact) {
|
|
59
|
+
const output = resolve(root, artifact.path);
|
|
60
|
+
if (output !== root && !output.startsWith(`${root}${sep}`)) {
|
|
61
|
+
throw new Error(`Generated artifact escaped the output directory: ${artifact.path}.`);
|
|
62
|
+
}
|
|
63
|
+
await mkdir(dirname(output), { recursive: true });
|
|
64
|
+
await writeFile(output, artifact.content, "utf8");
|
|
65
|
+
}
|
|
66
|
+
function frameworkEntry(mode, target, entries) {
|
|
67
|
+
const exports = [...entries].sort((left, right) => left.artifact.localeCompare(right.artifact)).map((entry) => {
|
|
68
|
+
const artifact = entry.artifact.slice(entry.artifact.lastIndexOf("/") + 1);
|
|
69
|
+
const name = artifact.replace(/\.vue$/, "");
|
|
70
|
+
return `export { default as ${name} } from ${JSON.stringify(`./${artifact}`)};`;
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
path: `${target}/${mode === "application" ? "application.ts" : "index.ts"}`,
|
|
74
|
+
content: `${exports.join("\n")}\n`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export async function convertComponents(options) {
|
|
78
|
+
if (options.entries.length === 0)
|
|
79
|
+
throw new Error("Framework conversion requires at least one component entry.");
|
|
80
|
+
const targetVersion = targetVersions[options.target];
|
|
81
|
+
if (options.targetVersion !== undefined && options.targetVersion !== targetVersion) {
|
|
82
|
+
throw new FrameworkTargetVersionError(options.target, options.targetVersion, targetVersion);
|
|
83
|
+
}
|
|
84
|
+
const projectRoot = resolve(options.root ?? process.cwd());
|
|
85
|
+
const outputRoot = resolve(options.outDirectory);
|
|
86
|
+
const entries = options.entries.map((entry) => pathToFileURL(resolve(projectRoot, entry)).href);
|
|
87
|
+
const seenEntries = new Set();
|
|
88
|
+
for (const entry of entries) {
|
|
89
|
+
if (seenEntries.has(entry)) {
|
|
90
|
+
throw new FrameworkDuplicateEntryError(relative(projectRoot, fileURLToPath(entry)).split(sep).join("/"));
|
|
91
|
+
}
|
|
92
|
+
seenEntries.add(entry);
|
|
93
|
+
}
|
|
94
|
+
const graph = await loadNodeComponents(entries, { baseURL: pathToFileURL(`${projectRoot}${sep}`).href });
|
|
95
|
+
const manifestComponents = [];
|
|
96
|
+
const planned = [];
|
|
97
|
+
const claimed = new Map();
|
|
98
|
+
const claim = (artifact, kind, source) => {
|
|
99
|
+
const previous = claimed.get(artifact.path);
|
|
100
|
+
if (previous !== undefined && previous !== source) {
|
|
101
|
+
throw new FrameworkOutputCollisionError(options.target, artifact.path, [previous, source ?? "<generated>"]);
|
|
102
|
+
}
|
|
103
|
+
claimed.set(artifact.path, source ?? "<generated>");
|
|
104
|
+
planned.push({ artifact, kind, ...(source === undefined ? {} : { source }) });
|
|
105
|
+
};
|
|
106
|
+
for (const node of [...graph.nodes.values()].sort((left, right) => left.url.localeCompare(right.url))) {
|
|
107
|
+
const source = relative(projectRoot, fileURLToPath(node.url)).split(sep).join("/");
|
|
108
|
+
const tag = node.definition.contract.tag;
|
|
109
|
+
// The controller and its relative imports are copied beside the component, which imports them.
|
|
110
|
+
const controllerFiles = new Map();
|
|
111
|
+
const controller = node.controller === undefined
|
|
112
|
+
? undefined
|
|
113
|
+
: await addControllerGraph(node.controller.url, node.trustRoot, `${options.target}/controllers/${tag}`, controllerFiles);
|
|
114
|
+
const definition = controller === undefined
|
|
115
|
+
? node.definition
|
|
116
|
+
: Object.freeze({ ...node.definition, controller: `./${controller.slice(`${options.target}/`.length)}` });
|
|
117
|
+
let content;
|
|
118
|
+
try {
|
|
119
|
+
content = generateVueComponent(definition);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (error instanceof HtmlDiagnosticError)
|
|
123
|
+
throw new FrameworkConversionError(options.target, source, tag, error.message);
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
if (/@nextwebwg\//.test(content))
|
|
127
|
+
throw new FrameworkConversionError(options.target, source, tag);
|
|
128
|
+
const component = { path: `${options.target}/${node.definition.contract.name}.vue`, content };
|
|
129
|
+
claim(component, "component", source);
|
|
130
|
+
for (const file of controllerFiles.values())
|
|
131
|
+
claim(file, "controller", source);
|
|
132
|
+
manifestComponents.push(Object.freeze({
|
|
133
|
+
name: node.definition.contract.name,
|
|
134
|
+
tag,
|
|
135
|
+
source,
|
|
136
|
+
artifact: component.path,
|
|
137
|
+
...(controller === undefined ? {} : { controller }),
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
const conversionEntries = entries.map((url) => {
|
|
141
|
+
const node = graph.nodes.get(url);
|
|
142
|
+
if (node === undefined)
|
|
143
|
+
throw new Error(`Framework conversion did not resolve entry ${url}.`);
|
|
144
|
+
const component = manifestComponents.find(({ source }) => source === relative(projectRoot, fileURLToPath(node.url)).split(sep).join("/"));
|
|
145
|
+
return {
|
|
146
|
+
source: component.source,
|
|
147
|
+
tag: component.tag,
|
|
148
|
+
artifact: component.artifact,
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
const entry = frameworkEntry(options.mode, options.target, conversionEntries);
|
|
152
|
+
claim(entry, "entry");
|
|
153
|
+
const inventory = "html-next.conversion.json";
|
|
154
|
+
const outputArtifacts = planned.map(({ artifact, kind, source }) => ({
|
|
155
|
+
path: artifact.path,
|
|
156
|
+
kind,
|
|
157
|
+
...(source === undefined ? {} : { source }),
|
|
158
|
+
}));
|
|
159
|
+
outputArtifacts.push({ path: inventory, kind: "inventory" });
|
|
160
|
+
const manifest = Object.freeze({
|
|
161
|
+
mode: "framework-conversion",
|
|
162
|
+
target: options.target,
|
|
163
|
+
targetVersion,
|
|
164
|
+
graph: options.mode,
|
|
165
|
+
entries: Object.freeze(conversionEntries),
|
|
166
|
+
output: Object.freeze({
|
|
167
|
+
entry: entry.path,
|
|
168
|
+
inventory,
|
|
169
|
+
artifacts: Object.freeze(outputArtifacts),
|
|
170
|
+
}),
|
|
171
|
+
components: Object.freeze(manifestComponents),
|
|
172
|
+
});
|
|
173
|
+
for (const { artifact } of planned)
|
|
174
|
+
await emit(outputRoot, artifact);
|
|
175
|
+
await mkdir(outputRoot, { recursive: true });
|
|
176
|
+
await writeFile(resolve(outputRoot, inventory), `${JSON.stringify(manifest, null, 2)}\n`, "utf8");
|
|
177
|
+
return manifest;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAK9B,MAAM,cAAc,GAA8C;IAChE,GAAG,EAAE,KAAK;CACX,CAAC;AAqDF,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IAI3C,MAAM;IACN,QAAQ;IACR,OAAO;IALT,IAAI,GAAG,QAAQ,CA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rE,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,SAAS,CACb,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,EAC9B,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EACxC,MAAM,CACP,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nextwebwg/html-next-converter",
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
|
+
"description": "Vue conversion for Declarative HTML Components.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"bin": {
|
|
9
|
+
"html-next-convert": "./dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.13 <23 || >=24 <25"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@nextwebwg/html-next": "1.0.0-alpha.4"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "25.9.5",
|
|
28
|
+
"@vue/compiler-sfc": "3.5.42",
|
|
29
|
+
"esbuild": "0.28.2",
|
|
30
|
+
"typescript": "7.0.2",
|
|
31
|
+
"vitest": "5.0.0"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"tag": "next",
|
|
36
|
+
"registry": "https://registry.npmjs.org/"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/nextwebwg/html-next.git",
|
|
41
|
+
"directory": "packages/html-next-converter"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "pnpm clean && tsc -p tsconfig.build.json",
|
|
45
|
+
"clean": "node --input-type=module --eval \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true });\"",
|
|
46
|
+
"test": "vitest run --config vitest.config.ts",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
48
|
+
}
|
|
49
|
+
}
|