@powerlines/plugin-id 0.9.65 → 0.9.67
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/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.cts +1 -3
- package/dist/components/index.d.mts +1 -3
- package/dist/components/index.mjs +1 -1
- package/dist/components/nanoid.cjs +90 -1
- package/dist/components/nanoid.d.cts +12 -2
- package/dist/components/nanoid.d.mts +12 -2
- package/dist/components/nanoid.mjs +90 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/powerlines/src/lib/utilities/file-header.cjs +10 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +10 -0
- package/dist/powerlines/src/types/babel.d.mts +2 -0
- package/dist/powerlines/src/types/build.d.cts +139 -0
- package/dist/powerlines/src/types/build.d.mts +139 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.d.cts +345 -0
- package/dist/powerlines/src/types/config.d.mts +345 -0
- package/dist/powerlines/src/types/context.d.cts +347 -0
- package/dist/powerlines/src/types/context.d.mts +349 -0
- package/dist/powerlines/src/types/fs.d.cts +458 -0
- package/dist/powerlines/src/types/fs.d.mts +458 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/plugin.d.cts +232 -0
- package/dist/powerlines/src/types/plugin.d.mts +232 -0
- package/dist/powerlines/src/types/resolved.d.cts +81 -0
- package/dist/powerlines/src/types/resolved.d.mts +81 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/index.cjs +0 -1
- package/dist/types/index.d.cts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +37 -1
- package/dist/types/plugin.d.mts +37 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +7 -7
- package/dist/components-BWLXb7a2.cjs +0 -0
- package/dist/components-CeJvJXAB.mjs +0 -1
- package/dist/index-9iG2qHLe.d.mts +0 -1
- package/dist/index-D4ELpJXS.d.cts +0 -1
- package/dist/index-D6CnpA_r.d.cts +0 -1
- package/dist/index-DL0uimUT.d.mts +0 -1
- package/dist/nanoid-BEJDhi9o.d.cts +0 -13
- package/dist/nanoid-BG_lCiEX.d.mts +0 -13
- package/dist/nanoid-BMwJGbL3.cjs +0 -99
- package/dist/nanoid-Clx2gSOJ.mjs +0 -99
- package/dist/plugin-9oupXQGY.d.mts +0 -1672
- package/dist/plugin-BjiGfRHE.mjs +0 -1
- package/dist/plugin-DAFqTL_r.d.cts +0 -1672
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/types-n6NgD0QK.mjs +0 -1
- package/dist/types-o3zWarRp.cjs +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-id",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.67",
|
|
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": {
|
|
@@ -128,16 +128,16 @@
|
|
|
128
128
|
"files": ["dist/**/*"],
|
|
129
129
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@storm-software/config-tools": "^1.188.
|
|
132
|
-
"@stryke/path": "^0.22.
|
|
131
|
+
"@storm-software/config-tools": "^1.188.60",
|
|
132
|
+
"@stryke/path": "^0.22.11",
|
|
133
133
|
"defu": "^6.1.4",
|
|
134
|
-
"powerlines": "^0.30.
|
|
134
|
+
"powerlines": "^0.30.10"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@powerlines/nx": "^0.10.
|
|
138
|
-
"@storm-software/tsup": "^0.2.
|
|
137
|
+
"@powerlines/nx": "^0.10.59",
|
|
138
|
+
"@storm-software/tsup": "^0.2.58",
|
|
139
139
|
"@types/node": "^24.10.1"
|
|
140
140
|
},
|
|
141
141
|
"publishConfig": { "access": "public" },
|
|
142
|
-
"gitHead": "
|
|
142
|
+
"gitHead": "1fa17406f69248e0a35ca56c09b1f4589e4d49d7"
|
|
143
143
|
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { t as IdPluginContext } from "./plugin-DAFqTL_r.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/components/nanoid.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Generates the nanoid module content.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The build context containing runtime information.
|
|
9
|
-
* @returns A string representing the nanoid module code.
|
|
10
|
-
*/
|
|
11
|
-
declare function nanoidModule(context: IdPluginContext): string;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { nanoidModule as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { t as IdPluginContext } from "./plugin-9oupXQGY.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/components/nanoid.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Generates the nanoid module content.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The build context containing runtime information.
|
|
9
|
-
* @returns A string representing the nanoid module code.
|
|
10
|
-
*/
|
|
11
|
-
declare function nanoidModule(context: IdPluginContext): string;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { nanoidModule as t };
|
package/dist/nanoid-BMwJGbL3.cjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
const e=require(`./index.cjs`);let t=require(`@stryke/string-format/title-case`);function n(e){return`
|
|
2
|
-
// Generated with ${(0,t.titleCase)(e.config.framework)}
|
|
3
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
4
|
-
`}function r(e,t={}){let{directive:r=null,prettierIgnore:i=!1}=t;return`/* eslint-disable */
|
|
5
|
-
// biome-ignore lint: disable
|
|
6
|
-
${i?`// prettier-ignore`:``}${r?`\n\n${r}\n`:`
|
|
7
|
-
`}
|
|
8
|
-
${n(e)}
|
|
9
|
-
|
|
10
|
-
`}function i(e){return`
|
|
11
|
-
/**
|
|
12
|
-
* The ID module provides a set of utilities for generating unique identifiers.
|
|
13
|
-
*
|
|
14
|
-
* @module ${e.config.output.builtinPrefix}:id
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
${r(e)}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Generate a random string
|
|
21
|
-
*
|
|
22
|
-
* @param array - The array to fill with random values
|
|
23
|
-
* @returns The array filled with random values
|
|
24
|
-
*/
|
|
25
|
-
export function getRandom(array: Uint8Array) {
|
|
26
|
-
if (array === null) {
|
|
27
|
-
throw new StormError({ type: "general", code: 9 });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Fill the array with random values
|
|
31
|
-
for (let i = 0; i < array.length; i++) {
|
|
32
|
-
array[i] = Math.floor(Math.random() * 256); // Random byte (0-255)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return array;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* A platform agnostic version of the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
40
|
-
*
|
|
41
|
-
* @param size - The size of the string to generate. Defaults to 21 if not provided.
|
|
42
|
-
* @returns A unique identifier following the nanoid format
|
|
43
|
-
*/
|
|
44
|
-
export function uniqueId(size?: number | undefined): string;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* A platform agnostic version of the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
48
|
-
*
|
|
49
|
-
* @param prefix - The prefix to use for the unique identifier
|
|
50
|
-
* @param size - The size of the string to generate. Defaults to 21 if not provided.
|
|
51
|
-
* @returns A unique identifier following the nanoid format
|
|
52
|
-
*/
|
|
53
|
-
export function uniqueId(prefix?: string, size?: number | undefined): string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* A platform agnostic version of the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
57
|
-
*
|
|
58
|
-
* @param param - The parameter to use for the unique identifier, can be a string or number
|
|
59
|
-
* @param size - The size of the string to generate. Defaults to 21 if not provided.
|
|
60
|
-
* @returns A unique identifier following the nanoid format
|
|
61
|
-
*/
|
|
62
|
-
export function uniqueId(param?: string | number | undefined, size?: number | undefined): string {
|
|
63
|
-
if (typeof param === "number") {
|
|
64
|
-
size = param;
|
|
65
|
-
} else if (!param || !size) {
|
|
66
|
-
size = 21; // Default size if not provided
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Use our custom getRandom function to fill a Uint8Array with random values.
|
|
70
|
-
const randomBytes = getRandom(new Uint8Array(typeof param === "string" ? size - (param.length + 1) : size));
|
|
71
|
-
|
|
72
|
-
let result = "";
|
|
73
|
-
if (typeof param === "string") {
|
|
74
|
-
// If the parameter is a string, use it as a prefix.
|
|
75
|
-
result = param + "_";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return result + randomBytes.reduce((id, byte) => {
|
|
79
|
-
// It is incorrect to use bytes exceeding the alphabet size.
|
|
80
|
-
// The following mask reduces the random byte in the 0-255 value
|
|
81
|
-
// range to the 0-63 value range. Therefore, adding hacks, such
|
|
82
|
-
// as empty string fallback or magic numbers, is unnecessary because
|
|
83
|
-
// the bitmask trims bytes down to the alphabet size.
|
|
84
|
-
byte &= 63;
|
|
85
|
-
if (byte < 36) {
|
|
86
|
-
// \`0-9a-z\`
|
|
87
|
-
id += byte.toString(36);
|
|
88
|
-
} else if (byte < 62) {
|
|
89
|
-
// \`A-Z\`
|
|
90
|
-
id += (byte - 26).toString(36).toUpperCase();
|
|
91
|
-
} else if (byte > 62) {
|
|
92
|
-
id += "-";
|
|
93
|
-
} else {
|
|
94
|
-
id += "_";
|
|
95
|
-
}
|
|
96
|
-
return id;
|
|
97
|
-
}, "");
|
|
98
|
-
}
|
|
99
|
-
`}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
package/dist/nanoid-Clx2gSOJ.mjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import{titleCase as e}from"@stryke/string-format/title-case";function t(t){return`
|
|
2
|
-
// Generated with ${e(t.config.framework)}
|
|
3
|
-
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
4
|
-
`}function n(e,n={}){let{directive:r=null,prettierIgnore:i=!1}=n;return`/* eslint-disable */
|
|
5
|
-
// biome-ignore lint: disable
|
|
6
|
-
${i?`// prettier-ignore`:``}${r?`\n\n${r}\n`:`
|
|
7
|
-
`}
|
|
8
|
-
${t(e)}
|
|
9
|
-
|
|
10
|
-
`}function r(e){return`
|
|
11
|
-
/**
|
|
12
|
-
* The ID module provides a set of utilities for generating unique identifiers.
|
|
13
|
-
*
|
|
14
|
-
* @module ${e.config.output.builtinPrefix}:id
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
${n(e)}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Generate a random string
|
|
21
|
-
*
|
|
22
|
-
* @param array - The array to fill with random values
|
|
23
|
-
* @returns The array filled with random values
|
|
24
|
-
*/
|
|
25
|
-
export function getRandom(array: Uint8Array) {
|
|
26
|
-
if (array === null) {
|
|
27
|
-
throw new StormError({ type: "general", code: 9 });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Fill the array with random values
|
|
31
|
-
for (let i = 0; i < array.length; i++) {
|
|
32
|
-
array[i] = Math.floor(Math.random() * 256); // Random byte (0-255)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return array;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* A platform agnostic version of the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
40
|
-
*
|
|
41
|
-
* @param size - The size of the string to generate. Defaults to 21 if not provided.
|
|
42
|
-
* @returns A unique identifier following the nanoid format
|
|
43
|
-
*/
|
|
44
|
-
export function uniqueId(size?: number | undefined): string;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* A platform agnostic version of the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
48
|
-
*
|
|
49
|
-
* @param prefix - The prefix to use for the unique identifier
|
|
50
|
-
* @param size - The size of the string to generate. Defaults to 21 if not provided.
|
|
51
|
-
* @returns A unique identifier following the nanoid format
|
|
52
|
-
*/
|
|
53
|
-
export function uniqueId(prefix?: string, size?: number | undefined): string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* A platform agnostic version of the [nanoid](https://github.com/ai/nanoid) package with some modifications.
|
|
57
|
-
*
|
|
58
|
-
* @param param - The parameter to use for the unique identifier, can be a string or number
|
|
59
|
-
* @param size - The size of the string to generate. Defaults to 21 if not provided.
|
|
60
|
-
* @returns A unique identifier following the nanoid format
|
|
61
|
-
*/
|
|
62
|
-
export function uniqueId(param?: string | number | undefined, size?: number | undefined): string {
|
|
63
|
-
if (typeof param === "number") {
|
|
64
|
-
size = param;
|
|
65
|
-
} else if (!param || !size) {
|
|
66
|
-
size = 21; // Default size if not provided
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Use our custom getRandom function to fill a Uint8Array with random values.
|
|
70
|
-
const randomBytes = getRandom(new Uint8Array(typeof param === "string" ? size - (param.length + 1) : size));
|
|
71
|
-
|
|
72
|
-
let result = "";
|
|
73
|
-
if (typeof param === "string") {
|
|
74
|
-
// If the parameter is a string, use it as a prefix.
|
|
75
|
-
result = param + "_";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return result + randomBytes.reduce((id, byte) => {
|
|
79
|
-
// It is incorrect to use bytes exceeding the alphabet size.
|
|
80
|
-
// The following mask reduces the random byte in the 0-255 value
|
|
81
|
-
// range to the 0-63 value range. Therefore, adding hacks, such
|
|
82
|
-
// as empty string fallback or magic numbers, is unnecessary because
|
|
83
|
-
// the bitmask trims bytes down to the alphabet size.
|
|
84
|
-
byte &= 63;
|
|
85
|
-
if (byte < 36) {
|
|
86
|
-
// \`0-9a-z\`
|
|
87
|
-
id += byte.toString(36);
|
|
88
|
-
} else if (byte < 62) {
|
|
89
|
-
// \`A-Z\`
|
|
90
|
-
id += (byte - 26).toString(36).toUpperCase();
|
|
91
|
-
} else if (byte > 62) {
|
|
92
|
-
id += "-";
|
|
93
|
-
} else {
|
|
94
|
-
id += "_";
|
|
95
|
-
}
|
|
96
|
-
return id;
|
|
97
|
-
}, "");
|
|
98
|
-
}
|
|
99
|
-
`}export{r as t};
|