@powerlines/plugin-crypto 0.10.732 → 0.10.735

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/README.md CHANGED
@@ -81,6 +81,38 @@ The noble packages used can be found below:
81
81
 
82
82
  <!-- END doctoc -->
83
83
 
84
+ ## Features
85
+
86
+ - Adds the `crypto` builtin module for runtime cryptography (audited `@noble/ciphers` + `@noble/hashes`)
87
+ - Composes the `env` plugin; resolved config requires both `salt` and `encryptionKey`
88
+ - Pins the noble packages as dependencies and renders the `CryptoBuiltin` module during `prepare`
89
+
90
+ ## Usage
91
+
92
+ Install the plugin:
93
+
94
+ ```bash
95
+ pnpm add @powerlines/plugin-crypto
96
+ ```
97
+
98
+ Register it in `powerlines.config.ts`:
99
+
100
+ ```ts
101
+ import { defineConfig } from "powerlines";
102
+ import { plugin as crypto } from "@powerlines/plugin-crypto";
103
+
104
+ export default defineConfig({
105
+ plugins: [
106
+ crypto({
107
+ salt: process.env.SALT,
108
+ encryptionKey: process.env.ENCRYPTION_KEY
109
+ })
110
+ ]
111
+ });
112
+ ```
113
+
114
+ Run the Powerlines build for your project to activate the plugin.
115
+
84
116
  ## Installing
85
117
 
86
118
  Using [pnpm](http://pnpm.io):
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_rolldown_runtime = require('../rolldown-runtime-C24Yb2bl.cjs');
2
+ const require_rolldown_runtime = require("../rolldown-runtime-xuxB8TGW.cjs");
3
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
@@ -10,7 +10,7 @@ let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powe
10
10
  let defu = require("defu");
11
11
  defu = require_rolldown_runtime.__toESM(defu, 1);
12
12
 
13
- //#region src/components/crypto-builtin.tsx
13
+ // src/components/crypto-builtin.tsx
14
14
  /**
15
15
  * Generates the cryptography builtin module for the Powerlines project.
16
16
  */
@@ -254,5 +254,4 @@ export * from "@noble/hashes/utils.js";
254
254
  }));
255
255
  }
256
256
 
257
- //#endregion
258
257
  exports.CryptoBuiltin = CryptoBuiltin;
@@ -1,2 +1,2 @@
1
- import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-DQGN7ZL1.cjs";
1
+ import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-BMKzoO7O.cjs";
2
2
  export { CryptoBuiltin, CryptoBuiltinProps };
@@ -1,2 +1,2 @@
1
- import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-DQGN7ZL1.mjs";
1
+ import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-BMKzoO7O.mjs";
2
2
  export { CryptoBuiltin, CryptoBuiltinProps };
@@ -7,7 +7,7 @@ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
7
  import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
8
8
  import defu from "defu";
9
9
 
10
- //#region src/components/crypto-builtin.tsx
10
+ // src/components/crypto-builtin.tsx
11
11
  /**
12
12
  * Generates the cryptography builtin module for the Powerlines project.
13
13
  */
@@ -251,6 +251,5 @@ export * from "@noble/hashes/utils.js";
251
251
  }));
252
252
  }
253
253
 
254
- //#endregion
255
254
  export { CryptoBuiltin };
256
255
  //# sourceMappingURL=crypto-builtin.mjs.map
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_components_crypto_builtin = require('./crypto-builtin.cjs');
2
+ const require_components_crypto_builtin = require("./crypto-builtin.cjs");
3
3
 
4
4
  exports.CryptoBuiltin = require_components_crypto_builtin.CryptoBuiltin;
@@ -1,2 +1,2 @@
1
- import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-DQGN7ZL1.cjs";
1
+ import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-BMKzoO7O.cjs";
2
2
  export { CryptoBuiltin, CryptoBuiltinProps };
@@ -1,2 +1,2 @@
1
- import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-DQGN7ZL1.mjs";
1
+ import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "../crypto-builtin-BMKzoO7O.mjs";
2
2
  export { CryptoBuiltin, CryptoBuiltinProps };
@@ -1,10 +1,8 @@
1
1
  import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
- //#region src/components/crypto-builtin.d.ts
3
2
  type CryptoBuiltinProps = Omit<BuiltinFileProps, "id">;
4
3
  /**
5
4
  * Generates the cryptography builtin module for the Powerlines project.
6
5
  */
7
6
  declare function CryptoBuiltin(props: CryptoBuiltinProps): import("@alloy-js/core").Children;
8
- //#endregion
9
7
  export { CryptoBuiltinProps as n, CryptoBuiltin as t };
10
- //# sourceMappingURL=crypto-builtin-DQGN7ZL1.d.cts.map
8
+ //# sourceMappingURL=crypto-builtin-BMKzoO7O.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto-builtin-BMKzoO7O.d.cts","names":[],"sources":["../src/components/crypto-builtin.tsx"],"mappings":";KAmCY,qBAAqB,KAAK;;;;iBAKtB,cAAc,OAAO,8CAAkB"}
@@ -1,10 +1,8 @@
1
1
  import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
