@powerlines/plugin-napi-rs 0.2.193 → 0.2.195

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/dist/index.cjs CHANGED
@@ -36,6 +36,8 @@ const plugin = (options = {}) => {
36
36
  else this.config.napi.targets = require_types_targets.DEFAULT_TARGETS.map((target) => (0, _napi_rs_cli.parseTriple)(target));
37
37
  if (!this.config.napi.profile && this.additionalArgs.profile && ((0, _stryke_type_checks_is_string.isString)(this.additionalArgs.profile) || Array.isArray(this.additionalArgs.profile) && this.additionalArgs.profile.length > 0)) this.config.napi.profile = Array.isArray(this.additionalArgs.profile) && this.additionalArgs.profile.length > 0 ? this.additionalArgs.profile[0] : String(this.additionalArgs.profile);
38
38
  if (!this.config.napi.release && this.additionalArgs.release) this.config.napi.release = Boolean(this.additionalArgs.release);
39
+ if (!this.config.napi.crossCompile && this.additionalArgs.crossCompile) this.config.napi.crossCompile = Boolean(this.additionalArgs.crossCompile);
40
+ if (!this.config.napi.useNapiCross && this.additionalArgs.useNapiCross) this.config.napi.useNapiCross = Boolean(this.additionalArgs.useNapiCross);
39
41
  if (!this.config.napi.configPath && this.additionalArgs.configPath && ((0, _stryke_type_checks_is_string.isString)(this.additionalArgs.configPath) || Array.isArray(this.additionalArgs.configPath) && this.additionalArgs.configPath.length > 0)) this.config.napi.configPath = Array.isArray(this.additionalArgs.configPath) && this.additionalArgs.configPath.length > 0 ? this.additionalArgs.configPath[0] : String(this.additionalArgs.configPath);
40
42
  if (!this.config.napi.manifestPath && this.additionalArgs.manifestPath && ((0, _stryke_type_checks_is_string.isString)(this.additionalArgs.manifestPath) || Array.isArray(this.additionalArgs.manifestPath) && this.additionalArgs.manifestPath.length > 0)) this.config.napi.manifestPath = Array.isArray(this.additionalArgs.manifestPath) && this.additionalArgs.manifestPath.length > 0 ? this.additionalArgs.manifestPath[0] : String(this.additionalArgs.manifestPath);
41
43
  if (!this.config.napi.npmDir && this.additionalArgs.npmDir && ((0, _stryke_type_checks_is_string.isString)(this.additionalArgs.npmDir) || Array.isArray(this.additionalArgs.npmDir) && this.additionalArgs.npmDir.length > 0)) this.config.napi.npmDir = Array.isArray(this.additionalArgs.npmDir) && this.additionalArgs.npmDir.length > 0 ? this.additionalArgs.npmDir[0] : String(this.additionalArgs.npmDir);
@@ -43,7 +45,7 @@ const plugin = (options = {}) => {
43
45
  if (this.additionalArgs.packageJsonPath && ((0, _stryke_type_checks_is_string.isString)(this.additionalArgs.packageJsonPath) || Array.isArray(this.additionalArgs.packageJsonPath) && this.additionalArgs.packageJsonPath.length > 0)) this.config.napi.packageJsonPath = Array.isArray(this.additionalArgs.packageJsonPath) && this.additionalArgs.packageJsonPath.length > 0 ? this.additionalArgs.packageJsonPath[0] : String(this.additionalArgs.packageJsonPath);
44
46
  if (!this.config.napi.packageJsonPath) this.config.napi.packageJsonPath = (0, _stryke_path_join.joinPaths)(this.config.root, "package.json");
45
47
  }
46
- if (this.config.napi.target?.platform === "wasm") this.dependencies["@napi-rs/wasm-runtime"] = "^1.1.4";
48
+ if (this.config.napi.target?.arch === "wasm32") this.dependencies["@napi-rs/wasm-runtime"] = "^1.1.4";
47
49
  let packageJson = {};
48
50
  let originalPackageJson = {};
49
51
  if (this.fs.existsSync(this.config.napi.packageJsonPath)) packageJson = JSON.parse(await this.fs.read(this.config.napi.packageJsonPath) || "{}");
@@ -57,19 +59,23 @@ const plugin = (options = {}) => {
57
59
  dtsHeader: this.config.napi.dtsHeader,
58
60
  dtsHeaderFile: this.config.napi.dtsHeaderFile,
59
61
  ...packageJson.napi,
60
- wasm: this.config.napi.target?.platform === "wasm" ? (0, defu.defu)(packageJson.napi?.wasm ?? {}, this.config.napi.wasm ?? {}, { initialMemory: 16384 }) : void 0
62
+ wasm: this.config.napi.target?.arch === "wasm32" ? (0, defu.defu)(packageJson.napi?.wasm ?? {}, this.config.napi.wasm ?? {}, { initialMemory: 16384 }) : void 0
61
63
  };
62
64
  if (JSON.stringify(packageJson) !== JSON.stringify(originalPackageJson)) await this.fs.write(this.config.napi.packageJsonPath, JSON.stringify(packageJson, null, 2));
63
65
  },
