create-velar 0.10.1

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 ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # create-velar
2
+
3
+ The official non-interactive project creator for VelarScript. It is the package
4
+ behind `npm create velar@latest` and shares the same templates with
5
+ `velar create`.
6
+
7
+ ```sh
8
+ npm create velar@latest my-app
9
+ npm create velar@latest my-service -- --template node
10
+ npm create velar@latest my-desktop -- --template desktop
11
+ npm create velar@latest my-docs -- --template docs
12
+ npm create velar@latest my-library -- --template library
13
+ npm create velar@latest my-components -- --template component
14
+ ```
15
+
16
+ The first-class application templates are `web`, `node`, and `desktop`. Each
17
+ starts with the borderless VelarScript mark and a small Hello experience shaped
18
+ like the corresponding JavaScript framework category: an interactive Web page,
19
+ a Node HTTP server, or a single-project Desktop window. Specialized templates
20
+ remain available as `docs`, `library`, and `component`. The Core
21
+ library template publishes a reusable `.vel` entry without Web; the component
22
+ template publishes a checked Web component source entry and keeps its preview
23
+ application outside that public entry. `game` is reserved for the future
24
+ official Canvas framework and deliberately fails until that package exists.
25
+
26
+ Every generated project includes a root `AGENTS.md` that points coding agents
27
+ at `velar skill` — the language brief packaged with the toolchain — together
28
+ with the project's gate commands (`velar check`, `velar test`, `velar format`)
29
+ and the JavaScript escape-hatch ladder.
30
+
31
+ Creation is transactional. It refuses non-empty targets and never installs
32
+ dependencies, downloads browsers, initializes Git, or contacts a service.
33
+ The generated README keeps the first `npm install` explicit, then points to the
34
+ installed CLI's npm-backed `velar add`, `remove`, and `update` workflow.
@@ -0,0 +1,7 @@
1
+ import { type VelarProjectTemplate } from "./types.ts";
2
+ export interface CreateArguments {
3
+ readonly directory: string;
4
+ readonly template: VelarProjectTemplate;
5
+ }
6
+ export declare function parseCreateArguments(arguments_: readonly string[]): CreateArguments | string;
7
+ //# sourceMappingURL=arguments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.d.ts","sourceRoot":"","sources":["../src/arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe,GAAG,MAAM,CAiC5F"}
@@ -0,0 +1,52 @@
1
+ import { VELAR_PROJECT_TEMPLATES } from "./types.js";
2
+ export function parseCreateArguments(arguments_) {
3
+ let directory = null;
4
+ let template = "web";
5
+ let templateProvided = false;
6
+ for (let index = 0; index < arguments_.length; index += 1) {
7
+ const argument = arguments_[index];
8
+ if (argument === "--template") {
9
+ const value = arguments_[index + 1];
10
+ if (!value || value.startsWith("--"))
11
+ return "--template requires web, node, desktop, docs, library, or component";
12
+ const parsed = parseTemplate(value);
13
+ if (typeof parsed === "object")
14
+ return parsed.error;
15
+ if (templateProvided)
16
+ return "--template may be provided only once";
17
+ template = parsed;
18
+ templateProvided = true;
19
+ index += 1;
20
+ }
21
+ else if (argument.startsWith("--template=")) {
22
+ const parsed = parseTemplate(argument.slice("--template=".length));
23
+ if (typeof parsed === "object")
24
+ return parsed.error;
25
+ if (templateProvided)
26
+ return "--template may be provided only once";
27
+ template = parsed;
28
+ templateProvided = true;
29
+ }
30
+ else if (argument.startsWith("--")) {
31
+ return `unknown option '${argument}'`;
32
+ }
33
+ else if (directory !== null) {
34
+ return `unexpected extra project directory '${argument}'`;
35
+ }
36
+ else {
37
+ directory = argument;
38
+ }
39
+ }
40
+ if (!directory || directory.trim().length === 0 || directory.includes("\0")) {
41
+ return "expected one project directory";
42
+ }
43
+ return { directory, template };
44
+ }
45
+ function parseTemplate(value) {
46
+ if (value === "game")
47
+ return { error: "template 'game' is reserved for the future @velarscript/game framework" };
48
+ return VELAR_PROJECT_TEMPLATES.includes(value)
49
+ ? value
50
+ : { error: `unknown template '${value}'; expected web, node, desktop, docs, library, or component` };
51
+ }
52
+ //# sourceMappingURL=arguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.js","sourceRoot":"","sources":["../src/arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAA6B,MAAM,YAAY,CAAC;AAOhF,MAAM,UAAU,oBAAoB,CAAC,UAA6B;IAChE,IAAI,SAAS,GAAkB,IAAI,CAAC;IACpC,IAAI,QAAQ,GAAyB,KAAK,CAAC;IAC3C,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1D,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAE,CAAC;QACpC,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACpC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;gBAAE,OAAO,qEAAqE,CAAC;YACnH,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,OAAO,MAAM,KAAK,QAAQ;gBAAE,OAAO,MAAM,CAAC,KAAK,CAAC;YACpD,IAAI,gBAAgB;gBAAE,OAAO,sCAAsC,CAAC;YACpE,QAAQ,GAAG,MAAM,CAAC;YAClB,gBAAgB,GAAG,IAAI,CAAC;YACxB,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;aAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9C,MAAM,MAAM,GAAG,aAAa,CAAC,QA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cli.js ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env node
2
+ import { createVelarProject, parseCreateArguments, VELAR_CREATE_VERSION } from "./index.js";
3
+ async function main(arguments_) {
4
+ if (arguments_.length === 1 && (arguments_[0] === "--version" || arguments_[0] === "-v")) {
5
+ process.stdout.write(`create-velar ${VELAR_CREATE_VERSION}\n`);
6
+ return 0;
7
+ }
8
+ if (arguments_.some((argument) => argument === "--help" || argument === "-h")) {
9
+ if (arguments_.length !== 1) {
10
+ process.stderr.write("create-velar: help does not accept project or template arguments\n");
11
+ return 2;
12
+ }
13
+ printHelp();
14
+ return 0;
15
+ }
16
+ const parsed = parseCreateArguments(arguments_);
17
+ if (typeof parsed === "string") {
18
+ process.stderr.write(`create-velar: ${parsed}\n`);
19
+ return 2;
20
+ }
21
+ try {
22
+ const result = await createVelarProject(parsed.directory, { template: parsed.template });
23
+ process.stdout.write(`Created VelarScript ${result.template} project -> ${result.root}\n`);
24
+ return 0;
25
+ }
26
+ catch (error) {
27
+ process.stderr.write(`create-velar: ${error instanceof Error ? error.message : String(error)}\n`);
28
+ return 1;
29
+ }
30
+ }
31
+ function printHelp() {
32
+ process.stdout.write([
33
+ "Create VelarScript",
34
+ "",
35
+ "Usage: create-velar <project-directory> [--template <web|node|desktop|docs|library|component>]",
36
+ "",
37
+ "Creates files transactionally without installing dependencies or initializing Git.",
38
+ "",
39
+ ].join("\n"));
40
+ }
41
+ try {
42
+ process.exitCode = await main(process.argv.slice(2));
43
+ }
44
+ catch (error) {
45
+ process.stderr.write(`create-velar: ${error instanceof Error ? error.message : String(error)}\n`);
46
+ process.exitCode = 1;
47
+ }
48
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE5F,KAAK,UAAU,IAAI,CAAC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AC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClG,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;QACnB,oBAAoB;QACpB,EAAE;QACF,gGAAgG;QAChG,EAAE;QACF,oFAAoF;QACpF,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,IAAI,CAAC;IACH,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClG,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type CreateProjectOptions, type CreateProjectResult } from "./types.ts";
2
+ export { parseCreateArguments, type CreateArguments } from "./arguments.ts";
3
+ export { VELAR_CREATE_VERSION, VELAR_PROJECT_FORMAT_VERSION, VELAR_PROJECT_TEMPLATES, type CreateProjectOptions, type CreateProjectResult, type VelarProjectTemplate, } from "./types.ts";
4
+ export declare function createVelarProject(input: string, options?: CreateProjectOptions): Promise<CreateProjectResult>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,YAAY,CAAC;AAEpB,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAgCxH"}
package/dist/index.js ADDED
@@ -0,0 +1,56 @@
1
+ import { lstat, mkdir, mkdtemp, readdir, rename, rm, rmdir, writeFile } from "node:fs/promises";
2
+ import { dirname, join, resolve } from "node:path";
3
+ import { createTemplateFiles } from "./templates.js";
4
+ import { VELAR_CREATE_VERSION, VELAR_PROJECT_FORMAT_VERSION, VELAR_PROJECT_TEMPLATES, } from "./types.js";
5
+ export { parseCreateArguments } from "./arguments.js";
6
+ export { VELAR_CREATE_VERSION, VELAR_PROJECT_FORMAT_VERSION, VELAR_PROJECT_TEMPLATES, } from "./types.js";
7
+ export async function createVelarProject(input, options = {}) {
8
+ if (!input || input.trim().length === 0 || input.includes("\0"))
9
+ throw new Error("a project directory is required");
10
+ const cwd = options.cwd ?? process.cwd();
11
+ const root = resolve(cwd, input);
12
+ const template = options.template ?? "web";
13
+ if (!VELAR_PROJECT_TEMPLATES.includes(template)) {
14
+ throw new Error(`unsupported VelarScript project template '${String(template)}'`);
15
+ }
16
+ const existing = await pathState(root);
17
+ if (existing !== "missing") {
18
+ if (existing !== "directory")
19
+ throw new Error(`'${input}' already exists and is not an ordinary directory`);
20
+ const entries = await readdir(root);
21
+ if (entries.length > 0)
22
+ throw new Error(`'${input}' already exists and is not empty`);
23
+ }
24
+ await mkdir(dirname(root), { recursive: true });
25
+ const staging = await mkdtemp(join(dirname(root), ".velar-create-"));
26
+ try {
27
+ const files = createTemplateFiles(template, root, VELAR_CREATE_VERSION, VELAR_PROJECT_FORMAT_VERSION);
28
+ for (const [relativePath, contents] of [...files].sort(([left], [right]) => left.localeCompare(right))) {
29
+ const path = join(staging, relativePath);
30
+ await mkdir(dirname(path), { recursive: true });
31
+ await writeFile(path, contents, { encoding: "utf8", flag: "wx" });
32
+ }
33
+ if (existing === "directory")
34
+ await rmdir(root);
35
+ await rename(staging, root);
36
+ }
37
+ catch (error) {
38
+ await rm(staging, { recursive: true, force: true });
39
+ if (existing === "directory" && await pathState(root) === "missing")
40
+ await mkdir(root);
41
+ throw error;
42
+ }
43
+ return { root, template };
44
+ }
45
+ async function pathState(path) {
46
+ try {
47
+ const information = await lstat(path);
48
+ return information.isDirectory() && !information.isSymbolicLink() ? "directory" : "other";
49
+ }
50
+ catch (error) {
51
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT")
52
+ return "missing";
53
+ throw error;
54
+ }
55
+ }
56
+ //# 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,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,GAGxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAwB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,GAIxB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAAa,EAAE,OAAO,GAAyB,EAAE;IACxF,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CA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IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QACvG,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { VelarProjectTemplate } from "./types.ts";
2
+ export declare function createTemplateFiles(template: VelarProjectTemplate, root: string, version: string, formatVersion: number): ReadonlyMap<string, string>;
3
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,oBAAoB,EAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAe7B"}
@@ -0,0 +1,498 @@
1
+ import { basename } from "node:path";
2
+ export function createTemplateFiles(template, root, version, formatVersion) {
3
+ const displayName = basename(root);
4
+ const name = packageName(displayName);
5
+ const dependencyVersion = version.includes("-") ? version : `^${version}`;
6
+ return template === "library"
7
+ ? libraryTemplate(name, displayName, dependencyVersion, formatVersion)
8
+ : template === "component"
9
+ ? componentTemplate(name, displayName, dependencyVersion, formatVersion)
10
+ : template === "docs"
11
+ ? docsTemplate(name, displayName, dependencyVersion, formatVersion)
12
+ : template === "desktop"
13
+ ? desktopTemplate(name, displayName, dependencyVersion, formatVersion)
14
+ : template === "node"
15
+ ? nodeTemplate(name, displayName, dependencyVersion, formatVersion)
16
+ : webTemplate(name, displayName, dependencyVersion, formatVersion);
17
+ }
18
+ function webTemplate(name, displayName, version, formatVersion) {
19
+ const files = new Map([
20
+ ...commonWebFiles(name, displayName, version, formatVersion),
21
+ ["README.md", `# ${displayName}\n\nA VelarScript Web starter for the JavaScript ecosystem.\n\n\`\`\`sh\nnpm install\nnpm run dev\n\`\`\`\n\nEdit \`src/app.vel\` to begin. Before sharing a production build, run \`npm run validate\`.\n`],
22
+ ["src/app.vel", `import {Head} from "velar/web"\nimport {border, clamp, color, rgb, spacing} from "velar/look"\n\nexport const appName = "${escapeVelarString(displayName)}"\nexport const frameworkPosition = "The first extensible language framework for the AI era, built for the JavaScript ecosystem."\n\nconst ink = rgb(24, 24, 24)\nconst inkSoft = rgb(92, 92, 92)\nconst paper = rgb(247, 247, 244)\nconst white = rgb(255, 255, 255)\n\nconst pageLook = look:\n display = "grid"\n placeItems = "center"\n minHeight = 100vh\n padding = spacing(32px, 20px)\n color = ink\n background = paper\n fontFamily = "Inter, ui-sans-serif, system-ui, sans-serif"\n\nconst helloLook = look:\n display = "grid"\n justifyItems = "center"\n gap = 20px\n width = 100%\n maxWidth = 680px\n textAlign = "center"\n\nconst markLook = look:\n width = 132px\n height = "auto"\n\nconst eyebrowLook = look:\n margin = 0\n color = inkSoft\n fontWeight = 700\n letterSpacing = 0.12em\n textTransform = "uppercase"\n\nconst titleLook = look:\n margin = 0\n fontSize = clamp(2.5rem, 8vw, 5rem)\n lineHeight = 0.96\n letterSpacing = -0.06em\n\nconst leadLook = look:\n maxWidth = 560px\n margin = 0\n color = inkSoft\n fontSize = 1.05rem\n lineHeight = 1.65\n\nconst buttonLook = look:\n padding = spacing(11px, 18px)\n border = border(0px, color("transparent"))\n borderRadius = 9999px\n color = white\n background = ink\n fontWeight = 700\n cursor = "pointer"\n\nexport component App:\n state count = 0\n\n def increment():\n count += 1\n\n return <main class="page" look={pageLook}>\n <Head title={appName} description={frameworkPosition} image="/velarscript-mark.svg" themeColor="#f7f7f4" />\n <section class="hello" look={helloLook}>\n <img look={markLook} src="/velarscript-mark.svg" alt="VelarScript" />\n <p class="eyebrow" look={eyebrowLook}>VelarScript Web</p>\n <h1 look={titleLook}>Hello, {appName}</h1>\n <p look={leadLook}>{frameworkPosition}</p>\n <button look={buttonLook} type="button" on:click={increment}>Count is {count}</button>\n </section>\n </main>\n`],
23
+ ["src/app.test.vel", `import {expect} from "velar/test"\nimport {appName, frameworkPosition} from "./app.vel"\n\ntest "application contract":\n expect(appName).toBe("${escapeVelarString(displayName)}")\n expect(frameworkPosition).toContain("JavaScript ecosystem")\n`],
24
+ ["src/app.browser.test.vel", `import {expect} from "velar/test"\nimport {browser} from "velar/web-test"\n\ntest "home page":\n await browser.open("/")\n expect(await browser.text("h1")).toBe("Hello, ${escapeVelarString(displayName)}")\n expect(await browser.attribute("img", "src")).toBe("/velarscript-mark.svg")\n await browser.click("button")\n await browser.waitForText("button", "Count is 1")\n`],
25
+ ]);
26
+ return files;
27
+ }
28
+ function nodeTemplate(name, displayName, version, formatVersion) {
29
+ const publicName = escapeHtml(displayName);
30
+ return new Map([
31
+ [".gitignore", "node_modules/\ndist/\n.velar/\n"],
32
+ agentsGuideFile(),
33
+ ...brandPublicFiles(),
34
+ ["package.json", json({
35
+ name,
36
+ version: "0.1.0",
37
+ private: true,
38
+ type: "module",
39
+ scripts: {
40
+ check: "velar check",
41
+ format: "velar format",
42
+ "format:check": "velar format --check",
43
+ dev: "velar run",
44
+ start: "velar run",
45
+ test: "velar test",
46
+ build: "velar build",
47
+ validate: "npm run format:check && npm run check && npm test && npm run build",
48
+ },
49
+ dependencies: { "@velarscript/node": version },
50
+ devDependencies: { "@velarscript/cli": version },
51
+ })],
52
+ ["velar.json", json({
53
+ formatVersion,
54
+ entry: "src/main.vel",
55
+ outDir: "dist",
56
+ publicDir: "public",
57
+ extensions: [],
58
+ })],
59
+ ["README.md", `# ${displayName}\n\nA VelarScript Node starter modeled on the familiar Node.js Hello World server.\n\n\`\`\`sh\nnpm install\nnpm run dev\n\`\`\`\n\nOpen \`http://127.0.0.1:3000\`. Edit \`src/app.vel\` to add routes and \`src/main.vel\` to change the host or port.\n`],
60
+ ["public/index.html", `<!doctype html>
61
+ <html lang="en">
62
+ <head>
63
+ <meta charset="UTF-8" />
64
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
65
+ <title>${publicName} · VelarScript Node</title>
66
+ <style>
67
+ :root { color: #181818; background: #f7f7f4; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
68
+ body { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 24px; box-sizing: border-box; }
69
+ main { display: grid; justify-items: center; gap: 18px; max-width: 640px; text-align: center; }
70
+ img { width: 120px; height: auto; }
71
+ small { color: #5c5c5c; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
72
+ h1 { margin: 0; font-size: clamp(2.5rem, 8vw, 5rem); line-height: .96; letter-spacing: -.06em; }
73
+ p { max-width: 560px; margin: 0; color: #5c5c5c; line-height: 1.65; }
74
+ code { color: #181818; }
75
+ </style>
76
+ </head>
77
+ <body>
78
+ <main>
79
+ <img src="/velarscript-mark.svg" alt="VelarScript" />
80
+ <small>VelarScript Node</small>
81
+ <h1>Hello from ${publicName}</h1>
82
+ <p>The first extensible language framework for the AI era, built for the JavaScript ecosystem.</p>
83
+ <p>Try the checked JSON endpoint at <code>/api/hello</code>.</p>
84
+ </main>
85
+ </body>
86
+ </html>
87
+ `],
88
+ ["src/app.vel", `import {ServeRequest, ServeResponse, fileResponse} from "velar/serve"
89
+
90
+ export const appName = "${escapeVelarString(displayName)}"
91
+ export const greeting = "Hello from VelarScript Node"
92
+
93
+ export async def handle(request: ServeRequest) -> ServeResponse:
94
+ if request.path == "/api/hello":
95
+ return {status: 200, json: {message: greeting, target: "node"}}
96
+ return fileResponse(root="public", path=request.path, fallback="index.html")
97
+ `],
98
+ ["src/main.vel", `import {serve} from "velar/serve"
99
+ import {appName, handle} from "./app.vel"
100
+
101
+ const server = await serve(handle, port=3000)
102
+ print(f"{appName} is running at http://127.0.0.1:{server.port}")
103
+ `],
104
+ ["src/app.test.vel", `import {expect} from "velar/test"
105
+ import {appName, greeting} from "./app.vel"
106
+
107
+ test "node application contract":
108
+ expect(appName).toBe("${escapeVelarString(displayName)}")
109
+ expect(greeting).toBe("Hello from VelarScript Node")
110
+ `],
111
+ ]);
112
+ }
113
+ function desktopTemplate(name, displayName, version, formatVersion) {
114
+ const identifier = applicationIdentifier(name);
115
+ const files = new Map([
116
+ [".gitignore", "node_modules/\ndist/\n.velar/\n"],
117
+ agentsGuideFile(),
118
+ ...brandPublicFiles(),
119
+ ["package.json", json({
120
+ name,
121
+ version: "0.1.0",
122
+ private: true,
123
+ type: "module",
124
+ scripts: {
125
+ check: "velar check",
126
+ format: "velar format",
127
+ "format:check": "velar format --check",
128
+ dev: "velar dev",
129
+ test: "velar test",
130
+ "test:browser": "velar test --browser=all",
131
+ build: "velar build",
132
+ package: "velar package",
133
+ validate: "npm run format:check && npm run check && npm test && npm run build",
134
+ },
135
+ dependencies: { "@velarscript/desktop": version },
136
+ devDependencies: { "@velarscript/cli": version },
137
+ })],
138
+ ["velar.json", json({
139
+ formatVersion,
140
+ entry: "src/main.vel",
141
+ outDir: "dist/renderer",
142
+ publicDir: "public",
143
+ extensions: ["@velarscript/desktop"],
144
+ desktop: {
145
+ productName: displayName,
146
+ identifier: `dev.velarscript.${identifier}`,
147
+ window: { width: 1040, height: 720, minWidth: 640, minHeight: 480 },
148
+ permissions: { files: [], processes: [], terminal: false, network: [], environment: [], secrets: [] },
149
+ },
150
+ })],
151
+ ["README.md", `# ${displayName}\n\nA single-project VelarScript Desktop starter backed by the system WebView.\n\n\`\`\`sh\nnpm install\nnpm run dev\nnpm run package\n\`\`\`\n\n\`npm run dev\` previews the renderer. On macOS, \`npm run package\` creates a native \`.app\` using the default VelarScript application icon.\n`],
152
+ ["src/main.vel", `import {App} from "./app.vel"
153
+
154
+ mount(<App />, "#app")
155
+ `],
156
+ ["src/app.vel", `import {Head} from "velar/web"
157
+ import {border, clamp, color, rgb, spacing} from "velar/look"
158
+
159
+ export const appName = "${escapeVelarString(displayName)}"
160
+ export const desktopModel = "One VelarScript project, one system WebView, no renderer/main split."
161
+
162
+ const ink = rgb(24, 24, 24)
163
+ const inkSoft = rgb(92, 92, 92)
164
+ const paper = rgb(247, 247, 244)
165
+ const white = rgb(255, 255, 255)
166
+
167
+ const pageLook = look:
168
+ display = "grid"
169
+ placeItems = "center"
170
+ minHeight = 100vh
171
+ padding = spacing(32px, 20px)
172
+ color = ink
173
+ background = paper
174
+ fontFamily = "Inter, ui-sans-serif, system-ui, sans-serif"
175
+
176
+ const helloLook = look:
177
+ display = "grid"
178
+ justifyItems = "center"
179
+ gap = 20px
180
+ width = 100%
181
+ maxWidth = 680px
182
+ textAlign = "center"
183
+
184
+ const markLook = look:
185
+ width = 132px
186
+ height = "auto"
187
+
188
+ const eyebrowLook = look:
189
+ margin = 0
190
+ color = inkSoft
191
+ fontWeight = 700
192
+ letterSpacing = 0.12em
193
+ textTransform = "uppercase"
194
+
195
+ const titleLook = look:
196
+ margin = 0
197
+ fontSize = clamp(2.5rem, 8vw, 5rem)
198
+ lineHeight = 0.96
199
+ letterSpacing = -0.06em
200
+
201
+ const leadLook = look:
202
+ maxWidth = 560px
203
+ margin = 0
204
+ color = inkSoft
205
+ fontSize = 1.05rem
206
+ lineHeight = 1.65
207
+
208
+ const buttonLook = look:
209
+ padding = spacing(11px, 18px)
210
+ border = border(0px, color("transparent"))
211
+ borderRadius = 9999px
212
+ color = white
213
+ background = ink
214
+ fontWeight = 700
215
+ cursor = "pointer"
216
+
217
+ export component App:
218
+ state count = 0
219
+
220
+ def increment():
221
+ count += 1
222
+
223
+ return <main class="page" look={pageLook}>
224
+ <Head title={appName} description={desktopModel} image="/velarscript-mark.svg" themeColor="#f7f7f4" />
225
+ <section class="hello" look={helloLook}>
226
+ <img look={markLook} src="/velarscript-mark.svg" alt="VelarScript" />
227
+ <p class="eyebrow" look={eyebrowLook}>VelarScript Desktop</p>
228
+ <h1 look={titleLook}>Hello, {appName}</h1>
229
+ <p look={leadLook}>{desktopModel}</p>
230
+ <button look={buttonLook} type="button" on:click={increment}>Count is {count}</button>
231
+ </section>
232
+ </main>
233
+ `],
234
+ ["src/app.test.vel", `import {expect} from "velar/test"
235
+ import {appName, desktopModel} from "./app.vel"
236
+
237
+ test "desktop application contract":
238
+ expect(appName).toBe("${escapeVelarString(displayName)}")
239
+ expect(desktopModel).toContain("system WebView")
240
+ `],
241
+ ["src/app.browser.test.vel", `import {expect} from "velar/test"
242
+ import {browser} from "velar/web-test"
243
+
244
+ test "desktop home":
245
+ await browser.open("/")
246
+ expect(await browser.text("h1")).toBe("Hello, ${escapeVelarString(displayName)}")
247
+ expect(await browser.attribute("img", "src")).toBe("/velarscript-mark.svg")
248
+ await browser.click("button")
249
+ await browser.waitForText("button", "Count is 1")
250
+ `],
251
+ ]);
252
+ return files;
253
+ }
254
+ function docsTemplate(name, displayName, version, formatVersion) {
255
+ const files = new Map([
256
+ ...commonWebFiles(name, displayName, version, formatVersion),
257
+ ["README.md", `# ${displayName}\n\nA routed documentation site written in VelarScript.\n\n\`\`\`sh\nnpm install\nnpm run dev\n\`\`\`\n\nAfter bootstrap, use \`npm exec velar -- add <package>\`, \`remove\`, and \`update\` for project-aware dependency changes. Edit the navigation and page metadata in \`src/content.vel\`.\n`],
258
+ ["src/content.vel", `export type DocPage:\n path: string\n label: string\n title: string\n summary: string\n\nexport const pages: List<DocPage> = [\n {path: "/", label: "Overview", title: "${escapeVelarString(displayName)}", summary: "A documentation site built entirely with VelarScript."},\n {path: "/guide", label: "Guide", title: "Guide", summary: "Start with one component, then grow through typed modules and the Web framework."},\n]\n\nexport def pageTitle(path: string) -> string:\n for page in pages:\n if page.path == path:\n return page.title\n return "Page not found"\n`],
259
+ ["src/styles.vel", `import {border, clamp, rgb, rgba, spacing} from "velar/look"\n\nexport const ink = rgb(17, 18, 22)\nexport const inkSoft = rgb(94, 96, 102)\nexport const paper = rgb(247, 245, 240)\nexport const paperPure = rgb(251, 250, 247)\nexport const sea = rgb(68, 123, 159)\nexport const seaSoft = rgba(68, 123, 159, 0.12)\nexport const rule = rgba(17, 18, 22, 0.14)\n\nexport const documentLook = look:\n display = "grid"\n gap = 18px\n width = 100%\n maxWidth = 824px\n padding = spacing(72px, 32px)\n\nexport const eyebrowLook = look:\n margin = 0\n color = sea\n fontWeight = 700\n textTransform = "uppercase"\n letterSpacing = 0.08em\n\nexport const titleLook = look:\n margin = 0\n fontSize = clamp(3rem, 8vw, 6rem)\n lineHeight = 0.96\n letterSpacing = -0.06em\n\nexport const leadLook = look:\n margin = 0\n color = inkSoft\n fontSize = 1.2rem\n lineHeight = 1.65\n\nexport const linkLook = look:\n color = sea\n fontWeight = 700\n\nexport const codeLook = look:\n overflow = "auto"\n padding = 20px\n border = border(1px, rule)\n borderRadius = 12px\n background = paperPure\n`],
260
+ ["src/pages/home.vel", `import {Head, Link} from "velar/web"\nimport {pages} from "../content.vel"\nimport {documentLook, eyebrowLook, leadLook, linkLook, titleLook} from "../styles.vel"\n\nexport component Home:\n const page = pages[0]\n\n return <main class="document" look={documentLook}>\n <Head title={page.title} description={page.summary} themeColor="#f7f5f0" />\n <p class="eyebrow" look={eyebrowLook}>VelarScript documentation</p>\n <h1 look={titleLook}>{page.title}</h1>\n <p class="lead" look={leadLook}>{page.summary}</p>\n <Link to="/guide" look={linkLook}>Read the guide</Link>\n </main>\n`],
261
+ ["src/pages/guide.vel", `import {Head} from "velar/web"\nimport {pages} from "../content.vel"\nimport {codeLook, documentLook, eyebrowLook, leadLook, titleLook} from "../styles.vel"\n\nconst example = "export component Hello(name: string):\\n return <h1>Hello {name}</h1>"\n\nexport component Guide:\n const page = pages[1]\n\n return <main class="document" look={documentLook}>\n <Head title={page.title} description={page.summary} themeColor="#f7f5f0" />\n <p class="eyebrow" look={eyebrowLook}>Guide</p>\n <h1 look={titleLook}>{page.title}</h1>\n <p class="lead" look={leadLook}>{page.summary}</p>\n <pre look={codeLook}><code>{example}</code></pre>\n </main>\n`],
262
+ ["src/app.vel", `import {NavLink, RouteContext, Router, route} from "velar/web"\nimport {pages} from "./content.vel"\nimport {documentLook, eyebrowLook, ink, inkSoft, paper, paperPure, rule, seaSoft, titleLook} from "./styles.vel"\nimport {Home} from "./pages/home.vel"\nimport {Guide} from "./pages/guide.vel"\nimport {border, color, minmax, spacing, tracks} from "velar/look"\n\ncomponent NotFound(route: RouteContext):\n return <main class="document" look={documentLook}>\n <p class="eyebrow" look={eyebrowLook}>404</p>\n <h1 look={titleLook}>Page not found</h1>\n <p>No document matches {route.path}.</p>\n </main>\n\nconst routes = [route("/", Home), route("/guide", Guide)]\n\nconst shellLook = look:\n display = "grid"\n gridTemplateColumns = tracks(240px, minmax(0px, 1fr))\n minHeight = 100vh\n color = ink\n background = paper\n fontFamily = "Inter, ui-sans-serif, system-ui, sans-serif"\n\n if viewport.width <= 720px:\n gridTemplateColumns = tracks(1fr)\n\nconst navLook = look:\n display = "grid"\n alignContent = "start"\n gap = 8px\n padding = spacing(28px, 20px)\n borderRight = border(1px, rule)\n background = paperPure\n\n if viewport.width <= 720px:\n flexDirection = "column"\n justifyContent = "start"\n borderRight = border(0px, color("transparent"))\n borderBottom = border(1px, rule)\n\nconst brandLook = look:\n marginBottom = 16px\n\n if viewport.width <= 720px:\n margin = spacing(8px, 12px, 0px, 0px)\n\nconst navLinkLook = look:\n padding = spacing(8px, 10px)\n borderRadius = 8px\n color = inkSoft\n textDecoration = "none"\n\n if @current:\n color = ink\n background = seaSoft\n\nexport component App:\n return <div class="shell" look={shellLook}>\n <nav look={navLook} aria-label="Documentation">\n <strong look={brandLook}>${escapeVelarString(displayName)}</strong>\n {pages.map(page => <NavLink key={page.path} to={page.path} exact={true} look={navLinkLook}>{page.label}</NavLink>)}\n </nav>\n <Router routes={routes} fallback={NotFound} />\n </div>\n`],
263
+ ["src/content.test.vel", `import {expect} from "velar/test"\nimport {pageTitle, pages} from "./content.vel"\n\ntest "documentation navigation":\n expect(pages).toHaveLength(2)\n expect(pageTitle("/guide")).toBe("Guide")\n expect(pageTitle("/missing")).toBe("Page not found")\n`],
264
+ ["src/app.browser.test.vel", `import {expect} from "velar/test"\nimport {browser} from "velar/web-test"\n\ntest "guide route":\n await browser.open("/guide")\n expect(await browser.text("h1")).toBe("Guide")\n expect(await browser.text("nav")).toContain("Overview")\n`],
265
+ ]);
266
+ return files;
267
+ }
268
+ function libraryTemplate(name, displayName, version, formatVersion) {
269
+ const packageManifest = {
270
+ name,
271
+ version: "0.1.0",
272
+ private: true,
273
+ type: "module",
274
+ files: ["src"],
275
+ velar: { entry: "src/index.vel" },
276
+ scripts: {
277
+ check: "velar check",
278
+ format: "velar format",
279
+ "format:check": "velar format --check",
280
+ test: "velar test",
281
+ build: "velar build",
282
+ "pack:check": "npm pack --dry-run --json",
283
+ validate: "npm run format:check && npm run check && npm test && npm run build && npm run pack:check",
284
+ },
285
+ devDependencies: {
286
+ "@velarscript/cli": version,
287
+ },
288
+ };
289
+ return new Map([
290
+ [".gitignore", "node_modules/\ndist/\n.velar/\n"],
291
+ agentsGuideFile(),
292
+ ["package.json", json(packageManifest)],
293
+ ["velar.json", json({
294
+ formatVersion,
295
+ entry: "src/index.vel",
296
+ outDir: "dist",
297
+ publicDir: "public",
298
+ extensions: [],
299
+ })],
300
+ ["README.md", `# ${displayName}\n\nA reusable VelarScript source library.\n\n\`\`\`sh\nnpm install\nnpm run validate\n\`\`\`\n\nAfter bootstrap, use \`npm exec velar -- add <package>\`, \`remove\`, and \`update\` for project-aware dependency changes. The package is private by default. Remove \`private\` only after choosing a public package name, license, and release policy.\n`],
301
+ ["src/index.vel", `export type Greeting:\n message: string\n recipient: string\n\nexport def greet(name: string) -> Greeting:\n const recipient = name.trim()\n assert recipient != "" else "A greeting requires a name"\n return {message: f"Hello, {recipient}!", recipient: recipient}\n`],
302
+ ["src/index.test.vel", `import {expect} from "velar/test"\nimport {greet} from "./index.vel"\n\ntest "greeting":\n const greeting = greet("Velar")\n expect(greeting.message).toBe("Hello, Velar!")\n expect(greeting.recipient).toBe("Velar")\n\ntest "greeting rejects blank names":\n expect(() => greet(" ")).toThrow()\n`],
303
+ ]);
304
+ }
305
+ function componentTemplate(name, displayName, version, formatVersion) {
306
+ const packageManifest = {
307
+ name,
308
+ version: "0.1.0",
309
+ private: true,
310
+ type: "module",
311
+ files: ["src/index.vel", "README.md"],
312
+ velar: { entry: "src/index.vel" },
313
+ scripts: {
314
+ check: "velar check",
315
+ format: "velar format",
316
+ "format:check": "velar format --check",
317
+ test: "velar test",
318
+ "test:browser": "velar test --browser",
319
+ build: "velar build",
320
+ verify: "velar verify",
321
+ "pack:check": "npm pack --dry-run --json",
322
+ validate: "npm run format:check && npm run check && npm test && npm run build && npm run verify && npm run pack:check",
323
+ },
324
+ peerDependencies: {
325
+ "@velarscript/web": version,
326
+ },
327
+ devDependencies: {
328
+ "@velarscript/cli": version,
329
+ "@velarscript/web": version,
330
+ },
331
+ };
332
+ const files = new Map([
333
+ [".gitignore", "node_modules/\ndist/\n.velar/\n"],
334
+ agentsGuideFile(),
335
+ ...brandPublicFiles(),
336
+ ["package.json", json(packageManifest)],
337
+ ["velar.json", json({
338
+ formatVersion,
339
+ entry: "src/demo.vel",
340
+ outDir: "dist",
341
+ publicDir: "public",
342
+ extensions: ["@velarscript/web"],
343
+ web: {
344
+ title: `${displayName} component preview`,
345
+ base: "/",
346
+ publicConfig: {},
347
+ build: { sourceMaps: false },
348
+ security: { contentSecurityPolicy: true, connectSources: [], imageSources: [] },
349
+ deployment: { spaFallback: true },
350
+ },
351
+ })],
352
+ ["README.md", `# ${displayName}\n\nA reusable VelarScript Web component source package.\n\n\`\`\`sh\nnpm install\nnpm run validate\nnpm run test:browser\n\`\`\`\n\nThe published package entry is \`src/index.vel\`; \`src/demo.vel\` is the local preview application. The package is private by default. Remove \`private\` only after choosing a public package name, license, and release policy.\n`],
353
+ ["src/index.vel", `import {domId} from "velar/web"\nimport {border, rgb, rgba} from "velar/look"\n\nexport type CardContent:\n title: string\n body: string\n\nexport const exampleContent: CardContent = {title: "Built with VelarScript", body: "A reusable component ships as checked VelarScript source."}\n\nconst cardLook = look:\n display = "grid"\n gap = 10px\n padding = 20px\n border = border(1px, rgba(17, 18, 22, 0.14))\n borderRadius = 14px\n background = rgb(251, 250, 247)\n\nconst titleLook = look:\n margin = 0\n\nconst bodyLook = look:\n margin = 0\n color = rgb(94, 96, 102)\n lineHeight = 1.6\n\nexport component InfoCard(content: CardContent):\n const titleId = domId("info-card-title")\n return <article class="card" look={cardLook} aria-labelledby={titleId}>\n <h2 look={titleLook} id={titleId}>{content.title}</h2>\n <p look={bodyLook}>{content.body}</p>\n </article>\n`],
354
+ ["src/demo.vel", `import {InfoCard, exampleContent} from "./index.vel"\n\nmount(<main><InfoCard content={exampleContent} /></main>, "#app")\n`],
355
+ ["src/index.test.vel", `import {expect} from "velar/test"\nimport {exampleContent} from "./index.vel"\n\ntest "component content contract":\n expect(exampleContent.title).toBe("Built with VelarScript")\n expect(exampleContent.body).toContain("checked VelarScript source")\n`],
356
+ ["src/demo.browser.test.vel", `import {expect} from "velar/test"\nimport {browser} from "velar/web-test"\n\ntest "component preview":\n await browser.open("/")\n expect(await browser.text("article h2")).toBe("Built with VelarScript")\n expect(await browser.text("article p")).toContain("reusable component")\n const titleId = await browser.attribute("article", "aria-labelledby")\n expect(titleId != null).toBe(true)\n if titleId != null:\n expect(titleId).toContain("info-card-title-")\n expect(await browser.attribute("article h2", "id")).toBe(titleId)\n`],
357
+ ]);
358
+ return files;
359
+ }
360
+ function commonWebFiles(name, displayName, version, formatVersion) {
361
+ return [
362
+ [".gitignore", "node_modules/\ndist/\n.velar/\n"],
363
+ agentsGuideFile(),
364
+ ...brandPublicFiles(),
365
+ ["package.json", json({
366
+ name,
367
+ version: "0.1.0",
368
+ private: true,
369
+ type: "module",
370
+ scripts: {
371
+ check: "velar check",
372
+ format: "velar format",
373
+ "format:check": "velar format --check",
374
+ dev: "velar dev",
375
+ test: "velar test",
376
+ "test:browser": "velar test --browser",
377
+ build: "velar build",
378
+ verify: "velar verify",
379
+ preview: "velar preview",
380
+ "verify:deployment": "velar verify-deployment",
381
+ validate: "npm run format:check && npm run check && npm test && npm run build && npm run verify",
382
+ },
383
+ dependencies: { "@velarscript/web": version },
384
+ devDependencies: { "@velarscript/cli": version },
385
+ })],
386
+ ["velar.json", json({
387
+ formatVersion,
388
+ entry: "src/main.vel",
389
+ outDir: "dist",
390
+ publicDir: "public",
391
+ extensions: ["@velarscript/web"],
392
+ web: {
393
+ title: displayName,
394
+ base: "/",
395
+ publicConfig: {},
396
+ build: { sourceMaps: false },
397
+ security: { contentSecurityPolicy: true, connectSources: [], imageSources: [] },
398
+ deployment: { spaFallback: true },
399
+ },
400
+ })],
401
+ ["src/main.vel", `import {App} from "./app.vel"\n\nmount(<App />, "#app")\n`],
402
+ ];
403
+ }
404
+ const AGENTS_GUIDE = `# Working in this VelarScript project
405
+
406
+ This project is written in VelarScript (\`.vel\` sources). VelarScript's
407
+ parents are JavaScript and Python: write on those priors and the compiler
408
+ teaches the rest. Run \`velar skill\` for the full language brief — it ships
409
+ with the toolchain and prints agent-ready markdown to stdout.
410
+
411
+ ## Gates
412
+
413
+ Run these before considering any change done:
414
+
415
+ - \`velar check\` — type-checks the whole project; do exactly what each
416
+ diagnostic says (it names the one current spelling).
417
+ - \`velar test\` — runs the project's tests.
418
+ - \`velar format\` — settles layout (\`velar format --check\` verifies).
419
+
420
+ \`npm run validate\` runs this project's full gate set from package.json.
421
+
422
+ ## The essentials
423
+
424
+ - Interpolation is \`f"{value}"\` — \`\${...}\` inside a string is literal
425
+ text (the one silent trap).
426
+ - Comments are \`//\`. Functions are \`def\`. Record shapes and aliases are
427
+ \`type\`.
428
+ - \`.size\` not \`.length\`; \`.append(value)\` not \`.push(value)\`.
429
+ - Conditions accept only \`bool\`; test presence with \`value != null\`.
430
+ - One statement per line; no \`++\`; named arguments are \`name=value\`.
431
+ - \`match\` dispatches finite states; \`case _:\` is the fallback.
432
+ - \`await task()\` or detached \`async task()\` — a dropped Promise is a
433
+ compile error.
434
+ - \`range\` needs \`import {range} from "velar/collections"\`.
435
+ - Multi-line text is a layout string: a quote followed by a newline opens
436
+ it; a quote at the opening line's indentation closes it.
437
+ - \`print(value)\` inspects any value; f-strings and \`str()\` accept only
438
+ strings, numbers, bools, enums, and \`null\` — \`stringify\` from
439
+ \`velar/json\` builds data text.
440
+
441
+ \`velar skill\` covers the rest: the declaration reference, the idiom
442
+ cookbook, and the complete pitfall table.
443
+
444
+ ## When VelarScript is missing something
445
+
446
+ In order: \`extern module\` declares a checked boundary to any npm package
447
+ (first choice); \`import js unsafe\` admits a raw value as \`any\` — validate
448
+ it with \`Type.parse\` at the edge; \`import css unsafe "./file.css"
449
+ before|after look\` and \`unsafe:html\` cover styling and markup. If the
450
+ compiler itself seems wrong, reduce to a minimal repro and report it; the
451
+ emitted \`velar build\` JavaScript is always a readable, source-mapped exit
452
+ that runs without the toolchain. \`velar skill\` includes the full
453
+ escape-hatch decision tree.
454
+ `;
455
+ function agentsGuideFile() {
456
+ return ["AGENTS.md", AGENTS_GUIDE];
457
+ }
458
+ const VELARSCRIPT_MARK_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="85 113 346 290" role="img" aria-labelledby="title">
459
+ <title id="title">VelarScript</title>
460
+ <g fill="#181818">
461
+ <path d="M97 128C98 126 99 125 102 125h94c9 0 15 4 19 13l42 81c6 10 16 17 27 24 12 9 18 21 17 35 0 8-4 16-9 24l-55 81L98 134c-2-3-2-5-1-6Z"/>
462
+ <path d="M271 180c3-11 10-22 17-29l17-17c6-6 11-9 19-9h95l-86 153c1-9-1-19-6-27-4-7-12-14-19-20l-25-22c-10-8-14-18-12-29Z"/>
463
+ <path d="m237 383 82-81-46 84c-5 4-11 5-18 5s-13-3-18-8Z"/>
464
+ </g>
465
+ </svg>
466
+ `;
467
+ function brandPublicFiles() {
468
+ return [["public/velarscript-mark.svg", VELARSCRIPT_MARK_SVG]];
469
+ }
470
+ function packageName(value) {
471
+ const normalized = value.toLowerCase()
472
+ .replace(/[^a-z0-9._-]+/gu, "-")
473
+ .replace(/^[._-]+|[._-]+$/gu, "")
474
+ .slice(0, 214);
475
+ if (!normalized || normalized === "node_modules" || normalized === "favicon.ico")
476
+ return "velar-app";
477
+ return normalized;
478
+ }
479
+ function applicationIdentifier(value) {
480
+ return value.toLowerCase()
481
+ .replace(/[^a-z0-9-]+/gu, "-")
482
+ .replace(/^-+|-+$/gu, "")
483
+ .slice(0, 63) || "app";
484
+ }
485
+ function json(value) {
486
+ return `${JSON.stringify(value, null, 2)}\n`;
487
+ }
488
+ function escapeVelarString(value) {
489
+ return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replaceAll("\n", "\\n").replaceAll("\r", "\\r");
490
+ }
491
+ function escapeHtml(value) {
492
+ return value.replaceAll("&", "&amp;")
493
+ .replaceAll("<", "&lt;")
494
+ .replaceAll(">", "&gt;")
495
+ .replaceAll('"', "&quot;")
496
+ .replaceAll("'", "&#39;");
497
+ }
498
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,UAAU,mBAAmB,CACjC,QAA8B,EAC9B,IAAY,EACZ,OAAe,EACf,aAAqB;IAErB,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IACtC,MAAM,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC;IAC1E,OAAO,QAAQ,KAAK,SAAS;QAC3B,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC;QACtE,CAAC,CAAC,QAAQ,KAAK,WAAW;YACxB,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC;YACxE,CAAC,CAAC,QAAQ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C;SAClC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC;SACzB,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const VELAR_CREATE_VERSION = "0.10.1";
2
+ export declare const VELAR_PROJECT_FORMAT_VERSION = 2;
3
+ export declare const VELAR_PROJECT_TEMPLATES: readonly ["web", "node", "desktop", "docs", "library", "component"];
4
+ export type VelarProjectTemplate = typeof VELAR_PROJECT_TEMPLATES[number];
5
+ export interface CreateProjectOptions {
6
+ readonly cwd?: string;
7
+ readonly template?: VelarProjectTemplate;
8
+ }
9
+ export interface CreateProjectResult {
10
+ readonly root: string;
11
+ readonly template: VelarProjectTemplate;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,uBAAuB,qEAAqF,CAAC;AAE1H,MAAM,MAAM,oBAAoB,GAAG,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CAC1C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;CACzC"}
package/dist/types.js ADDED
@@ -0,0 +1,4 @@
1
+ export const VELAR_CREATE_VERSION = "0.10.1";
2
+ export const VELAR_PROJECT_FORMAT_VERSION = 2;
3
+ export const VELAR_PROJECT_TEMPLATES = Object.freeze(["web", "node", "desktop", "docs", "library", "component"]);
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAC7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "create-velar",
3
+ "version": "0.10.1",
4
+ "description": "Create reproducible VelarScript Web, Node, and Desktop applications plus documentation sites and source packages.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "scripts": {
12
+ "clean": "node ../../scripts/clean-package-dist.mjs",
13
+ "build": "npm run clean && tsc -p tsconfig.build.json",
14
+ "postbuild": "node ../../scripts/mark-package-bin.mjs dist/cli.js",
15
+ "prepack": "npm run build"
16
+ },
17
+ "engines": {
18
+ "node": ">=24"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/VelarOS-AI/VelarScript.git",
23
+ "directory": "packages/create"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "bin": {
29
+ "create-velar": "./dist/cli.js"
30
+ },
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ }
36
+ }
37
+ }