- //#region src/components/crypto-builtin.d.ts
3
2
  type CryptoBuiltinProps = Omit<BuiltinFileProps, "id">;
4
3
  /**
5
4
  * Generates the cryptography builtin module for the Powerlines project.
6
5
  */
7
6
  declare function CryptoBuiltin(props: CryptoBuiltinProps): import("@alloy-js/core").Children;
8
- //#endregion
9
7
  export { CryptoBuiltinProps as n, CryptoBuiltin as t };
10
- //# sourceMappingURL=crypto-builtin-DQGN7ZL1.d.mts.map
8
+ //# sourceMappingURL=crypto-builtin-BMKzoO7O.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-builtin-DQGN7ZL1.d.mts","names":[],"sources":["../src/components/crypto-builtin.tsx"],"mappings":""}
1
+ {"version":3,"file":"crypto-builtin-BMKzoO7O.d.mts","names":[],"sources":["../src/components/crypto-builtin.tsx"],"mappings":""}
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
3
- require('./types/index.cjs');
4
- const require_components_crypto_builtin = require('./components/crypto-builtin.cjs');
5
- require('./components/index.cjs');
2
+ const require_rolldown_runtime = require("./rolldown-runtime-xuxB8TGW.cjs");
3
+ require("./types/index.cjs");
4
+ const require_components_crypto_builtin = require("./components/crypto-builtin.cjs");
5
+ require("./components/index.cjs");
6
6
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
7
  let defu = require("defu");
8
8
  defu = require_rolldown_runtime.__toESM(defu, 1);
@@ -10,7 +10,7 @@ let _noble_ciphers_utils_js = require("@noble/ciphers/utils.js");
10
10
  let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
11
11
  let _powerlines_plugin_env = require("@powerlines/plugin-env");
12
12
 
13
- //#region src/index.tsx
13
+ // src/index.tsx
14
14
  /**
15
15
  * A Powerlines plugin to assist in developing other Powerlines plugins.
16
16
  */
@@ -41,7 +41,6 @@ function plugin(options = {}) {
41
41
  }];
42
42
  }
43
43
 
44
- //#endregion
45
44
  exports.CryptoBuiltin = require_components_crypto_builtin.CryptoBuiltin;
46
45
  exports.default = plugin;
47
46
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,8 @@
1
- import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "./crypto-builtin-DQGN7ZL1.cjs";
1
+ import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "./crypto-builtin-BMKzoO7O.cjs";
2
2
  import "./components/index.cjs";
3
3
  import { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig } from "./types/plugin.cjs";
4
4
  import "./types/index.cjs";
5
5
  import { Plugin } from "powerlines";