64
66
  async prepare() {
65
67
  this.debug(`Preparing the N-API Rust runtime artifacts for the Powerlines project.`);
66
68
  this.napi = new _napi_rs_cli.NapiCli();
67
- if (this.config.napi.npmDir) await this.napi.createNpmDirs({
68
- cwd: (0, _stryke_path_append.appendPath)(this.config.root, this.config.cwd),
69
- npmDir: require_helpers_format_path.formatPath(this, this.config.napi.npmDir),
70
- configPath: require_helpers_format_path.formatPath(this, this.config.napi.configPath),
71
- packageJsonPath: require_helpers_format_path.formatPath(this, this.config.napi.packageJsonPath)
72
- });
69
+ const npmDir = require_helpers_format_path.formatPath(this, this.config.napi.npmDir);
70
+ if (npmDir) {
71
+ if (this.fs.existsSync(npmDir)) await this.fs.remove(npmDir);
72
+ await this.napi.createNpmDirs({
73
+ cwd: (0, _stryke_path_append.appendPath)(this.config.root, this.config.cwd),
74
+ npmDir,
75
+ configPath: require_helpers_format_path.formatPath(this, this.config.napi.configPath),
76
+ packageJsonPath: require_helpers_format_path.formatPath(this, this.config.napi.packageJsonPath)
77
+ });
78
+ }
73
79
  },
74
80
  async build() {
75
81
  this.debug(`Building the N-API Rust runtime artifacts for the Powerlines project.`);
@@ -91,6 +97,8 @@ const plugin = (options = {}) => {
91
97
  jsBinding: this.config.napi.jsBinding,
92
98
  dts: this.config.napi.dts,
93
99
  dtsCache: this.config.napi.dtsCache ?? !this.config.skipCache,
100
+ crossCompile: this.config.napi.crossCompile,
101
+ useNapiCross: this.config.napi.useNapiCross,
94
102
  verbose: (0, powerlines_plugin_utils.isVerbose)(this)
95
103
  });
