@powerlines/plugin-napi-rs 0.1.0 → 0.1.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/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/plugin.d.cts +8 -8
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +8 -8
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -29,7 +29,7 @@ const plugin = (options = {}) => {
|
|
|
29
29
|
},
|
|
30
30
|
configResolved() {
|
|
31
31
|
this.config.napi.targets = this.config.napi.targets?.map((target) => typeof target === "string" ? (0, _napi_rs_cli.parseTriple)(target) : target);
|
|
32
|
-
if (this.config.napi.targets.some((target) => target.
|
|
32
|
+
if (this.config.napi.targets.some((target) => target.platform === "wasm")) this.dependencies["@napi-rs/wasm-runtime"] = "^1.1.4";
|
|
33
33
|
},
|
|
34
34
|
async prepare() {
|
|
35
35
|
this.debug(`Preparing the N-API Rust runtime artifacts for the Powerlines project.`);
|
|
@@ -47,7 +47,7 @@ const plugin = (options = {}) => {
|
|
|
47
47
|
manifestPath: this.config.napi.manifestPath ? (0, _stryke_path_file_path_fns.relativePath)(cwd, (0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(this.config.napi.manifestPath, this.config.root), this.config.cwd)) : void 0,
|
|
48
48
|
target: target.triple,
|
|
49
49
|
profile: this.config.napi.profile,
|
|
50
|
-
release: this.config.napi.release,
|
|
50
|
+
release: this.config.napi.release ?? this.config.mode === "production",
|
|
51
51
|
features: this.config.napi.features,
|
|
52
52
|
noDefaultFeatures: this.config.napi.noDefaultFeatures,
|
|
53
53
|
strip: this.config.napi.strip,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AVAILABLE_TARGETS, DEFAULT_TARGETS, Platform, Target, TargetTriple } from "./types/targets.cjs";
|
|
2
2
|
import { WasmBrowserOptions, WasmOptions } from "./types/wasm.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions } from "./types/plugin.cjs";
|
|
4
4
|
import { Plugin } from "powerlines";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
7
|
declare module "powerlines" {
|
|
8
8
|
interface Config {
|
|
9
|
-
napi?:
|
|
9
|
+
napi?: NapiPluginOptions;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ declare module "powerlines" {
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://napi.rs/docs
|
|
16
16
|
*/
|
|
17
|
-
declare const plugin: <TContext extends
|
|
17
|
+
declare const plugin: <TContext extends NapiPluginContext = NapiPluginContext>(options?: NapiPluginOptions) => Plugin<TContext>[];
|
|
18
18
|
//#endregion
|
|
19
|
-
export { AVAILABLE_TARGETS, DEFAULT_TARGETS,
|
|
19
|
+
export { AVAILABLE_TARGETS, DEFAULT_TARGETS, NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions, Platform, Target, TargetTriple, WasmBrowserOptions, WasmOptions, plugin as default, plugin };
|
|
20
20
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YA6BY,MAAA;IACR,IAAA,GAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YA6BY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;;;;;;cASE,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KA0GJ,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AVAILABLE_TARGETS, DEFAULT_TARGETS, Platform, Target, TargetTriple } from "./types/targets.mjs";
|
|
2
2
|
import { WasmBrowserOptions, WasmOptions } from "./types/wasm.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions } from "./types/plugin.mjs";
|
|
4
4
|
import { Plugin } from "powerlines";
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
7
|
declare module "powerlines" {
|
|
8
8
|
interface Config {
|
|
9
|
-
napi?:
|
|
9
|
+
napi?: NapiPluginOptions;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -14,7 +14,7 @@ declare module "powerlines" {
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://napi.rs/docs
|
|
16
16
|
*/
|
|
17
|
-
declare const plugin: <TContext extends
|
|
17
|
+
declare const plugin: <TContext extends NapiPluginContext = NapiPluginContext>(options?: NapiPluginOptions) => Plugin<TContext>[];
|
|
18
18
|
//#endregion
|
|
19
|
-
export { AVAILABLE_TARGETS, DEFAULT_TARGETS,
|
|
19
|
+
export { AVAILABLE_TARGETS, DEFAULT_TARGETS, NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions, Platform, Target, TargetTriple, WasmBrowserOptions, WasmOptions, plugin as default, plugin };
|
|
20
20
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YA6BY,MAAA;IACR,IAAA,GAAO,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YA6BY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;;;;;;cASE,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KA0GJ,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -26,7 +26,7 @@ const plugin = (options = {}) => {
|
|
|
26
26
|
},
|
|
27
27
|
configResolved() {
|
|
28
28
|
this.config.napi.targets = this.config.napi.targets?.map((target) => typeof target === "string" ? parseTriple(target) : target);
|
|
29
|
-
if (this.config.napi.targets.some((target) => target.
|
|
29
|
+
if (this.config.napi.targets.some((target) => target.platform === "wasm")) this.dependencies["@napi-rs/wasm-runtime"] = "^1.1.4";
|
|
30
30
|
},
|
|
31
31
|
async prepare() {
|
|
32
32
|
this.debug(`Preparing the N-API Rust runtime artifacts for the Powerlines project.`);
|
|
@@ -44,7 +44,7 @@ const plugin = (options = {}) => {
|
|
|
44
44
|
manifestPath: this.config.napi.manifestPath ? relativePath(cwd, appendPath(appendPath(this.config.napi.manifestPath, this.config.root), this.config.cwd)) : void 0,
|
|
45
45
|
target: target.triple,
|
|
46
46
|
profile: this.config.napi.profile,
|
|
47
|
-
release: this.config.napi.release,
|
|
47
|
+
release: this.config.napi.release ?? this.config.mode === "production",
|
|
48
48
|
features: this.config.napi.features,
|
|
49
49
|
noDefaultFeatures: this.config.napi.noDefaultFeatures,
|
|
50
50
|
strip: this.config.napi.strip,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { NapiCli, parseTriple } from \"@napi-rs/cli\";\nimport alloy from \"@powerlines/plugin-alloy\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { Plugin } from \"powerlines\";\nimport type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { NapiCli, parseTriple } from \"@napi-rs/cli\";\nimport alloy from \"@powerlines/plugin-alloy\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { Plugin } from \"powerlines\";\nimport type { NapiPluginContext, NapiPluginOptions } from \"./types/plugin\";\nimport { DEFAULT_TARGETS, Target } from \"./types/targets\";\n\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n napi?: NapiPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin for integrating with N-API Rust modules, providing features such as automatic generation of bindings and runtime integration with N-API Rust modules.\n *\n * @see https://napi.rs/docs\n */\nexport const plugin = <TContext extends NapiPluginContext = NapiPluginContext>(\n options: NapiPluginOptions = {}\n) => {\n return [\n alloy(),\n {\n name: \"napi-rs\",\n config() {\n return {\n napi: {\n targets: DEFAULT_TARGETS,\n dts: \"binding.d.ts\",\n jsBinding: \"binding.js\",\n outputDir: this.config.root,\n platform: true,\n strip: false,\n ...options\n }\n };\n },\n configResolved() {\n this.config.napi.targets = this.config.napi.targets?.map(target =>\n typeof target === \"string\" ? parseTriple(target) : target\n );\n if (\n this.config.napi.targets.some(\n (target: Target) => target.platform === \"wasm\"\n )\n ) {\n this.dependencies[\"@napi-rs/wasm-runtime\"] = \"^1.1.4\";\n }\n },\n async prepare() {\n this.debug(\n `Preparing the N-API Rust runtime artifacts for the Powerlines project.`\n );\n },\n async build() {\n this.debug(\n `Preparing the N-API Rust runtime artifacts for the Powerlines project.`\n );\n\n const cwd = appendPath(this.config.root, this.config.cwd);\n const cli = new NapiCli();\n await Promise.all(\n this.config.napi?.targets?.map(async (target: Target) => {\n this.debug(\n `Configured target: ${target.triple} (platform: ${target.platform}, arch: ${target.arch}, abi: ${target.abi})`\n );\n\n const { task } = await cli.build({\n cwd,\n outputDir: relativePath(\n cwd,\n appendPath(\n appendPath(this.config.napi.outputDir, this.config.root),\n this.config.cwd\n )\n ),\n configPath: this.config.napi.configPath\n ? relativePath(\n cwd,\n appendPath(\n appendPath(this.config.napi.configPath, this.config.root),\n this.config.cwd\n )\n )\n : undefined,\n manifestPath: this.config.napi.manifestPath\n ? relativePath(\n cwd,\n appendPath(\n appendPath(\n this.config.napi.manifestPath,\n this.config.root\n ),\n this.config.cwd\n )\n )\n : undefined,\n target: target.triple,\n profile: this.config.napi.profile,\n release:\n this.config.napi.release ?? this.config.mode === \"production\",\n features: this.config.napi.features,\n noDefaultFeatures: this.config.napi.noDefaultFeatures,\n strip: this.config.napi.strip,\n platform: this.config.napi.platform,\n noDtsHeader: this.config.napi.noDtsHeader,\n jsBinding: this.config.napi.jsBinding,\n dts: this.config.napi.dts,\n dtsCache: this.config.napi.dtsCache ?? !this.config.skipCache\n });\n\n const outputs = await task;\n for (const output of outputs) {\n if (output.kind !== \"node\") {\n const code = await this.fs.read(output.path);\n if (code) {\n await this.fs.write(output.path, code);\n }\n }\n }\n })\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA6BA,MAAY,UAAO,UAAA,EAAA,KAAA;AACjB,QAAO,CAAC,OAAC,EAAA;EACT,MAAA;EACF,SAAA;YAEE,MAAA;IACG,SAAW;IACf,KAAA;IACO,WAAa;IACnB,WAAA,KAAA,OAAA;IACK,UAAa;IACV,OAAC;IACN,GAAA;IACI,EACL;;EAEA,iBAAiB;AACf,QAAA,OAAS,KAAA,UAAA,KAAA,OAAA,KAAA,SAAA,KAAA,WAAA,OAAA,WAAA,WAAA,YAAA,OAAA,GAAA,OAAA;AACT,OAAE,KAAO,OAAA,KAAA,QAAA,MAAA,WAAA,OAAA,aAAA,OAAA,CACP,MAAE,aAAM,2BAAA;;EAGZ,MAAM,UAAE;AACN,QAAK,MAAC,yEAA2B;;EAEnC,MAAM,QAAQ;AACZ,QAAK,MAAI,yEAAA;GACT,MAAI,MAAA,WAAA,KAAA,OAAA,MAAA,KAAA,OAAA,IAAA;GACJ,MAAG,MAAA,IAAA,SAAA;AACH,SAAC,QAAA,IAAA,KAAA,OAAA,MAAA,SAAA,IAAA,OAAA,WAAA;AACD,SAAA,MAAA,sBAAiB,OAAA,OAAA,cAAA,OAAA,SAAA,UAAA,OAAA,KAAA,SAAA,OAAA,IAAA,GAAA;IACf,MAAK,EACH,SACD,MAAA,IAAA,MAAA;KACC;KACA,WAAW,aAAa,KAAK,WAAA,WAAA,KAAA,OAAA,KAAA,WAAA,KAAA,OAAA,KAAA,EAAA,KAAA,OAAA,IAAA,CAAA;KAC7B,YAAW,KAAM,OAAK,KAAO,aAAa,aAAK,KAAA,WAAA,WAAA,KAAA,OAAA,KAAA,YAAA,KAAA,OAAA,KAAA,EAAA,KAAA,OAAA,IAAA,CAAA,GAAA;KAC/C,cAAA,KAAA,OAAA,KAAA,eAAA,aAAA,KAAA,WAAA,WAAA,KAAA,OAAA,KAAA,cAAA,KAAA,OAAA,KAAA,EAAA,KAAA,OAAA,IAAA,CAAA,GAAA;KACA,QAAA,OAAA;KACA,SAAK,KAAA,OAAe,KAAK;KAC3B,SAAA,KAAA,OAAA,KAAA,WAAA,KAAA,OAAA,SAAA;KACD,UAAA,KAAA,OAAA,KAAA;KACD,mBAAgB,KAAA,OAAA,KAAA;KACd,OAAK,KAAK,OAAA,KAAA;KACR,UAAU,KAAK,OAAM,KAAK;KAC3B,aAAA,KAAA,OAAA,KAAA;KACF,WAAA,KAAA,OAAA,KAAA;KACD,KAAM,KAAQ,OAAA,KAAA;KACZ,UAAU,KAAA,OAAA,KAAA,YAAA,CAAA,KAAA,OAAA;KACT,CAAC;IACF,MAAC,UAAA,MAAA;iCAED,KAAM,OAAM,SAAU,QAAM;KAC5B,MAAU,OAAM,MAAO,KAAE,GAAA,KAAA,OAAA,KAAA;AACzB,SAAM,KACA,OAAC,KAAO,GAAM,MAAA,OAAa,MAAM,KAAC;;;;EAM7C,CAAC"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AVAILABLE_TARGETS, DEFAULT_TARGETS, Platform, Target, TargetTriple } from "./targets.cjs";
|
|
2
2
|
import { WasmBrowserOptions, WasmOptions } from "./wasm.cjs";
|
|
3
|
-
import {
|
|
4
|
-
export { AVAILABLE_TARGETS, DEFAULT_TARGETS,
|
|
3
|
+
import { NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions } from "./plugin.cjs";
|
|
4
|
+
export { AVAILABLE_TARGETS, DEFAULT_TARGETS, NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions, Platform, Target, TargetTriple, WasmBrowserOptions, WasmOptions };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AVAILABLE_TARGETS, DEFAULT_TARGETS, Platform, Target, TargetTriple } from "./targets.mjs";
|
|
2
2
|
import { WasmBrowserOptions, WasmOptions } from "./wasm.mjs";
|
|
3
|
-
import {
|
|
4
|
-
export { AVAILABLE_TARGETS, DEFAULT_TARGETS,
|
|
3
|
+
import { NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions } from "./plugin.mjs";
|
|
4
|
+
export { AVAILABLE_TARGETS, DEFAULT_TARGETS, NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions, Platform, Target, TargetTriple, WasmBrowserOptions, WasmOptions };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -13,7 +13,7 @@ import { RequiredKeys } from "@stryke/types/base";
|
|
|
13
13
|
*
|
|
14
14
|
* @see https://napi.rs/docs/cli/build#options
|
|
15
15
|
*/
|
|
16
|
-
interface
|
|
16
|
+
interface NapiPluginOptions {
|
|
17
17
|
/**
|
|
18
18
|
* Build only the specified binary
|
|
19
19
|
*/
|
|
@@ -125,19 +125,19 @@ interface NapiRsPluginOptions {
|
|
|
125
125
|
*/
|
|
126
126
|
useNapiCross?: boolean;
|
|
127
127
|
}
|
|
128
|
-
type
|
|
129
|
-
napi:
|
|
128
|
+
type NapiPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
|
|
129
|
+
napi: NapiPluginOptions;
|
|
130
130
|
};
|
|
131
|
-
type
|
|
131
|
+
type NapiResolvedPluginOptions = RequiredKeys<Omit<NapiPluginOptions, "targets">, "dts" | "jsBinding" | "manifestPath" | "outputDir" | "platform"> & {
|
|
132
132
|
/**
|
|
133
133
|
* The resolved target triples to build for, with additional metadata such as platform, architecture, and ABI information. These are derived from the `targets` option, and are used internally by the plugin to determine how to build the N-API Rust module for each target.
|
|
134
134
|
*/
|
|
135
135
|
targets: Target[];
|
|
136
136
|
};
|
|
137
|
-
type
|
|
138
|
-
napi:
|
|
137
|
+
type NapiPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
|
|
138
|
+
napi: NapiResolvedPluginOptions;
|
|
139
139
|
};
|
|
140
|
-
interface
|
|
140
|
+
interface NapiPluginContext<TResolvedConfig extends NapiPluginResolvedConfig = NapiPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {}
|
|
141
141
|
//#endregion
|
|
142
|
-
export {
|
|
142
|
+
export { NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions };
|
|
143
143
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;AAwCA;;;;;;UAAiB,
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;AAwCA;;;;;;UAAiB,iBAAA;EAkCC;;;EA9BhB,UAAA;EAUA;;;EALA,WAAA;EAeA;;;EAVA,OAAA,IAAW,YAAA,GAAe,MAAA;EAoBf;;;EAfX,OAAA;EA2CA;;;EAtCA,IAAA,GAAO,WAAA;EA0DP;;;EArDA,OAAA;EA2EA;;;EAtEA,QAAA,GAAW,KAAA;EA0FX;;;EArFA,WAAA;EA+FY;AAGd;;;;EA3FE,iBAAA;EA6FQ;;;;;EAtFR,SAAA;EAsFQ;;;AAGV;;;;EAhFE,GAAA;EAgFsC;;;EA3EtC,YAAA;EA2EsC;;;EAtEtC,UAAA;EA6ES;;;EAxET,SAAA;EA2EkC;;;EAtElC,SAAA;EAwEQ;;;;;EAjER,QAAA;EAiEQ;;;EA5DR,SAAA;EA+DgC;;;EA1DhC,WAAA;EA8DqB;;;EAzDrB,SAAA;EA0DoB;;;EArDpB,WAAA;EAiDmD;;;EA5CnD,QAAA;EAgDqB;;;EA3CrB,KAAA;;;;EAKA,YAAA;;;;EAKA,QAAA;;;;EAKA,YAAA;AAAA;AAAA,KAGU,oBAAA,GAAuB,qBAAA,GACjC,qBAAA;EACE,IAAA,EAAM,iBAAA;AAAA;AAAA,KAGE,yBAAA,GAA4B,YAAA,CACtC,IAAA,CAAK,iBAAA;;;;EAML,OAAA,EAAS,MAAA;AAAA;AAAA,KAGC,wBAAA,GAA2B,yBAAA,GACrC,yBAAA;EACE,IAAA,EAAM,yBAAA;AAAA;AAAA,UAGO,iBAAA,yBACS,wBAAA,GAA2B,wBAAA,UAGjD,kBAAA,CAAmB,eAAA,GACnB,kBAAA,CAAmB,eAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import { RequiredKeys } from "@stryke/types/base";
|
|
|
13
13
|
*
|
|
14
14
|
* @see https://napi.rs/docs/cli/build#options
|
|
15
15
|
*/
|
|
16
|
-
interface
|
|
16
|
+
interface NapiPluginOptions {
|
|
17
17
|
/**
|
|
18
18
|
* Build only the specified binary
|
|
19
19
|
*/
|
|
@@ -125,19 +125,19 @@ interface NapiRsPluginOptions {
|
|
|
125
125
|
*/
|
|
126
126
|
useNapiCross?: boolean;
|
|
127
127
|
}
|
|
128
|
-
type
|
|
129
|
-
napi:
|
|
128
|
+
type NapiPluginUserConfig = BabelPluginUserConfig & AlloyPluginUserConfig & {
|
|
129
|
+
napi: NapiPluginOptions;
|
|
130
130
|
};
|
|
131
|
-
type
|
|
131
|
+
type NapiResolvedPluginOptions = RequiredKeys<Omit<NapiPluginOptions, "targets">, "dts" | "jsBinding" | "manifestPath" | "outputDir" | "platform"> & {
|
|
132
132
|
/**
|
|
133
133
|
* The resolved target triples to build for, with additional metadata such as platform, architecture, and ABI information. These are derived from the `targets` option, and are used internally by the plugin to determine how to build the N-API Rust module for each target.
|
|
134
134
|
*/
|
|
135
135
|
targets: Target[];
|
|
136
136
|
};
|
|
137
|
-
type
|
|
138
|
-
napi:
|
|
137
|
+
type NapiPluginResolvedConfig = BabelPluginResolvedConfig & AlloyPluginResolvedConfig & {
|
|
138
|
+
napi: NapiResolvedPluginOptions;
|
|
139
139
|
};
|
|
140
|
-
interface
|
|
140
|
+
interface NapiPluginContext<TResolvedConfig extends NapiPluginResolvedConfig = NapiPluginResolvedConfig> extends BabelPluginContext<TResolvedConfig>, AlloyPluginContext<TResolvedConfig> {}
|
|
141
141
|
//#endregion
|
|
142
|
-
export {
|
|
142
|
+
export { NapiPluginContext, NapiPluginOptions, NapiPluginResolvedConfig, NapiPluginUserConfig, NapiResolvedPluginOptions };
|
|
143
143
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;AAwCA;;;;;;UAAiB,
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;AAwCA;;;;;;UAAiB,iBAAA;EAkCC;;;EA9BhB,UAAA;EAUA;;;EALA,WAAA;EAeA;;;EAVA,OAAA,IAAW,YAAA,GAAe,MAAA;EAoBf;;;EAfX,OAAA;EA2CA;;;EAtCA,IAAA,GAAO,WAAA;EA0DP;;;EArDA,OAAA;EA2EA;;;EAtEA,QAAA,GAAW,KAAA;EA0FX;;;EArFA,WAAA;EA+FY;AAGd;;;;EA3FE,iBAAA;EA6FQ;;;;;EAtFR,SAAA;EAsFQ;;;AAGV;;;;EAhFE,GAAA;EAgFsC;;;EA3EtC,YAAA;EA2EsC;;;EAtEtC,UAAA;EA6ES;;;EAxET,SAAA;EA2EkC;;;EAtElC,SAAA;EAwEQ;;;;;EAjER,QAAA;EAiEQ;;;EA5DR,SAAA;EA+DgC;;;EA1DhC,WAAA;EA8DqB;;;EAzDrB,SAAA;EA0DoB;;;EArDpB,WAAA;EAiDmD;;;EA5CnD,QAAA;EAgDqB;;;EA3CrB,KAAA;;;;EAKA,YAAA;;;;EAKA,QAAA;;;;EAKA,YAAA;AAAA;AAAA,KAGU,oBAAA,GAAuB,qBAAA,GACjC,qBAAA;EACE,IAAA,EAAM,iBAAA;AAAA;AAAA,KAGE,yBAAA,GAA4B,YAAA,CACtC,IAAA,CAAK,iBAAA;;;;EAML,OAAA,EAAS,MAAA;AAAA;AAAA,KAGC,wBAAA,GAA2B,yBAAA,GACrC,yBAAA;EACE,IAAA,EAAM,yBAAA;AAAA;AAAA,UAGO,iBAAA,yBACS,wBAAA,GAA2B,wBAAA,UAGjD,kBAAA,CAAmB,eAAA,GACnB,kBAAA,CAAmB,eAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n AlloyPluginContext,\n AlloyPluginResolvedConfig,\n AlloyPluginUserConfig\n} from \"@powerlines/plugin-alloy/types\";\nimport type {\n BabelPluginContext,\n BabelPluginResolvedConfig,\n BabelPluginUserConfig\n} from \"@powerlines/plugin-babel/types\";\nimport { RequiredKeys } from \"@stryke/types/base\";\nimport { Target, TargetTriple } from \"./targets\";\nimport { WasmOptions } from \"./wasm\";\n\n/**\n * The options for the N-API Rust plugin.\n *\n * @remarks\n * These options are based on the options for the N-API Rust CLI, and are used to configure the plugin's behavior when building and generating bindings for N-API Rust modules.\n *\n * @see https://napi.rs/docs/cli/build#options\n */\nexport interface
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n AlloyPluginContext,\n AlloyPluginResolvedConfig,\n AlloyPluginUserConfig\n} from \"@powerlines/plugin-alloy/types\";\nimport type {\n BabelPluginContext,\n BabelPluginResolvedConfig,\n BabelPluginUserConfig\n} from \"@powerlines/plugin-babel/types\";\nimport { RequiredKeys } from \"@stryke/types/base\";\nimport { Target, TargetTriple } from \"./targets\";\nimport { WasmOptions } from \"./wasm\";\n\n/**\n * The options for the N-API Rust plugin.\n *\n * @remarks\n * These options are based on the options for the N-API Rust CLI, and are used to configure the plugin's behavior when building and generating bindings for N-API Rust modules.\n *\n * @see https://napi.rs/docs/cli/build#options\n */\nexport interface NapiPluginOptions {\n /**\n * Build only the specified binary\n */\n binaryName?: string;\n\n /**\n * Package name in generated JS binding file. Works only with --platform\n */\n packageName?: string;\n\n /**\n * Build for the target triple, bypassed to `cargo build --target`\n */\n targets?: (TargetTriple | Target)[];\n\n /**\n * Build artifacts with the specified Cargo profile\n */\n profile?: string;\n\n /**\n * Wasm compilation options. If specified, the plugin will compile the N-API Rust module to WebAssembly and generate the corresponding bindings.\n */\n wasm?: WasmOptions;\n\n /**\n * Build in release mode\n */\n release?: boolean;\n\n /**\n * List of Cargo features to activate\n */\n features?: Array<string>;\n\n /**\n * Activate all available Cargo features\n */\n allFeatures?: boolean;\n\n /**\n * Do not activate the default features\n *\n * @defaultValue false\n */\n noDefaultFeatures?: boolean;\n\n /**\n * Path and filename of generated JS binding file. Only works with {@link platform} flag. Relative to {@link outputPath}.\n *\n * @defaultValue \"binding.js\"\n */\n jsBinding?: string;\n\n /**\n * DTS Binding File\n *\n * The path to the output TypeScript declaration file\n *\n * @defaultValue \"binding.d.ts\"\n */\n dts?: string;\n\n /**\n * The path to the Cargo.toml manifest file\n */\n manifestPath?: string;\n\n /**\n * Path to [NAPI-RS config file](https://napi.rs/docs/cli/napi-config)\n */\n configPath?: string;\n\n /**\n * Path to where all the built files would be put. Default to the crate folder if not specified. Relative to the project root.\n */\n outputDir?: string;\n\n /**\n * \tDirectory for all crate generated artifacts, see `cargo build --target-dir`\n */\n targetDir?: string;\n\n /**\n * Add platform triple suffix to generated Node.js binding file, e.g. [name].linux-x64-gnu.node\n *\n * @defaultValue true\n */\n platform?: boolean;\n\n /**\n * Whether to generate const enum for TypeScript bindings\n */\n constEnum?: boolean;\n\n /**\n * Disable generation of JS binding file. Works only with --platform\n */\n noJsBinding?: boolean;\n\n /**\n * Custom file header for generated type def file (requires typedef feature)\n */\n dtsHeader?: string;\n\n /**\n * Disable default file header for generated type def file (requires typedef feature)\n */\n noDtsHeader?: boolean;\n\n /**\n * Enable the DTS cache\n */\n dtsCache?: boolean;\n\n /**\n * Strip the library to minimize file size\n */\n strip?: boolean;\n\n /**\n * Cross-compile for the specified target with cargo-xwin on Windows and cargo-zigbuild on other platforms\n */\n crossCompile?: boolean;\n\n /**\n * Use [cross-rs](https://github.com/cross-rs/cross) instead of cargo\n */\n useCross?: boolean;\n\n /**\n * Use \\@napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets\n */\n useNapiCross?: boolean;\n}\n\nexport type NapiPluginUserConfig = BabelPluginUserConfig &\n AlloyPluginUserConfig & {\n napi: NapiPluginOptions;\n };\n\nexport type NapiResolvedPluginOptions = RequiredKeys<\n Omit<NapiPluginOptions, \"targets\">,\n \"dts\" | \"jsBinding\" | \"manifestPath\" | \"outputDir\" | \"platform\"\n> & {\n /**\n * The resolved target triples to build for, with additional metadata such as platform, architecture, and ABI information. These are derived from the `targets` option, and are used internally by the plugin to determine how to build the N-API Rust module for each target.\n */\n targets: Target[];\n};\n\nexport type NapiPluginResolvedConfig = BabelPluginResolvedConfig &\n AlloyPluginResolvedConfig & {\n napi: NapiResolvedPluginOptions;\n };\n\nexport interface NapiPluginContext<\n TResolvedConfig extends NapiPluginResolvedConfig = NapiPluginResolvedConfig\n>\n extends\n BabelPluginContext<TResolvedConfig>,\n AlloyPluginContext<TResolvedConfig> {}\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-napi-rs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
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"],
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
"@alloy-js/markdown": "0.23.0-dev.1",
|
|
124
124
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
125
125
|
"@napi-rs/cli": "^3.6.2",
|
|
126
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
127
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
128
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
126
|
+
"@powerlines/plugin-alloy": "^0.26.39",
|
|
127
|
+
"@powerlines/plugin-automd": "^0.1.421",
|
|
128
|
+
"@powerlines/plugin-plugin": "^0.12.372",
|
|
129
129
|
"@stryke/fs": "^0.33.66",
|
|
130
130
|
"@stryke/path": "^0.27.4",
|
|
131
131
|
"@stryke/string-format": "^0.17.9",
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
"@stryke/types": "^0.11.3",
|
|
134
134
|
"automd": "^0.4.3",
|
|
135
135
|
"defu": "^6.1.7",
|
|
136
|
-
"powerlines": "^0.43.
|
|
136
|
+
"powerlines": "^0.43.20"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": { "@types/node": "^25.6.0" },
|
|
139
139
|
"peerDependencies": { "@napi-rs/wasm-runtime": ">=1.1.4" },
|
|
140
140
|
"peerDependenciesMeta": { "@napi-rs/wasm-runtime": { "optional": true } },
|
|
141
141
|
"publishConfig": { "access": "public" },
|
|
142
|
-
"gitHead": "
|
|
142
|
+
"gitHead": "af5d14b5eadf20bd560b5269827eb48258ccdacc"
|
|
143
143
|
}
|