@powerlines/plugin-capnp 0.1.334 → 0.1.335
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.mjs +1 -2
- package/package.json +9 -9
- package/dist/index.d.cts +0 -20
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -20
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/index.d.cts +0 -2
- package/dist/types/index.d.mts +0 -2
- package/dist/types/plugin.d.cts +0 -35
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -35
- package/dist/types/plugin.d.mts.map +0 -1
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-capnp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.335",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to generate project code from Cap'n Proto schemas.",
|
|
6
6
|
"repository": {
|
|
@@ -89,19 +89,19 @@
|
|
|
89
89
|
"files": ["dist/**/*"],
|
|
90
90
|
"keywords": ["capnp", "powerlines", "storm-software", "powerlines-plugin"],
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@stryke/capnp": "^0.12.
|
|
93
|
-
"@stryke/path": "^0.26.
|
|
94
|
-
"@stryke/type-checks": "^0.5.
|
|
95
|
-
"@stryke/types": "^0.10.
|
|
92
|
+
"@stryke/capnp": "^0.12.82",
|
|
93
|
+
"@stryke/path": "^0.26.18",
|
|
94
|
+
"@stryke/type-checks": "^0.5.37",
|
|
95
|
+
"@stryke/types": "^0.10.51",
|
|
96
96
|
"defu": "^6.1.4",
|
|
97
97
|
"jiti": "^2.6.1",
|
|
98
|
-
"powerlines": "^0.40.
|
|
98
|
+
"powerlines": "^0.40.19"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
102
|
-
"@types/node": "^25.
|
|
101
|
+
"@powerlines/plugin-plugin": "^0.12.283",
|
|
102
|
+
"@types/node": "^25.4.0"
|
|
103
103
|
},
|
|
104
104
|
"publishConfig": { "access": "public" },
|
|
105
105
|
"types": "./dist/index.d.cts",
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "7496a546473274494be487ebc33cf267ed5cd1f0"
|
|
107
107
|
}
|
package/dist/index.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
-
import "./types/index.cjs";
|
|
3
|
-
import { Plugin } from "powerlines";
|
|
4
|
-
|
|
5
|
-
//#region src/index.d.ts
|
|
6
|
-
declare module "powerlines" {
|
|
7
|
-
interface Config {
|
|
8
|
-
capnp?: CapnpPluginOptions;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A Powerlines plugin to integrate Cap'n Proto for code generation.
|
|
13
|
-
*
|
|
14
|
-
* @param options - The plugin options.
|
|
15
|
-
* @returns A Powerlines plugin instance.
|
|
16
|
-
*/
|
|
17
|
-
declare const plugin: <TContext extends CapnpPluginContext = CapnpPluginContext>(options?: CapnpPluginOptions) => Plugin<TContext>;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig, plugin as default, plugin };
|
|
20
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IAiCwB,KAAA,CAAA,EAIZ,kBAJY;EAAA;;;;AAcxB;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,kBAGT,GAH8B,kBAG9B,CAAA,CAAA,OAAA,CAAA,EADC,kBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
|
package/dist/index.d.mts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig } from "./types/plugin.mjs";
|
|
2
|
-
import "./types/index.mjs";
|
|
3
|
-
import { Plugin } from "powerlines";
|
|
4
|
-
|
|
5
|
-
//#region src/index.d.ts
|
|
6
|
-
declare module "powerlines" {
|
|
7
|
-
interface Config {
|
|
8
|
-
capnp?: CapnpPluginOptions;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A Powerlines plugin to integrate Cap'n Proto for code generation.
|
|
13
|
-
*
|
|
14
|
-
* @param options - The plugin options.
|
|
15
|
-
* @returns A Powerlines plugin instance.
|
|
16
|
-
*/
|
|
17
|
-
declare const plugin: <TContext extends CapnpPluginContext = CapnpPluginContext>(options?: CapnpPluginOptions) => Plugin<TContext>;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig, plugin as default, plugin };
|
|
20
|
-
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IAiCwB,KAAA,CAAA,EAIZ,kBAJY;EAAA;;;;AAcxB;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,kBAGT,GAH8B,kBAG9B,CAAA,CAAA,OAAA,CAAA,EADC,kBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { capnpc } from \"@stryke/capnp/compile\";\nimport { resolveOptions } from \"@stryke/capnp/helpers\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport {\n CapnpPluginContext,\n CapnpPluginOptions,\n CapnpPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n capnp?: CapnpPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to integrate Cap'n Proto for code generation.\n *\n * @param options - The plugin options.\n * @returns A Powerlines plugin instance.\n */\nexport const plugin = <\n TContext extends CapnpPluginContext = CapnpPluginContext\n>(\n options: CapnpPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"capnp\",\n config() {\n return {\n capnp: defu(options, {\n ts: true,\n js: false,\n dts: false,\n tty: true,\n tsconfig: this.tsconfig,\n schema: joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.root,\n \"*.capnp\"\n ),\n outputPath: joinPaths(\"{builtinPath}\", \"capnp\")\n })\n } as Partial<CapnpPluginUserConfig>;\n },\n configResolved() {\n this.config.capnp.outputPath = replacePathTokens(\n this,\n this.config.capnp.outputPath\n );\n },\n async prepare() {\n const resolvedOptions = await resolveOptions({\n ...this.config.capnp,\n schemas: this.config.capnp.schema.toString(),\n projectRoot: this.config.root,\n workspaceRoot: this.workspaceConfig.workspaceRoot\n });\n if (!resolvedOptions?.schemas?.length) {\n this.warn(\"No Cap'n Proto schemas found to compile.\");\n\n return;\n }\n\n const result = await capnpc(resolvedOptions);\n\n if (isParentPath(this.config.capnp.outputPath, this.builtinsPath)) {\n await Promise.all(\n Object.entries(result.files).map(async ([filePath, content]) =>\n this.emitBuiltin(\n content,\n findFileName(\n joinPaths(\n replacePath(this.config.capnp.outputPath, this.builtinsPath),\n filePath\n ),\n { withExtension: false }\n )\n )\n )\n );\n } else {\n await Promise.all(\n Object.entries(result.files).map(async ([filePath, content]) =>\n this.fs.write(\n joinPaths(this.config.capnp.outputPath, filePath),\n content\n )\n )\n );\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AA+CA,MAAa,UAGX,UAA8B,EAAE,KACX;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO,EACL,OAAO,KAAK,SAAS;IACnB,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,UAAU,KAAK;IACf,QAAQ,UACN,KAAK,gBAAgB,eACrB,KAAK,OAAO,MACZ,UACD;IACD,YAAY,UAAU,iBAAiB,QAAQ;IAChD,CAAC,EACH;;EAEH,iBAAiB;AACf,QAAK,OAAO,MAAM,aAAa,kBAC7B,MACA,KAAK,OAAO,MAAM,WACnB;;EAEH,MAAM,UAAU;GACd,MAAM,kBAAkB,MAAM,eAAe;IAC3C,GAAG,KAAK,OAAO;IACf,SAAS,KAAK,OAAO,MAAM,OAAO,UAAU;IAC5C,aAAa,KAAK,OAAO;IACzB,eAAe,KAAK,gBAAgB;IACrC,CAAC;AACF,OAAI,CAAC,iBAAiB,SAAS,QAAQ;AACrC,SAAK,KAAK,2CAA2C;AAErD;;GAGF,MAAM,SAAS,MAAM,OAAO,gBAAgB;AAE5C,OAAI,aAAa,KAAK,OAAO,MAAM,YAAY,KAAK,aAAa,CAC/D,OAAM,QAAQ,IACZ,OAAO,QAAQ,OAAO,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,aACjD,KAAK,YACH,SACA,aACE,UACE,YAAY,KAAK,OAAO,MAAM,YAAY,KAAK,aAAa,EAC5D,SACD,EACD,EAAE,eAAe,OAAO,CACzB,CACF,CACF,CACF;OAED,OAAM,QAAQ,IACZ,OAAO,QAAQ,OAAO,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,aACjD,KAAK,GAAG,MACN,UAAU,KAAK,OAAO,MAAM,YAAY,SAAS,EACjD,QACD,CACF,CACF;;EAGN;;AAGH,kBAAe"}
|
package/dist/types/index.d.cts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig } from "./plugin.cjs";
|
|
2
|
-
export { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig };
|
package/dist/types/index.d.mts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig } from "./plugin.mjs";
|
|
2
|
-
export { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig };
|
package/dist/types/plugin.d.cts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
2
|
-
import { CapnpcOptions } from "@stryke/capnp/types";
|
|
3
|
-
|
|
4
|
-
//#region src/types/plugin.d.ts
|
|
5
|
-
type CapnpPluginOptions = Partial<Omit<CapnpcOptions, "workspaceRoot" | "projectRoot" | "schemas">> & {
|
|
6
|
-
/**
|
|
7
|
-
* The path to the Cap'n Proto schema file(s).
|
|
8
|
-
*
|
|
9
|
-
* @defaultValue "\{root\}/schemas/*.capnp"
|
|
10
|
-
*/
|
|
11
|
-
schema?: string | URL;
|
|
12
|
-
/**
|
|
13
|
-
* The path to the output file generated by the plugin.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* If using the default value, the file can be imported from "powerlines:capnp/schema-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue "\{builtinPath\}/capnp"
|
|
19
|
-
*/
|
|
20
|
-
outputPath?: string;
|
|
21
|
-
};
|
|
22
|
-
type CapnpPluginUserConfig = UserConfig & {
|
|
23
|
-
capnp?: Omit<CapnpPluginOptions, "schema" | "outputPath"> & Required<Pick<CapnpPluginOptions, "schema" | "outputPath">>;
|
|
24
|
-
};
|
|
25
|
-
type CapnpPluginResolvedConfig = ResolvedConfig & {
|
|
26
|
-
capnp: Omit<CapnpPluginOptions, "schema" | "outputPath"> & Required<Pick<CapnpPluginOptions, "schema" | "outputPath">>;
|
|
27
|
-
};
|
|
28
|
-
type CapnpPluginContext<TResolvedConfig extends CapnpPluginResolvedConfig = CapnpPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
29
|
-
declare type __ΩCapnpPluginOptions = any[];
|
|
30
|
-
declare type __ΩCapnpPluginUserConfig = any[];
|
|
31
|
-
declare type __ΩCapnpPluginResolvedConfig = any[];
|
|
32
|
-
declare type __ΩCapnpPluginContext = any[];
|
|
33
|
-
//#endregion
|
|
34
|
-
export { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig };
|
|
35
|
-
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,kBAAA,GAAqB,QAC/B,KAAK;;AADP;;;;EAQoB,MAAA,CAAA,EAAA,MAAA,GAAA,GAAA;EAAG;AAavB;;;;;;;EAEY,UAAA,CAAA,EAAA,MAAA;AAGZ,CAAA;AAAwC,KAL5B,qBAAA,GAAwB,UAKI,GAAA;EAC1B,KAAA,CAAA,EALJ,IAKI,CALC,kBAKD,EAAA,QAAA,GAAA,YAAA,CAAA,GAJV,QAIU,CAJD,IAIC,CAJI,kBAIJ,EAAA,QAAA,GAAA,YAAA,CAAA,CAAA;CAAL;AACS,KAFN,yBAAA,GAA4B,cAEtB,GAAA;EAAL,KAAA,EADJ,IACI,CADC,kBACD,EAAA,QAAA,GAAA,YAAA,CAAA,GAAT,QAAS,CAAA,IAAA,CAAK,kBAAL,EAAA,QAAA,GAAA,YAAA,CAAA,CAAA;CAAT;AAAQ,KAGA,kBAHA,CAAA,wBAIc,yBAJd,GAI0C,yBAJ1C,CAAA,GAKR,aALQ,CAKM,eALN,CAAA;AAGA,qCAAkB,GAAA,EAAA;AACJ,wCAAA,GAAA,EAAA;AAA4B,4CAAA,GAAA,EAAA;AACpC,qCAAA,GAAA,EAAA"}
|
package/dist/types/plugin.d.mts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
2
|
-
import { CapnpcOptions } from "@stryke/capnp/types";
|
|
3
|
-
|
|
4
|
-
//#region src/types/plugin.d.ts
|
|
5
|
-
type CapnpPluginOptions = Partial<Omit<CapnpcOptions, "workspaceRoot" | "projectRoot" | "schemas">> & {
|
|
6
|
-
/**
|
|
7
|
-
* The path to the Cap'n Proto schema file(s).
|
|
8
|
-
*
|
|
9
|
-
* @defaultValue "\{root\}/schemas/*.capnp"
|
|
10
|
-
*/
|
|
11
|
-
schema?: string | URL;
|
|
12
|
-
/**
|
|
13
|
-
* The path to the output file generated by the plugin.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* If using the default value, the file can be imported from "powerlines:capnp/schema-name". This field allows the use of the "\{builtinPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue "\{builtinPath\}/capnp"
|
|
19
|
-
*/
|
|
20
|
-
outputPath?: string;
|
|
21
|
-
};
|
|
22
|
-
type CapnpPluginUserConfig = UserConfig & {
|
|
23
|
-
capnp?: Omit<CapnpPluginOptions, "schema" | "outputPath"> & Required<Pick<CapnpPluginOptions, "schema" | "outputPath">>;
|
|
24
|
-
};
|
|
25
|
-
type CapnpPluginResolvedConfig = ResolvedConfig & {
|
|
26
|
-
capnp: Omit<CapnpPluginOptions, "schema" | "outputPath"> & Required<Pick<CapnpPluginOptions, "schema" | "outputPath">>;
|
|
27
|
-
};
|
|
28
|
-
type CapnpPluginContext<TResolvedConfig extends CapnpPluginResolvedConfig = CapnpPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
29
|
-
declare type __ΩCapnpPluginOptions = any[];
|
|
30
|
-
declare type __ΩCapnpPluginUserConfig = any[];
|
|
31
|
-
declare type __ΩCapnpPluginResolvedConfig = any[];
|
|
32
|
-
declare type __ΩCapnpPluginContext = any[];
|
|
33
|
-
//#endregion
|
|
34
|
-
export { CapnpPluginContext, CapnpPluginOptions, CapnpPluginResolvedConfig, CapnpPluginUserConfig, __ΩCapnpPluginContext, __ΩCapnpPluginOptions, __ΩCapnpPluginResolvedConfig, __ΩCapnpPluginUserConfig };
|
|
35
|
-
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,kBAAA,GAAqB,QAC/B,KAAK;;AADP;;;;EAQoB,MAAA,CAAA,EAAA,MAAA,GAAA,GAAA;EAAG;AAavB;;;;;;;EAEY,UAAA,CAAA,EAAA,MAAA;AAGZ,CAAA;AAAwC,KAL5B,qBAAA,GAAwB,UAKI,GAAA;EAC1B,KAAA,CAAA,EALJ,IAKI,CALC,kBAKD,EAAA,QAAA,GAAA,YAAA,CAAA,GAJV,QAIU,CAJD,IAIC,CAJI,kBAIJ,EAAA,QAAA,GAAA,YAAA,CAAA,CAAA;CAAL;AACS,KAFN,yBAAA,GAA4B,cAEtB,GAAA;EAAL,KAAA,EADJ,IACI,CADC,kBACD,EAAA,QAAA,GAAA,YAAA,CAAA,GAAT,QAAS,CAAA,IAAA,CAAK,kBAAL,EAAA,QAAA,GAAA,YAAA,CAAA,CAAA;CAAT;AAAQ,KAGA,kBAHA,CAAA,wBAIc,yBAJd,GAI0C,yBAJ1C,CAAA,GAKR,aALQ,CAKM,eALN,CAAA;AAGA,qCAAkB,GAAA,EAAA;AACJ,wCAAA,GAAA,EAAA;AAA4B,4CAAA,GAAA,EAAA;AACpC,qCAAA,GAAA,EAAA"}
|