96
104
  const outputs = await task;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YAkCY,MAAA;IACR,IAAA,GAAO,iBAAiB;EAAA;AAAA;;;;;;cASf,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KA6OJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YAkCY,MAAA;IACR,IAAA,GAAO,iBAAiB;EAAA;AAAA;;;;;;cASf,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAsQJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -35,6 +35,8 @@ const plugin = (options = {}) => {
35
35
  else this.config.napi.targets = DEFAULT_TARGETS.map((target) => parseTriple(target));
36
36
  if (!this.config.napi.profile && this.additionalArgs.profile && (isString(this.additionalArgs.profile) || Array.isArray(this.additionalArgs.profile) && this.additionalArgs.profile.length > 0)) this.config.napi.profile = Array.isArray(this.additionalArgs.profile) && this.additionalArgs.profile.length > 0 ? this.additionalArgs.profile[0] : String(this.additionalArgs.profile);
37
37
  if (!this.config.napi.release && this.additionalArgs.release) this.config.napi.release = Boolean(this.additionalArgs.release);
38
+ if (!this.config.napi.crossCompile && this.additionalArgs.crossCompile) this.config.napi.crossCompile = Boolean(this.additionalArgs.crossCompile);
39
+ if (!this.config.napi.useNapiCross && this.additionalArgs.useNapiCross) this.config.napi.useNapiCross = Boolean(this.additionalArgs.useNapiCross);
38
40
  if (!this.config.napi.configPath && this.additionalArgs.configPath && (isString(this.additionalArgs.configPath) || Array.isArray(this.additionalArgs.configPath) && this.additionalArgs.configPath.length > 0)) this.config.napi.configPath = Array.isArray(this.additionalArgs.configPath) && this.additionalArgs.configPath.length > 0 ? this.additionalArgs.configPath[0] : String(this.additionalArgs.configPath);
39
41
  if (!this.config.napi.manifestPath && this.additionalArgs.manifestPath && (isString(this.additionalArgs.manifestPath) || Array.isArray(this.additionalArgs.manifestPath) && this.additionalArgs.manifestPath.length > 0)) this.config.napi.manifestPath = Array.isArray(this.additionalArgs.manifestPath) && this.additionalArgs.manifestPath.length > 0 ? this.additionalArgs.manifestPath[0] : String(this.additionalArgs.manifestPath);
40
42
  if (!this.config.napi.npmDir && this.additionalArgs.npmDir && (isString(this.additionalArgs.npmDir) || Array.isArray(this.additionalArgs.npmDir) && this.additionalArgs.npmDir.length > 0)) this.config.napi.npmDir = Array.isArray(this.additionalArgs.npmDir) && this.additionalArgs.npmDir.length > 0 ? this.additionalArgs.npmDir[0] : String(this.additionalArgs.npmDir);
@@ -42,7 +44,7 @@ const plugin = (options = {}) => {
42
44
  if (this.additionalArgs.packageJsonPath && (isString(this.additionalArgs.packageJsonPath) || Array.isArray(this.additionalArgs.packageJsonPath) && this.additionalArgs.packageJsonPath.length > 0)) this.config.napi.packageJsonPath = Array.isArray(this.additionalArgs.packageJsonPath) && this.additionalArgs.packageJsonPath.length > 0 ? this.additionalArgs.packageJsonPath[0] : String(this.additionalArgs.packageJsonPath);
43
45
  if (!this.config.napi.packageJsonPath) this.config.napi.packageJsonPath = joinPaths(this.config.root, "package.json");
44
46
  }
45
- if (this.config.napi.target?.platform === "wasm") this.dependencies["@napi-rs/wasm-runtime"] = "^1.1.4";
47
+ if (this.config.napi.target?.arch === "wasm32") this.dependencies["@napi-rs/wasm-runtime"] = "^1.1.4";
46
48
  let packageJson = {};
47
49
  let originalPackageJson = {};
48
50
  if (this.fs.existsSync(this.config.napi.packageJsonPath)) packageJson = JSON.parse(await this.fs.read(this.config.napi.packageJsonPath) || "{}");
@@ -56,19 +58,23 @@ const plugin = (options = {}) => {
56
58
  dtsHeader: this.config.napi.dtsHeader,
57
59
  dtsHeaderFile: this.config.napi.dtsHeaderFile,
58
60
  ...packageJson.napi,
59
- wasm: this.config.napi.target?.platform === "wasm" ? defu(packageJson.napi?.wasm ?? {}, this.config.napi.wasm ?? {}, { initialMemory: 16384 }) : void 0
61
+ wasm: this.config.napi.target?.arch === "wasm32" ? defu(packageJson.napi?.wasm ?? {}, this.config.napi.wasm ?? {}, { initialMemory: 16384 }) : void 0
60
62
  };
61
63
  if (JSON.stringify(packageJson) !== JSON.stringify(originalPackageJson)) await this.fs.write(this.config.napi.packageJsonPath, JSON.stringify(packageJson, null, 2));
62
64
  },