6
- //#region src/index.d.ts
7
6
  declare module "powerlines" {
8
7
  interface Config {
9
8
  crypto?: CryptoPluginOptions;
@@ -13,6 +12,5 @@ declare module "powerlines" {
13
12
  * A Powerlines plugin to assist in developing other Powerlines plugins.
14
13
  */
15
14
  declare function plugin<TContext extends CryptoPluginContext = CryptoPluginContext>(options?: CryptoPluginOptions): Plugin<TContext>[];
16
- //#endregion
17
15
  export { CryptoBuiltin, CryptoBuiltinProps, CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, plugin as default, plugin };
18
16
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;YA8BY;IACR,SAAS;;;;;;iBAOG,OACd,iBAAiB,sBAAsB,qBACvC,UAAS,sBA0CJ,OAAO"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;YA8BY;IACR,SAAS;;;;;;iBAOG,OACd,iBAAiB,sBAAsB,qBACvC,UAAS,sBA0CJ,OAAO"}
package/dist/index.d.mts CHANGED
@@ -1,9 +1,8 @@
1
- import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "./crypto-builtin-DQGN7ZL1.mjs";
1
+ import { n as CryptoBuiltinProps, t as CryptoBuiltin } from "./crypto-builtin-BMKzoO7O.mjs";
2
2
  import "./components/index.mjs";
3
3
  import { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig } from "./types/plugin.mjs";
4
4
  import "./types/index.mjs";
5
5
  import { Plugin } from "powerlines";
6
- //#region src/index.d.ts
7
6
  declare module "powerlines" {
8
7
  interface Config {
9
8
  crypto?: CryptoPluginOptions;
@@ -13,6 +12,5 @@ declare module "powerlines" {
13
12
  * A Powerlines plugin to assist in developing other Powerlines plugins.
14
13
  */
15
14
  declare function plugin<TContext extends CryptoPluginContext = CryptoPluginContext>(options?: CryptoPluginOptions): Plugin<TContext>[];
16
- //#endregion
17
15
  export { CryptoBuiltin, CryptoBuiltinProps, CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, plugin as default, plugin };
18
16
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import { bytesToHex, randomBytes } from "@noble/ciphers/utils.js";
7
7
  import { render } from "@powerlines/plugin-alloy/render";
8
8
  import { plugin as plugin$1 } from "@powerlines/plugin-env";
9
9
 
10
- //#region src/index.tsx
10
+ // src/index.tsx
11
11
  /**
12
12
  * A Powerlines plugin to assist in developing other Powerlines plugins.
13
13
  */
@@ -38,6 +38,5 @@ function plugin(options = {}) {
38
38
  }];
39
39
  }
40
40
 
41
- //#endregion
42
41
  export { CryptoBuiltin, plugin as default, plugin };
43
42
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24,8 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
 
27
- //#endregion
28
- Object.defineProperty(exports, '__toESM', {
27
+ Object.defineProperty(exports, "__toESM", {
29
28
  enumerable: true,
30
29
  get: function () {
31
30
  return __toESM;
@@ -1,5 +1,4 @@
1
1
  import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
2
- //#region src/types/plugin.d.ts
3
2
  interface CryptoPluginOptions {
4
3
  /**
5
4
  * The application specific secret used for encrypting and decrypting data.
@@ -33,6 +32,5 @@ interface CryptoPluginResolvedConfig extends EnvPluginResolvedConfig {
33
32
  crypto: Required<Omit<CryptoPluginOptions, "env">>;
34
33
  }
35
34
  type CryptoPluginContext<TResolvedConfig extends CryptoPluginResolvedConfig = CryptoPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
36
- //#endregion
37
35
  export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig };
38
36
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;UAyBiB;;;;;;;EAOf;;;;;;;EAQA;;;;EAKA,MAAM;;UAGS,+BAA+B;;;;EAI9C,SAAS,KAAK;;UAGC,mCAAmC;;;;EAIlD,QAAQ,SAAS,KAAK;;KAGZ,oBACV,wBAAwB,6BACtB,8BACA,iBAAiB"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";UAyBiB;;;;;;;EAOf;;;;;;;EAQA;;;;EAKA,MAAM;;UAGS,+BAA+B;;;;EAI9C,SAAS,KAAK;;UAGC,mCAAmC;;;;EAIlD,QAAQ,SAAS,KAAK;;KAGZ,oBACV,wBAAwB,6BACtB,8BACA,iBAAiB"}
@@ -1,5 +1,4 @@
1
1
  import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
2
- //#region src/types/plugin.d.ts
3
2
  interface CryptoPluginOptions {
4
3
  /**
5
4
  * The application specific secret used for encrypting and decrypting data.
@@ -33,6 +32,5 @@ interface CryptoPluginResolvedConfig extends EnvPluginResolvedConfig {
33
32
  crypto: Required<Omit<CryptoPluginOptions, "env">>;
34
33
  }
35
34
  type CryptoPluginContext<TResolvedConfig extends CryptoPluginResolvedConfig = CryptoPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
36
- //#endregion
37
35
  export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig };
38
36
  //# sourceMappingURL=plugin.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-crypto",
3
- "version": "0.10.732",
3
+ "version": "0.10.735",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin that provides unique identifier generation capabilities at runtime by adding the `id` builtin module.",
6
6
  "repository": {
@@ -119,21 +119,21 @@
119
119
  "@alloy-js/markdown": "^0.24.0",
120
120
  "@alloy-js/typescript": "^0.24.0",
121
121
  "@noble/ciphers": "^2.4.0",
122
- "@power-plant/alloy-js": "^0.0.90",
123
- "@powerlines/plugin-alloy": "^0.26.312",
124
- "@powerlines/plugin-env": "^0.16.423",
125
- "@storm-software/config-tools": "^1.190.147",
122
+ "@power-plant/alloy-js": "^0.0.95",
123
+ "@powerlines/plugin-alloy": "^0.26.315",
124
+ "@powerlines/plugin-env": "^0.16.426",
125
+ "@storm-software/config-tools": "^1.190.154",
126
126
  "@stryke/path": "^0.29.43",
127
127
  "defu": "^6.1.7",
128
- "powerlines": "^0.47.214"
128
+ "powerlines": "^0.47.217"
129
129
  },
130
130
  "devDependencies": {
131
- "@powerlines/plugin-plugin": "^0.12.627",
131
+ "@powerlines/plugin-plugin": "^0.12.630",
132
132
  "@types/node": "^25.9.9"
133
133
  },
134
134
  "publishConfig": { "access": "public" },
135
135
  "main": "./dist/index.cjs",
136
136
  "module": "./dist/index.mjs",
137
137
  "types": "./dist/index.d.cts",
138
- "gitHead": "11405039d1373508718de6817cecb7b8f8e46104"
138
+ "gitHead": "bb4e1f2b32a8bb9d20559ca7c3df3a2f30a0d14e"
139
139
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto-builtin-DQGN7ZL1.d.cts","names":[],"sources":["../src/components/crypto-builtin.tsx"],"mappings":";;KAmCY,qBAAqB,KAAK;;;;iBAKtB,cAAc,OAAO,8CAAkB"}