@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.
Files changed (58) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  2. package/dist/components/index.cjs +1 -1
  3. package/dist/components/index.d.cts +1 -3
  4. package/dist/components/index.d.mts +1 -3
  5. package/dist/components/index.mjs +1 -1
  6. package/dist/components/nanoid.cjs +90 -1
  7. package/dist/components/nanoid.d.cts +12 -2
  8. package/dist/components/nanoid.d.mts +12 -2
  9. package/dist/components/nanoid.mjs +90 -1
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.d.cts +3 -4
  12. package/dist/index.d.mts +5 -5
  13. package/dist/index.mjs +1 -1
  14. package/dist/powerlines/src/lib/utilities/file-header.cjs +10 -0
  15. package/dist/powerlines/src/lib/utilities/file-header.mjs +10 -0
  16. package/dist/powerlines/src/types/babel.d.mts +2 -0
  17. package/dist/powerlines/src/types/build.d.cts +139 -0
  18. package/dist/powerlines/src/types/build.d.mts +139 -0
  19. package/dist/powerlines/src/types/commands.d.cts +8 -0
  20. package/dist/powerlines/src/types/commands.d.mts +9 -0
  21. package/dist/powerlines/src/types/config.d.cts +345 -0
  22. package/dist/powerlines/src/types/config.d.mts +345 -0
  23. package/dist/powerlines/src/types/context.d.cts +347 -0
  24. package/dist/powerlines/src/types/context.d.mts +349 -0
  25. package/dist/powerlines/src/types/fs.d.cts +458 -0
  26. package/dist/powerlines/src/types/fs.d.mts +458 -0
  27. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  28. package/dist/powerlines/src/types/plugin.d.cts +232 -0
  29. package/dist/powerlines/src/types/plugin.d.mts +232 -0
  30. package/dist/powerlines/src/types/resolved.d.cts +81 -0
  31. package/dist/powerlines/src/types/resolved.d.mts +81 -0
  32. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  33. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  34. package/dist/types/index.cjs +0 -1
  35. package/dist/types/index.d.cts +1 -2
  36. package/dist/types/index.d.mts +1 -2
  37. package/dist/types/index.mjs +1 -1
  38. package/dist/types/plugin.cjs +0 -1
  39. package/dist/types/plugin.d.cts +37 -1
  40. package/dist/types/plugin.d.mts +37 -1
  41. package/dist/types/plugin.mjs +1 -1
  42. package/package.json +7 -7
  43. package/dist/components-BWLXb7a2.cjs +0 -0
  44. package/dist/components-CeJvJXAB.mjs +0 -1
  45. package/dist/index-9iG2qHLe.d.mts +0 -1
  46. package/dist/index-D4ELpJXS.d.cts +0 -1
  47. package/dist/index-D6CnpA_r.d.cts +0 -1
  48. package/dist/index-DL0uimUT.d.mts +0 -1
  49. package/dist/nanoid-BEJDhi9o.d.cts +0 -13
  50. package/dist/nanoid-BG_lCiEX.d.mts +0 -13
  51. package/dist/nanoid-BMwJGbL3.cjs +0 -99
  52. package/dist/nanoid-Clx2gSOJ.mjs +0 -99
  53. package/dist/plugin-9oupXQGY.d.mts +0 -1672
  54. package/dist/plugin-BjiGfRHE.mjs +0 -1
  55. package/dist/plugin-DAFqTL_r.d.cts +0 -1672
  56. package/dist/plugin-pBKbb5K9.cjs +0 -0
  57. package/dist/types-n6NgD0QK.mjs +0 -1
  58. 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.65",
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.59",
132
- "@stryke/path": "^0.22.0",
131
+ "@storm-software/config-tools": "^1.188.60",
132
+ "@stryke/path": "^0.22.11",
133
133
  "defu": "^6.1.4",
134
- "powerlines": "^0.30.8"
134
+ "powerlines": "^0.30.10"
135
135
  },
136
136
  "devDependencies": {
137
- "@powerlines/nx": "^0.10.57",
138
- "@storm-software/tsup": "^0.2.57",
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": "b6cd904eada6483fffd8791e64febb309d73f399"
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 };
@@ -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}});
@@ -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};