63
65
  async prepare() {
64
66
  this.debug(`Preparing the N-API Rust runtime artifacts for the Powerlines project.`);
65
67
  this.napi = new NapiCli();
66
- if (this.config.napi.npmDir) await this.napi.createNpmDirs({
67
- cwd: appendPath(this.config.root, this.config.cwd),
68
- npmDir: formatPath(this, this.config.napi.npmDir),
69
- configPath: formatPath(this, this.config.napi.configPath),
70
- packageJsonPath: formatPath(this, this.config.napi.packageJsonPath)
71
- });
68
+ const npmDir = formatPath(this, this.config.napi.npmDir);
69
+ if (npmDir) {
70
+ if (this.fs.existsSync(npmDir)) await this.fs.remove(npmDir);
71
+ await this.napi.createNpmDirs({
72
+ cwd: appendPath(this.config.root, this.config.cwd),
73
+ npmDir,
74
+ configPath: formatPath(this, this.config.napi.configPath),
75
+ packageJsonPath: formatPath(this, this.config.napi.packageJsonPath)
76
+ });
77
+ }
72
78
  },
73
79
  async build() {
74
80
  this.debug(`Building the N-API Rust runtime artifacts for the Powerlines project.`);
@@ -90,6 +96,8 @@ const plugin = (options = {}) => {
90
96
  jsBinding: this.config.napi.jsBinding,
91
97
  dts: this.config.napi.dts,
92
98
  dtsCache: this.config.napi.dtsCache ?? !this.config.skipCache,
99
+ crossCompile: this.config.napi.crossCompile,
100
+ useNapiCross: this.config.napi.useNapiCross,
93
101
  verbose: isVerbose(this)
94
102
  });
95
103
  const outputs = await task;
