wesl-packager 0.7.3 → 0.7.5

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/bin/wesl-packager CHANGED
File without changes
package/dist/main.mjs ADDED
@@ -0,0 +1,224 @@
1
+ #!/usr/bin/env node
2
+ import { exit } from "node:process";
3
+ import { hideBin } from "yargs/helpers";
4
+ import { loadModules, parseDependencies, versionFromPackageJson, zip } from "wesl-tooling";
5
+ import yargs from "yargs";
6
+ import fs, { mkdir, readFile } from "node:fs/promises";
7
+ import path from "node:path";
8
+ import { Biome, Distribution } from "@biomejs/js-api";
9
+ import { noSuffix, sanitizePackageName } from "wesl";
10
+ import { weslBundleDeclUrl } from "wesl/bundle-decl";
11
+
12
+ //#region src/PackageWesl.ts
13
+ const weslBundleDecl = await readFile(new URL(weslBundleDeclUrl), "utf8");
14
+ const { biome, projectKey: biomeKey } = await setupBiome();
15
+ /** write weslBundle .js and .d.ts files for this shader */
16
+ async function packageWgsl(args) {
17
+ const { projectDir, outDir, multiBundle, baseDir, src } = args;
18
+ const modules = await loadModules(projectDir, baseDir, src);
19
+ const { name } = await loadPackageFields(path.join(projectDir, "package.json"));
20
+ const edition = "unstable_2025_1";
21
+ if (args.multiBundle) await writeMultiBundle(modules, name, edition, projectDir, outDir);
22
+ else {
23
+ const allDeps = parseDependencies(modules, projectDir);
24
+ const sanitized = sanitizePackageName(name);
25
+ const deps = filterSelfDeps(allDeps, sanitized);
26
+ await writeJsBundle({
27
+ name: sanitized,
28
+ edition,
29
+ modules
30
+ }, deps, outDir);
31
+ }
32
+ await writeTypeScriptDts(outDir);
33
+ if (args.updatePackageJson) await updatePackageJson(projectDir, outDir, multiBundle);
34
+ }
35
+ /** add an 'exports' entry to package.json for the wesl bundles */
36
+ async function updatePackageJson(projectDir, outDir, multiBundle) {
37
+ const pkgJsonPath = path.join(projectDir, "package.json");
38
+ const pkgJsonString = await fs.readFile(pkgJsonPath, { encoding: "utf8" });
39
+ const pkgJson = JSON.parse(pkgJsonString);
40
+ const exports = {};
41
+ const distDir = path.relative(projectDir, outDir);
42
+ if (multiBundle) exports["./*"] = {
43
+ types: `./${distDir}/weslBundle.d.ts`,
44
+ import: `./${distDir}/*/weslBundle.js`
45
+ };
46
+ else exports["."] = {
47
+ types: `./${distDir}/weslBundle.d.ts`,
48
+ import: `./${distDir}/weslBundle.js`
49
+ };
50
+ const newPkgJson = insertExports(pkgJson, exports);
51
+ const jsonString = JSON.stringify(newPkgJson, null, 2).concat("\n");
52
+ await fs.writeFile(pkgJsonPath, jsonString);
53
+ }
54
+ /** insert the exports field into the package.json */
55
+ function insertExports(pkgJson, exports) {
56
+ const exportsAfter = [
57
+ "name",
58
+ "description",
59
+ "version",
60
+ "private",
61
+ "author",
62
+ "type",
63
+ "bin",
64
+ "files",
65
+ "repository",
66
+ "homepage",
67
+ "scripts"
68
+ ];
69
+ const entries = Object.entries(pkgJson);
70
+ const index = entries.findLastIndex(([key]) => exportsAfter.includes(key));
71
+ entries.splice(index + 1, 0, ["exports", exports]);
72
+ return Object.fromEntries(entries);
73
+ }
74
+ /** create one bundle per source module */
75
+ async function writeMultiBundle(modules, name, edition, projectDir, outDir) {
76
+ const sanitized = sanitizePackageName(name);
77
+ for (const [moduleName, moduleSrc] of Object.entries(modules)) {
78
+ const oneModule = { [moduleName]: moduleSrc };
79
+ const moduleBundle = {
80
+ name: sanitized,
81
+ edition,
82
+ modules: oneModule
83
+ };
84
+ const dependencies = parseDependencies(oneModule, projectDir);
85
+ const bundleDirRelative = noSuffix(moduleName);
86
+ await writeJsBundle(moduleBundle, dependencies, path.join(outDir, bundleDirRelative));
87
+ }
88
+ }
89
+ /** Write a weslBundle.js containing the bundled shader sources */
90
+ async function writeJsBundle(weslBundle, dependencies, outDir) {
91
+ await mkdir(outDir, { recursive: true });
92
+ const depNames = dependencies.map((dep) => dep.replaceAll("/", "_"));
93
+ const imports = zip(dependencies, depNames).map(([dep, depName]) => {
94
+ return `import ${depName} from "${dep}";`;
95
+ }).join("\n");
96
+ const outString = `
97
+ ${imports ? `${imports}\n` : ""}
98
+ export const weslBundle = ${bundleToJsString(weslBundle, depNames)}
99
+
100
+ export default weslBundle;
101
+ `;
102
+ const outPath = path.join(outDir, "weslBundle.js");
103
+ const formatted = biome.formatContent(biomeKey, outString, { filePath: "b.js" });
104
+ await fs.writeFile(outPath, formatted.content);
105
+ }
106
+ /** Write weslBundle.d.ts containing the type definitions for a WeslBundle */
107
+ async function writeTypeScriptDts(outDir) {
108
+ const declText = weslBundleDecl + `
109
+ export declare const weslBundle: WeslBundle;
110
+ export default weslBundle;
111
+ `;
112
+ const formatted = biome.formatContent(biomeKey, declText, { filePath: "t.d.ts" });
113
+ const outPath = path.join(outDir, "weslBundle.d.ts");
114
+ await fs.writeFile(outPath, formatted.content);
115
+ }
116
+ /** @return the bundle plus dependencies as a JavaScript string */
117
+ function bundleToJsString(bundle, dependencies) {
118
+ const { name, edition, modules } = bundle;
119
+ const obj = {
120
+ name,
121
+ edition,
122
+ modules,
123
+ ...dependencies.length ? { dependencies: 99 } : {}
124
+ };
125
+ const jsonString = JSON.stringify(obj, null, 2);
126
+ if (dependencies.length) {
127
+ const dependenciesStr = `: [${dependencies.join(", ")}]`;
128
+ return jsonString.replace(": 99", dependenciesStr);
129
+ } else return jsonString;
130
+ }
131
+ /** Filter out self-dependencies from the dependency list */
132
+ function filterSelfDeps(deps, packageName) {
133
+ return deps.filter((dep) => dep !== packageName && !dep.startsWith(`${packageName}/`));
134
+ }
135
+ /** parse and extract fields from package.json that we care about
136
+ * (the name of the package) */
137
+ async function loadPackageFields(pkgJsonPath) {
138
+ const pkgJsonString = await fs.readFile(pkgJsonPath, { encoding: "utf8" });
139
+ const { name } = JSON.parse(pkgJsonString);
140
+ verifyField("name", name);
141
+ function verifyField(field, value) {
142
+ if (value === void 0) {
143
+ console.error(`no '${field}' field found in "${pkgJsonPath}"`);
144
+ throw new Error("package.json incomplete");
145
+ }
146
+ }
147
+ return { name };
148
+ }
149
+ /** setup biome to use as a formatter */
150
+ async function setupBiome() {
151
+ const biome$1 = await Biome.create({ distribution: Distribution.NODE });
152
+ const { projectKey } = biome$1.openProject();
153
+ biome$1.applyConfiguration(projectKey, { formatter: {
154
+ enabled: true,
155
+ indentStyle: "space",
156
+ lineEnding: "lf",
157
+ expand: "auto"
158
+ } });
159
+ return {
160
+ biome: biome$1,
161
+ projectKey
162
+ };
163
+ }
164
+
165
+ //#endregion
166
+ //#region src/PackagerCli.ts
167
+ let cliArgs;
168
+ async function packagerCli(rawArgs$1) {
169
+ cliArgs = await parseArgs(rawArgs$1);
170
+ await packageWgsl(cliArgs);
171
+ }
172
+ async function parseArgs(args) {
173
+ const projectDir = new URL("..", import.meta.url).href;
174
+ const appVersion = await versionFromPackageJson(projectDir);
175
+ return yargs(args).command("$0", "create an npm package from WGSL/WESL files").version(appVersion).option("src", {
176
+ type: "string",
177
+ describe: "WGSL/WESL files to bundle in the package (glob syntax, defaults to wesl.toml or shaders/**/*.w[eg]sl)"
178
+ }).option("rootDir", {
179
+ deprecated: true,
180
+ type: "string",
181
+ describe: "use --baseDir instead"
182
+ }).option("baseDir", {
183
+ deprecated: true,
184
+ type: "string",
185
+ describe: "root directory for shaders (defaults to wesl.toml or shaders)"
186
+ }).option("projectDir", {
187
+ type: "string",
188
+ default: ".",
189
+ describe: "directory containing package.json and wesl.toml"
190
+ }).option("multiBundle", {
191
+ type: "boolean",
192
+ default: false,
193
+ describe: "make a shader bundle for each source file"
194
+ }).option("exportName", {
195
+ type: "string",
196
+ default: ".",
197
+ describe: "package.json export name for consolidated bundle (ignored for multiBundle)"
198
+ }).option("updatePackageJson", {
199
+ type: "boolean",
200
+ default: false,
201
+ describe: "add 'exports' entries into package.json"
202
+ }).option("outDir", {
203
+ type: "string",
204
+ default: "dist",
205
+ describe: "where to put bundled output files (relative to projectDir)"
206
+ }).help().parse();
207
+ }
208
+
209
+ //#endregion
210
+ //#region src/main.ts
211
+ const rawArgs = hideBin(process.argv);
212
+ const [major] = process.versions.node.split(".").map(Number);
213
+ if (major < 22) {
214
+ console.error(`Please upgrade node to version 22 or higher. (The current node version is ${process.version})`);
215
+ exit(1);
216
+ }
217
+ packagerCli(rawArgs).catch((e) => {
218
+ console.error(e);
219
+ exit(1);
220
+ });
221
+
222
+ //#endregion
223
+ export { };
224
+ //# sourceMappingURL=main.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.mjs","names":["biome","rawArgs"],"sources":["../src/PackageWesl.ts","../src/PackagerCli.ts","../src/main.ts"],"sourcesContent":["import fs, { mkdir, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Biome, Distribution } from \"@biomejs/js-api\";\nimport { noSuffix, sanitizePackageName, type WeslBundle } from \"wesl\";\nimport { weslBundleDeclUrl } from \"wesl/bundle-decl\";\nimport { loadModules, parseDependencies, zip } from \"wesl-tooling\";\nimport type { CliArgs } from \"./PackagerCli.ts\";\n\nconst weslBundleDecl = await readFile(new URL(weslBundleDeclUrl), \"utf8\");\n\nconst { biome, projectKey: biomeKey } = await setupBiome();\n\n/** write weslBundle .js and .d.ts files for this shader */\nexport async function packageWgsl(args: CliArgs): Promise<void> {\n const { projectDir, outDir, multiBundle, baseDir, src } = args;\n const modules = await loadModules(projectDir, baseDir, src);\n const pkgJsonPath = path.join(projectDir, \"package.json\");\n const { name } = await loadPackageFields(pkgJsonPath);\n const edition = \"unstable_2025_1\";\n\n if (args.multiBundle) {\n await writeMultiBundle(modules, name, edition, projectDir, outDir);\n } else {\n const allDeps = parseDependencies(modules, projectDir);\n const sanitized = sanitizePackageName(name);\n const deps = filterSelfDeps(allDeps, sanitized);\n const bundle: WeslBundle = { name: sanitized, edition, modules };\n await writeJsBundle(bundle, deps, outDir);\n }\n await writeTypeScriptDts(outDir);\n if (args.updatePackageJson) {\n await updatePackageJson(projectDir, outDir, multiBundle);\n }\n}\n\n/** add an 'exports' entry to package.json for the wesl bundles */\nasync function updatePackageJson(\n projectDir: string,\n outDir: string,\n multiBundle: boolean,\n): Promise<void> {\n const pkgJsonPath = path.join(projectDir, \"package.json\");\n const pkgJsonString = await fs.readFile(pkgJsonPath, { encoding: \"utf8\" });\n const pkgJson = JSON.parse(pkgJsonString);\n const exports: Record<string, any> = {};\n\n const distDir = path.relative(projectDir, outDir);\n if (multiBundle) {\n exports[\"./*\"] = {\n types: `./${distDir}/weslBundle.d.ts`,\n import: `./${distDir}/*/weslBundle.js`,\n };\n } else {\n exports[\".\"] = {\n types: `./${distDir}/weslBundle.d.ts`,\n import: `./${distDir}/weslBundle.js`,\n };\n }\n\n const newPkgJson = insertExports(pkgJson, exports);\n const jsonString = JSON.stringify(newPkgJson, null, 2).concat(\"\\n\");\n await fs.writeFile(pkgJsonPath, jsonString);\n}\n\n/** insert the exports field into the package.json */\nfunction insertExports(pkgJson: any, exports: Record<string, any>): any {\n // insert the export entries into the existing package.json, after these fields (for a clean format)\n const exportsAfter = [\n \"name\",\n \"description\",\n \"version\",\n \"private\",\n \"author\",\n \"type\",\n \"bin\",\n \"files\",\n \"repository\",\n \"homepage\",\n \"scripts\",\n ];\n const entries = Object.entries(pkgJson);\n const index = entries.findLastIndex(([key]) => exportsAfter.includes(key));\n\n entries.splice(index + 1, 0, [\"exports\", exports]);\n return Object.fromEntries(entries);\n}\n\n/** create one bundle per source module */\nasync function writeMultiBundle(\n modules: Record<string, string>,\n name: string,\n edition: string,\n projectDir: string,\n outDir: string,\n): Promise<void> {\n const sanitized = sanitizePackageName(name);\n for (const [moduleName, moduleSrc] of Object.entries(modules)) {\n const oneModule = { [moduleName]: moduleSrc };\n const moduleBundle: WeslBundle = {\n name: sanitized,\n edition,\n modules: oneModule,\n };\n const dependencies = parseDependencies(oneModule, projectDir);\n const bundleDirRelative = noSuffix(moduleName);\n const bundleDir = path.join(outDir, bundleDirRelative);\n await writeJsBundle(moduleBundle, dependencies, bundleDir);\n }\n}\n\n/** Write a weslBundle.js containing the bundled shader sources */\nasync function writeJsBundle(\n weslBundle: WeslBundle,\n dependencies: string[],\n outDir: string,\n): Promise<void> {\n await mkdir(outDir, { recursive: true });\n\n const depNames = dependencies.map(dep => dep.replaceAll(\"/\", \"_\"));\n const depsWithNames = zip(dependencies, depNames);\n\n const imports = depsWithNames\n .map(([dep, depName]) => {\n return `import ${depName} from \"${dep}\";`;\n })\n .join(\"\\n\");\n const importsStr = imports ? `${imports}\\n` : \"\";\n\n const bundleString = bundleToJsString(weslBundle, depNames);\n\n const outString = `\n ${importsStr}\n export const weslBundle = ${bundleString}\n\n export default weslBundle;\n `;\n\n const outPath = path.join(outDir, \"weslBundle.js\");\n const formatted = biome.formatContent(biomeKey, outString, {\n filePath: \"b.js\",\n });\n await fs.writeFile(outPath, formatted.content);\n}\n\n/** Write weslBundle.d.ts containing the type definitions for a WeslBundle */\nasync function writeTypeScriptDts(outDir: string): Promise<void> {\n // TODO could we use /// <reference types=\"wesl\"> to get the type of WeslBundle?\n const constDecl = `\n export declare const weslBundle: WeslBundle;\n export default weslBundle;\n `;\n const declText = weslBundleDecl + constDecl;\n const formatted = biome.formatContent(biomeKey, declText, {\n filePath: \"t.d.ts\",\n });\n\n const outPath = path.join(outDir, \"weslBundle.d.ts\");\n await fs.writeFile(outPath, formatted.content);\n}\n\n/** @return the bundle plus dependencies as a JavaScript string */\nfunction bundleToJsString(bundle: WeslBundle, dependencies: string[]): string {\n const { name, edition, modules } = bundle;\n const depsObj = dependencies.length ? { dependencies: 99 } : {};\n const obj = { name, edition, modules, ...depsObj };\n const jsonString = JSON.stringify(obj, null, 2);\n if (dependencies.length) {\n const dependenciesStr = `: [${dependencies.join(\", \")}]`;\n const result = jsonString.replace(\": 99\", dependenciesStr);\n return result;\n } else {\n return jsonString;\n }\n}\n\n/** Filter out self-dependencies from the dependency list */\nfunction filterSelfDeps(deps: string[], packageName: string): string[] {\n return deps.filter(\n dep => dep !== packageName && !dep.startsWith(`${packageName}/`),\n );\n}\n\ninterface PkgFields {\n name: string;\n}\n\n/** parse and extract fields from package.json that we care about\n * (the name of the package) */\nasync function loadPackageFields(pkgJsonPath: string): Promise<PkgFields> {\n const pkgJsonString = await fs.readFile(pkgJsonPath, { encoding: \"utf8\" });\n const pkgJson = JSON.parse(pkgJsonString);\n const { name } = pkgJson;\n verifyField(\"name\", name);\n\n function verifyField(field: string, value: any): void {\n if (value === undefined) {\n console.error(`no '${field}' field found in \"${pkgJsonPath}\"`);\n throw new Error(\"package.json incomplete\");\n }\n }\n return { name };\n}\n\n/** setup biome to use as a formatter */\nasync function setupBiome(): Promise<{ biome: Biome; projectKey: number }> {\n const biome = await Biome.create({\n distribution: Distribution.NODE,\n });\n const { projectKey } = biome.openProject();\n biome.applyConfiguration(projectKey, {\n formatter: {\n enabled: true,\n indentStyle: \"space\",\n lineEnding: \"lf\",\n expand: \"auto\",\n },\n });\n return { biome, projectKey };\n}\n","import { versionFromPackageJson } from \"wesl-tooling\";\nimport yargs from \"yargs\";\nimport { packageWgsl } from \"./PackageWesl.ts\";\n\nexport type CliArgs = Awaited<ReturnType<typeof parseArgs>>;\nlet cliArgs: CliArgs;\n\nexport async function packagerCli(rawArgs: string[]): Promise<void> {\n cliArgs = await parseArgs(rawArgs);\n await packageWgsl(cliArgs);\n}\n\nasync function parseArgs(args: string[]) {\n const projectDir = new URL(\"..\", import.meta.url).href;\n const appVersion = await versionFromPackageJson(projectDir);\n return yargs(args)\n .command(\"$0\", \"create an npm package from WGSL/WESL files\")\n .version(appVersion)\n .option(\"src\", {\n type: \"string\",\n describe:\n \"WGSL/WESL files to bundle in the package (glob syntax, defaults to wesl.toml or shaders/**/*.w[eg]sl)\",\n })\n .option(\"rootDir\", {\n deprecated: true,\n type: \"string\",\n describe: \"use --baseDir instead\",\n })\n .option(\"baseDir\", {\n deprecated: true,\n type: \"string\",\n describe: \"root directory for shaders (defaults to wesl.toml or shaders)\",\n })\n .option(\"projectDir\", {\n type: \"string\",\n default: \".\",\n describe: \"directory containing package.json and wesl.toml\",\n })\n .option(\"multiBundle\", {\n type: \"boolean\",\n default: false,\n describe: \"make a shader bundle for each source file\",\n })\n .option(\"exportName\", {\n type: \"string\",\n default: \".\",\n describe:\n \"package.json export name for consolidated bundle (ignored for multiBundle)\",\n })\n .option(\"updatePackageJson\", {\n type: \"boolean\",\n default: false,\n describe: \"add 'exports' entries into package.json\",\n })\n .option(\"outDir\", {\n type: \"string\",\n default: \"dist\",\n describe: \"where to put bundled output files (relative to projectDir)\",\n })\n .help()\n .parse();\n}\n","#!/usr/bin/env node\nimport { exit } from \"node:process\";\nimport { hideBin } from \"yargs/helpers\";\nimport { packagerCli } from \"./PackagerCli.ts\";\n\nconst rawArgs = hideBin(process.argv);\n\nconst [major] = process.versions.node.split(\".\").map(Number);\nif (major < 22) {\n console.error(\n `Please upgrade node to version 22 or higher. (The current node version is ${process.version})`,\n );\n exit(1);\n}\n\npackagerCli(rawArgs).catch(e => {\n console.error(e);\n exit(1);\n});\n"],"mappings":";;;;;;;;;;;;AAQA,MAAM,iBAAiB,MAAM,SAAS,IAAI,IAAI,kBAAkB,EAAE,OAAO;AAEzE,MAAM,EAAE,OAAO,YAAY,aAAa,MAAM,YAAY;;AAG1D,eAAsB,YAAY,MAA8B;CAC9D,MAAM,EAAE,YAAY,QAAQ,aAAa,SAAS,QAAQ;CAC1D,MAAM,UAAU,MAAM,YAAY,YAAY,SAAS,IAAI;CAE3D,MAAM,EAAE,SAAS,MAAM,kBADH,KAAK,KAAK,YAAY,eAAe,CACJ;CACrD,MAAM,UAAU;AAEhB,KAAI,KAAK,YACP,OAAM,iBAAiB,SAAS,MAAM,SAAS,YAAY,OAAO;MAC7D;EACL,MAAM,UAAU,kBAAkB,SAAS,WAAW;EACtD,MAAM,YAAY,oBAAoB,KAAK;EAC3C,MAAM,OAAO,eAAe,SAAS,UAAU;AAE/C,QAAM,cADqB;GAAE,MAAM;GAAW;GAAS;GAAS,EACpC,MAAM,OAAO;;AAE3C,OAAM,mBAAmB,OAAO;AAChC,KAAI,KAAK,kBACP,OAAM,kBAAkB,YAAY,QAAQ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AS;EACT,UACE;EACH,CAAC,CACD,OAAO,qBAAqB;EAC3B,MAAM;EACN,SAAS;EACT,UAAU;EACX,CAAC,CACD,OAAO,UAAU;EAChB,MAAM;EACN,SAAS;EACT,UAAU;EACX,CAAC,CACD,MAAM,CACN,OAAO;;;;;ACvDZ,MAAM,UAAU,QAAQ,QAAQ,KAAK;AAErC,MAAM,CAAC,SAAS,QAAQ,SAAS,KAAK,MAAM,IAAI,CAAC,IAAI,OAAO;AAC5D,IAAI,QAAQ,IAAI;AACd,SAAQ,MACN,6EAA6E,QAAQ,QAAQ,GAC9F;AACD,MAAK,EAAE;;AAGT,YAAY,QAAQ,CAAC,OAAM,MAAK;AAC9B,SAAQ,MAAM,EAAE;AAChB,MAAK,EAAE;EACP"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "wesl-packager",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "type": "module",
5
- "bin": "bin/wesl-packager",
5
+ "bin": "dist/main.mjs",
6
6
  "files": [
7
7
  "bin",
8
+ "dist",
8
9
  "src"
9
10
  ],
10
11
  "repository": "github:wgsl-tooling-wg/wesl-js",
@@ -12,8 +13,8 @@
12
13
  "@biomejs/js-api": "^1.0.0",
13
14
  "@biomejs/wasm-nodejs": "^2.0.6",
14
15
  "yargs": "^18.0.0",
15
- "wesl": "0.7.4",
16
- "wesl-tooling": "0.6.17"
16
+ "wesl": "0.7.6",
17
+ "wesl-tooling": "0.6.19"
17
18
  },
18
19
  "devDependencies": {
19
20
  "dependent_package": "x",
@@ -21,6 +22,7 @@
21
22
  "picocolors": "^1.1.1"
22
23
  },
23
24
  "scripts": {
25
+ "build": "tsdown",
24
26
  "test": "cross-env FORCE_COLOR=1 vitest",
25
27
  "test:once": "vitest run",
26
28
  "typecheck": "tsgo"