wesl-plugin 0.6.0-rc3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,8 @@ async function emitLinkJs(baseId, api) {
15
15
  const rootModuleName = noSuffix(rootModule);
16
16
  const tomlRelative = path.relative(tomlDir, resolvedWeslRoot);
17
17
  const debugWeslRoot = tomlRelative.replaceAll(path.sep, "/");
18
- const bundleImports = dependencies.map((p) => `import ${p} from "${p}";`).join("\n");
18
+ const sanitizedDeps = dependencies.map((dep) => dep.replaceAll("/", "_"));
19
+ const bundleImports = dependencies.map((p, i) => `import ${sanitizedDeps[i]} from "${p}";`).join("\n");
19
20
  const rootName = path.basename(rootModuleName);
20
21
  const paramsName = `link${rootName}Config`;
21
22
  const linkParams = {
@@ -23,7 +24,7 @@ async function emitLinkJs(baseId, api) {
23
24
  weslSrc,
24
25
  debugWeslRoot
25
26
  };
26
- const libsStr = `libs: [${dependencies.join(", ")}]`;
27
+ const libsStr = `libs: [${sanitizedDeps.join(", ")}]`;
27
28
  const linkParamsStr = `{
28
29
  ${serializeFields(linkParams)},
29
30
  ${libsStr},
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "wesl-plugin",
3
3
  "type": "module",
4
- "version": "0.6.0-rc3",
4
+ "version": "0.6.0",
5
5
  "dependencies": {
6
6
  "import-meta-resolve": "^4.1.0",
7
7
  "toml": "^3.0.0",
8
8
  "unplugin": "^2.2.0",
9
- "wesl": "0.6.0-rc3"
9
+ "wesl": "0.6.0"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@nuxt/kit": "^3.16.0",
package/src/WeslPlugin.ts CHANGED
@@ -3,20 +3,20 @@ import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import toml from "toml";
5
5
  import type {
6
- ExternalIdResult,
7
- Thenable,
8
- TransformResult,
9
- UnpluginBuildContext,
10
- UnpluginContext,
11
- UnpluginContextMeta,
12
- UnpluginOptions,
6
+ ExternalIdResult,
7
+ Thenable,
8
+ TransformResult,
9
+ UnpluginBuildContext,
10
+ UnpluginContext,
11
+ UnpluginContextMeta,
12
+ UnpluginOptions
13
13
  } from "unplugin";
14
14
  import { createUnplugin } from "unplugin";
15
15
  import {
16
- Conditions,
17
- parsedRegistry,
18
- ParsedRegistry,
19
- parseIntoRegistry,
16
+ Conditions,
17
+ parsedRegistry,
18
+ ParsedRegistry,
19
+ parseIntoRegistry
20
20
  } from "wesl";
21
21
  import { PluginExtension, PluginExtensionApi } from "./PluginExtension.js";
22
22
  import type { WeslPluginOptions } from "./WeslPluginOptions.js";
@@ -1,5 +1,6 @@
1
1
  /** @hidden */
2
2
  declare module "*?link" {
3
+ import { LinkParams } from "wesl";
3
4
  const linkParams: LinkParams;
4
5
  export default linkParams;
5
6
  }
@@ -16,4 +17,4 @@ declare module "*?bindingLayout" {
16
17
  string,
17
18
  (device: GPUDevice) => GPUBindGroupLayout
18
19
  >;
19
- }
20
+ }
@@ -23,8 +23,10 @@ async function emitLinkJs(
23
23
  const tomlRelative = path.relative(tomlDir, resolvedWeslRoot);
24
24
  const debugWeslRoot = tomlRelative.replaceAll(path.sep, "/");
25
25
 
26
+ const sanitizedDeps = dependencies.map(dep => dep.replaceAll("/", "_"));
27
+
26
28
  const bundleImports = dependencies
27
- .map(p => `import ${p} from "${p}";`)
29
+ .map((p, i) => `import ${sanitizedDeps[i]} from "${p}";`)
28
30
  .join("\n");
29
31
 
30
32
  const rootName = path.basename(rootModuleName);
@@ -36,7 +38,7 @@ async function emitLinkJs(
36
38
  debugWeslRoot,
37
39
  };
38
40
 
39
- const libsStr = `libs: [${dependencies.join(", ")}]`;
41
+ const libsStr = `libs: [${sanitizedDeps.join(", ")}]`;
40
42
  const linkParamsStr = `{
41
43
  ${serializeFields(linkParams)},
42
44
  ${libsStr},