@@ -2,7 +2,7 @@
2
2
  declare const AVAILABLE_TARGETS: readonly ["aarch64-apple-darwin", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", "aarch64-unknown-linux-ohos", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-linux-ohos", "x86_64-unknown-freebsd", "i686-pc-windows-msvc", "armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-musleabihf", "armv7-linux-androideabi", "universal-apple-darwin", "loongarch64-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "wasm32-wasi-preview1-threads", "wasm32-wasip1-threads"];
3
3
  type TargetTriple = (typeof AVAILABLE_TARGETS)[number];
4
4
  declare const DEFAULT_TARGETS: readonly ["x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"];
5
- type Platform = NodeJS.Platform | "wasm" | "wasi" | "openharmony";
5
+ type Platform = NodeJS.Platform | "wasm" | "wasi" | "wasip1" | "openharmony";
6
6
  type NodeJSArch = "arm" | "arm64" | "ia32" | "loong64" | "mips" | "mipsel" | "ppc" | "ppc64" | "riscv64" | "s390" | "s390x" | "x32" | "x64" | "universal" | "wasm32";
7
7
  interface Target {
8
8
  triple: string;
@@ -1 +1 @@
1
- {"version":3,"file":"targets.d.cts","names":[],"sources":["../../src/types/targets.ts"],"mappings":";cAkBa,iBAAA;AAAA,KA2BD,YAAA,WAAuB,iBAAiB;AAAA,cAEvC,eAAA;AAAA,KAOD,QAAA,GAAW,MAAA,CAAO,QAAQ;AAAA,KAGjC,UAAA;AAAA,UAiBY,MAAA;EACf,MAAA;EACA,eAAA;EACA,QAAA,EAAU,QAAA;EACV,IAAA,EAAM,UAAU;EAChB,GAAA;AAAA"}
1
+ {"version":3,"file":"targets.d.cts","names":[],"sources":["../../src/types/targets.ts"],"mappings":";cAkBa,iBAAA;AAAA,KA2BD,YAAA,WAAuB,iBAAiB;AAAA,cAEvC,eAAA;AAAA,KAOD,QAAA,GACV,MAAA,CAAO,QAAQ;AAAA,KAGZ,UAAA;AAAA,UAiBY,MAAA;EACf,MAAA;EACA,eAAA;EACA,QAAA,EAAU,QAAA;EACV,IAAA,EAAM,UAAU;EAChB,GAAA;AAAA"}
@@ -2,7 +2,7 @@
2
2
  declare const AVAILABLE_TARGETS: readonly ["aarch64-apple-darwin", "aarch64-linux-android", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", "aarch64-unknown-linux-ohos", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-pc-windows-gnu", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-linux-ohos", "x86_64-unknown-freebsd", "i686-pc-windows-msvc", "armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-musleabihf", "armv7-linux-androideabi", "universal-apple-darwin", "loongarch64-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "wasm32-wasi-preview1-threads", "wasm32-wasip1-threads"];
3
3
  type TargetTriple = (typeof AVAILABLE_TARGETS)[number];
4
4
  declare const DEFAULT_TARGETS: readonly ["x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"];
5
- type Platform = NodeJS.Platform | "wasm" | "wasi" | "openharmony";
5
+ type Platform = NodeJS.Platform | "wasm" | "wasi" | "wasip1" | "openharmony";
6
6
  type NodeJSArch = "arm" | "arm64" | "ia32" | "loong64" | "mips" | "mipsel" | "ppc" | "ppc64" | "riscv64" | "s390" | "s390x" | "x32" | "x64" | "universal" | "wasm32";
7
7
  interface Target {
8
8
  triple: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-napi-rs",
3
- "version": "0.2.193",
3
+ "version": "0.2.195",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin for integrating with N-API Rust modules.",
6
6
  "keywords": ["napi-rs", "powerlines", "storm-software", "powerlines-plugin"],
@@ -137,25 +137,25 @@
137
137
  "@alloy-js/markdown": "^0.23.0",
138
138
  "@alloy-js/typescript": "^0.23.0",
139
139
  "@napi-rs/cli": "^3.7.2",
140
- "@powerlines/plugin-alloy": "^0.26.233",
141
- "@powerlines/plugin-automd": "^0.1.601",
142
- "@powerlines/plugin-plugin": "^0.12.552",
143
- "@stryke/convert": "^0.7.25",
144
- "@stryke/fs": "^0.33.95",
145
- "@stryke/path": "^0.29.21",
146
- "@stryke/string-format": "^0.17.36",
147
- "@stryke/type-checks": "^0.6.27",
148
- "@stryke/types": "^0.12.22",
140
+ "@powerlines/plugin-alloy": "0.26.235",
141
+ "@powerlines/plugin-automd": "0.1.603",
142
+ "@powerlines/plugin-plugin": "0.12.554",
143
+ "@stryke/convert": "^0.7.26",
144
+ "@stryke/fs": "^0.33.96",
145
+ "@stryke/path": "^0.29.22",
146
+ "@stryke/string-format": "^0.17.37",
147
+ "@stryke/type-checks": "^0.6.28",
148
+ "@stryke/types": "^0.12.23",
149
149
  "automd": "^0.4.3",
150
150
  "defu": "^6.1.7",
151
- "powerlines": "^0.47.140"
151
+ "powerlines": "0.47.142"
152
152
  },
153
153
  "devDependencies": {
154
- "@napi-rs/wasm-runtime": ">=1.1.4",
154
+ "@napi-rs/wasm-runtime": "^1.1.6",
155
155
  "@types/node": "^25.9.4"
156
156
  },
157
157
  "peerDependencies": { "@napi-rs/wasm-runtime": ">=1.1.4" },
158
158
  "peerDependenciesMeta": { "@napi-rs/wasm-runtime": { "optional": true } },
159
159
  "publishConfig": { "access": "public" },
160
- "gitHead": "620d5b7c51f4d8b58e79ec602b222311439e7f33"
160
+ "gitHead": "237e375dd938a17d2d363344b4d2c38c0173a76e"
161
161
  }