@powerlines/plugin-crypto 0.10.194 → 0.10.196
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 +3 -4
- package/dist/index.mjs +3 -4
- package/dist/plugin-automd/src/types/plugin.d.mts +1 -3
- package/dist/plugin-env/src/types/plugin.d.mts +0 -2
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/commands.d.mts +0 -1
- package/dist/powerlines/src/types/config.d.cts +3 -2
- package/dist/powerlines/src/types/config.d.mts +4 -3
- package/dist/powerlines/src/types/resolved.d.cts +2 -2
- package/dist/powerlines/src/types/resolved.d.mts +2 -2
- package/dist/powerlines/src/types/unplugin.d.mts +0 -1
- package/package.json +5 -5
- package/dist/plugin-alloy/src/types/components.d.mts +0 -2
- package/dist/plugin-alloy/src/types/index.d.mts +0 -2
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,6 @@ require('./components/index.cjs');
|
|
|
5
5
|
let __noble_ciphers_utils_js = require("@noble/ciphers/utils.js");
|
|
6
6
|
let __powerlines_plugin_env = require("@powerlines/plugin-env");
|
|
7
7
|
__powerlines_plugin_env = require_rolldown_runtime.__toESM(__powerlines_plugin_env);
|
|
8
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
9
8
|
let defu = require("defu");
|
|
10
9
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
11
10
|
|
|
@@ -24,17 +23,17 @@ function plugin(options = {}) {
|
|
|
24
23
|
this.dependencies["@noble/hashes"] = "^2.0.1";
|
|
25
24
|
this.config.crypto.salt ??= this.env.parsed.SALT;
|
|
26
25
|
if (!this.config.crypto.salt) {
|
|
27
|
-
this.
|
|
26
|
+
this.warn(`No salt provided to the Crypto plugin - a salt value will be generated automatically. Please note: It's highly recommended to provide a unique salt value via the \`salt\` plugin option or the \`SALT\` environment variable.`);
|
|
28
27
|
this.config.crypto.salt = (0, __noble_ciphers_utils_js.bytesToHex)((0, __noble_ciphers_utils_js.randomBytes)(12));
|
|
29
28
|
}
|
|
30
29
|
this.config.crypto.encryptionKey ??= this.env.parsed.ENCRYPTION_KEY;
|
|
31
30
|
if (!this.config.crypto.encryptionKey) {
|
|
32
|
-
this.
|
|
31
|
+
this.warn(`No encryption key provided to the Crypto plugin - a secure key will be generated automatically. Please note: it's highly recommended to provide a secure encryption key via the \`encryptionKey\` plugin option or the \`ENCRYPTION_KEY\` environment variable.`);
|
|
33
32
|
this.config.crypto.encryptionKey = (0, __noble_ciphers_utils_js.bytesToHex)((0, __noble_ciphers_utils_js.randomBytes)(32));
|
|
34
33
|
}
|
|
35
34
|
},
|
|
36
35
|
async prepare() {
|
|
37
|
-
this.
|
|
36
|
+
this.debug(`Preparing the Crypto runtime artifacts for the Powerlines project.`);
|
|
38
37
|
await this.emitBuiltin(await Promise.resolve(require_crypto.cryptoModule(this)), "crypto");
|
|
39
38
|
}
|
|
40
39
|
}];
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { cryptoModule } from "./components/crypto.mjs";
|
|
|
2
2
|
import "./components/index.mjs";
|
|
3
3
|
import { bytesToHex, randomBytes } from "@noble/ciphers/utils.js";
|
|
4
4
|
import env from "@powerlines/plugin-env";
|
|
5
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
6
5
|
import defu from "defu";
|
|
7
6
|
|
|
8
7
|
//#region src/index.ts
|
|
@@ -20,17 +19,17 @@ function plugin(options = {}) {
|
|
|
20
19
|
this.dependencies["@noble/hashes"] = "^2.0.1";
|
|
21
20
|
this.config.crypto.salt ??= this.env.parsed.SALT;
|
|
22
21
|
if (!this.config.crypto.salt) {
|
|
23
|
-
this.
|
|
22
|
+
this.warn(`No salt provided to the Crypto plugin - a salt value will be generated automatically. Please note: It's highly recommended to provide a unique salt value via the \`salt\` plugin option or the \`SALT\` environment variable.`);
|
|
24
23
|
this.config.crypto.salt = bytesToHex(randomBytes(12));
|
|
25
24
|
}
|
|
26
25
|
this.config.crypto.encryptionKey ??= this.env.parsed.ENCRYPTION_KEY;
|
|
27
26
|
if (!this.config.crypto.encryptionKey) {
|
|
28
|
-
this.
|
|
27
|
+
this.warn(`No encryption key provided to the Crypto plugin - a secure key will be generated automatically. Please note: it's highly recommended to provide a secure encryption key via the \`encryptionKey\` plugin option or the \`ENCRYPTION_KEY\` environment variable.`);
|
|
29
28
|
this.config.crypto.encryptionKey = bytesToHex(randomBytes(32));
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
async prepare() {
|
|
33
|
-
this.
|
|
32
|
+
this.debug(`Preparing the Crypto runtime artifacts for the Powerlines project.`);
|
|
34
33
|
await this.emitBuiltin(await Promise.resolve(cryptoModule(this)), "crypto");
|
|
35
34
|
}
|
|
36
35
|
}];
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import "../../../powerlines/src/types/config.mjs";
|
|
2
|
-
import "../../../powerlines/src/types/resolved.mjs";
|
|
3
|
-
import "../../../powerlines/src/types/context.mjs";
|
|
4
1
|
import { TOCOptions } from "./toc.mjs";
|
|
5
2
|
import { Config } from "automd";
|
|
6
3
|
|
|
7
4
|
//#region ../plugin-automd/src/types/plugin.d.ts
|
|
5
|
+
|
|
8
6
|
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
9
7
|
/**
|
|
10
8
|
* Path to the AutoMD configuration file.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Reflection } from "../../../deepkit/src/types.mjs";
|
|
2
2
|
import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "../../../plugin-alloy/src/types/plugin.mjs";
|
|
3
|
-
import "../../../plugin-alloy/src/types/index.mjs";
|
|
4
3
|
import { AutoMDPluginOptions } from "../../../plugin-automd/src/types/plugin.mjs";
|
|
5
4
|
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "../../../plugin-babel/src/types/plugin.mjs";
|
|
6
|
-
import "../../../plugin-babel/src/types/index.mjs";
|
|
7
5
|
import { EnvInterface, SecretsInterface } from "./runtime.mjs";
|
|
8
6
|
import { DotenvConfiguration, TypeDefinition, TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
9
7
|
import { Children } from "@alloy-js/core";
|
|
@@ -15,6 +15,7 @@ import { AssetGlob } from "@stryke/types/file";
|
|
|
15
15
|
import { DateString } from "compatx";
|
|
16
16
|
|
|
17
17
|
//#region ../powerlines/src/types/config.d.ts
|
|
18
|
+
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
18
19
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
19
20
|
/**
|
|
20
21
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
@@ -264,7 +265,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
264
265
|
*
|
|
265
266
|
* @defaultValue "info"
|
|
266
267
|
*/
|
|
267
|
-
logLevel?:
|
|
268
|
+
logLevel?: LogLevel | null;
|
|
268
269
|
/**
|
|
269
270
|
* A custom logger function to use for logging messages
|
|
270
271
|
*/
|
|
@@ -431,4 +432,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Inlin
|
|
|
431
432
|
command: "deploy";
|
|
432
433
|
};
|
|
433
434
|
//#endregion
|
|
434
|
-
export { BabelUserConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
435
|
+
export { BabelUserConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
@@ -4,17 +4,18 @@ import { StoragePort, StoragePreset } from "./fs.mjs";
|
|
|
4
4
|
import { TSConfig } from "./tsconfig.mjs";
|
|
5
5
|
import { PluginContext } from "./context.mjs";
|
|
6
6
|
import { Plugin } from "./plugin.mjs";
|
|
7
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
8
7
|
import { MaybePromise } from "@stryke/types/base";
|
|
9
8
|
import { PreviewOptions } from "vite";
|
|
10
9
|
import { transformAsync } from "@babel/core";
|
|
11
10
|
import { Format } from "@storm-software/build-tools/types";
|
|
11
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
12
12
|
import { StormWorkspaceConfig } from "@storm-software/config/types";
|
|
13
13
|
import { TypeDefinitionParameter } from "@stryke/types/configuration";
|
|
14
14
|
import { AssetGlob } from "@stryke/types/file";
|
|
15
15
|
import { DateString } from "compatx";
|
|
16
16
|
|
|
17
17
|
//#region ../powerlines/src/types/config.d.ts
|
|
18
|
+
type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
18
19
|
type LogFn = (type: LogLevelLabel, ...args: string[]) => void;
|
|
19
20
|
/**
|
|
20
21
|
* The {@link StormWorkspaceConfig | configuration} object for an entire Powerlines workspace
|
|
@@ -264,7 +265,7 @@ interface CommonUserConfig extends BaseConfig {
|
|
|
264
265
|
*
|
|
265
266
|
* @defaultValue "info"
|
|
266
267
|
*/
|
|
267
|
-
logLevel?:
|
|
268
|
+
logLevel?: LogLevel | null;
|
|
268
269
|
/**
|
|
269
270
|
* A custom logger function to use for logging messages
|
|
270
271
|
*/
|
|
@@ -431,4 +432,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Inlin
|
|
|
431
432
|
command: "deploy";
|
|
432
433
|
};
|
|
433
434
|
//#endregion
|
|
434
|
-
export { BabelUserConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
435
|
+
export { BabelUserConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, PluginConfig, PrepareInlineConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig$1 as UserConfig, ViteUserConfig, WebpackUserConfig, WorkspaceConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.cjs";
|
|
2
|
-
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
|
|
2
|
+
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LogLevel, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.cjs";
|
|
3
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
4
4
|
import { ResolvedPreviewOptions } from "vite";
|
|
5
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
@@ -77,7 +77,7 @@ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUse
|
|
|
77
77
|
*
|
|
78
78
|
* @defaultValue "info"
|
|
79
79
|
*/
|
|
80
|
-
logLevel:
|
|
80
|
+
logLevel: LogLevel | null;
|
|
81
81
|
};
|
|
82
82
|
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
83
83
|
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuilderVariant } from "./build.mjs";
|
|
2
|
-
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
|
|
2
|
+
import { BabelUserConfig, ESBuildUserConfig, EnvironmentConfig, FarmUserConfig, InlineConfig, LogLevel, OutputConfig, RolldownUserConfig, RollupUserConfig, RspackUserConfig, TsdownUserConfig, TsupUserConfig, UnbuildUserConfig, UserConfig as UserConfig$1, ViteUserConfig, WebpackUserConfig } from "./config.mjs";
|
|
3
3
|
import { NonUndefined } from "@stryke/types/base";
|
|
4
4
|
import { ResolvedPreviewOptions } from "vite";
|
|
5
5
|
import { TypeDefinition } from "@stryke/types/configuration";
|
|
@@ -77,7 +77,7 @@ type ResolvedConfig<TUserConfig extends UserConfig$1 = UserConfig$1> = Omit<TUse
|
|
|
77
77
|
*
|
|
78
78
|
* @defaultValue "info"
|
|
79
79
|
*/
|
|
80
|
-
logLevel:
|
|
80
|
+
logLevel: LogLevel | null;
|
|
81
81
|
};
|
|
82
82
|
type ViteResolvedConfig = ResolvedConfig<ViteUserConfig>;
|
|
83
83
|
type WebpackResolvedConfig = ResolvedConfig<WebpackUserConfig>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-crypto",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.196",
|
|
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": {
|
|
@@ -129,16 +129,16 @@
|
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@noble/ciphers": "^2.1.1",
|
|
132
|
-
"@powerlines/plugin-env": "^0.15.
|
|
132
|
+
"@powerlines/plugin-env": "^0.15.93",
|
|
133
133
|
"@storm-software/config-tools": "^1.188.80",
|
|
134
134
|
"@stryke/path": "^0.26.0",
|
|
135
135
|
"defu": "^6.1.4",
|
|
136
|
-
"powerlines": "^0.37.
|
|
136
|
+
"powerlines": "^0.37.73"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
139
|
+
"@powerlines/plugin-plugin": "^0.12.151",
|
|
140
140
|
"@types/node": "^24.10.9"
|
|
141
141
|
},
|
|
142
142
|
"publishConfig": { "access": "public" },
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "07df17214a141836c6cc1740071e30acf8e6029c"
|
|
144
144
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "./plugin.mjs";
|