storybook 10.1.0-alpha.10 → 10.1.0-alpha.12

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 (192) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  5. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  6. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  7. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  8. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  9. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-74YHFU5B.js} +44 -109
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/chunk-BE2DAXKJ.js +2966 -0
  15. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  16. package/dist/_browser-chunks/chunk-EBHB6RPS.js +61 -0
  17. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  18. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  19. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  20. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-QMY4G4R2.js → chunk-L4RMQ7D7.js} +17 -64
  26. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  27. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  28. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  29. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  30. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  31. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  32. package/dist/_browser-chunks/chunk-WXP2XJ3O.js +950 -0
  33. package/dist/_browser-chunks/chunk-X3DUQ5RA.js +47 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-RJZASWHL.js → syntaxhighlighter-WKBQ5RC7.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-HA7CYFCK.js → builder-manager-YUOHSIUB.js} +475 -1013
  40. package/dist/_node-chunks/camelcase-JREIL7NV.js +18 -0
  41. package/dist/_node-chunks/{chunk-RMHAL25C.js → chunk-2D2IODUU.js} +88 -228
  42. package/dist/_node-chunks/chunk-2DMESZFJ.js +943 -0
  43. package/dist/_node-chunks/chunk-4FT2DHGE.js +3009 -0
  44. package/dist/_node-chunks/chunk-5HV3B5OP.js +45571 -0
  45. package/dist/_node-chunks/{chunk-OVXB5GGT.js → chunk-5KLIDWFN.js} +292 -688
  46. package/dist/_node-chunks/chunk-A4APXFQ2.js +759 -0
  47. package/dist/_node-chunks/chunk-B6JWY6PC.js +37 -0
  48. package/dist/_node-chunks/chunk-CZ5GHJCC.js +603 -0
  49. package/dist/_node-chunks/chunk-DUXPWBOK.js +61 -0
  50. package/dist/_node-chunks/chunk-DWXTZT3D.js +58 -0
  51. package/dist/_node-chunks/chunk-E5FJS66Z.js +20 -0
  52. package/dist/_node-chunks/chunk-EZWWR7AR.js +936 -0
  53. package/dist/_node-chunks/chunk-FDXFVHIL.js +1114 -0
  54. package/dist/_node-chunks/{chunk-F3XOPI6H.js → chunk-FZLRAH4N.js} +469 -983
  55. package/dist/_node-chunks/chunk-HZG65SU3.js +34 -0
  56. package/dist/_node-chunks/chunk-IXVYNBMD.js +18 -0
  57. package/dist/_node-chunks/chunk-JARUEMEP.js +4523 -0
  58. package/dist/_node-chunks/chunk-LIH7MTP7.js +3214 -0
  59. package/dist/_node-chunks/chunk-N5GIRUP5.js +1047 -0
  60. package/dist/_node-chunks/{chunk-X4XU27M6.js → chunk-NAOYEL54.js} +15 -24
  61. package/dist/_node-chunks/chunk-O5DA7YLO.js +3171 -0
  62. package/dist/_node-chunks/chunk-OP3INKUD.js +54 -0
  63. package/dist/_node-chunks/chunk-QCO2ZM7F.js +209 -0
  64. package/dist/_node-chunks/chunk-QYQIZBS6.js +26 -0
  65. package/dist/_node-chunks/chunk-SEMIAAWG.js +1564 -0
  66. package/dist/_node-chunks/chunk-TS2UUH2J.js +301 -0
  67. package/dist/_node-chunks/chunk-WA6KZQZ2.js +119 -0
  68. package/dist/_node-chunks/{chunk-ZHSCUGNP.js → chunk-WFLWJO24.js} +3799 -7849
  69. package/dist/_node-chunks/chunk-WUXQMQCB.js +72 -0
  70. package/dist/_node-chunks/{chunk-VPR5IBMG.js → chunk-XXPJ7XR3.js} +8 -10
  71. package/dist/_node-chunks/chunk-Y4E6IGQF.js +61 -0
  72. package/dist/_node-chunks/chunk-ZL3AFKRX.js +1029 -0
  73. package/dist/_node-chunks/chunk-ZXSD6L3S.js +756 -0
  74. package/dist/_node-chunks/dist-DS2B5A3J.js +121 -0
  75. package/dist/_node-chunks/globby-6THB7HVX.js +3452 -0
  76. package/dist/_node-chunks/lib-5NKX4YGG.js +366 -0
  77. package/dist/_node-chunks/mdx-N42X6CFJ-ZLT3QOFF.js +14329 -0
  78. package/dist/_node-chunks/p-limit-PDMWNG7W.js +116 -0
  79. package/dist/_node-chunks/plugin-6XMWOGPO.js +123 -0
  80. package/dist/_node-chunks/{plugin-6ZPCS4LI.js → plugin-LTOXVT6A.js} +36 -56
  81. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +46582 -0
  82. package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +92 -0
  83. package/dist/actions/decorator.js +21 -42
  84. package/dist/actions/index.js +3 -3
  85. package/dist/babel/index.d.ts +671 -335
  86. package/dist/babel/index.js +11 -11
  87. package/dist/bin/core.js +592 -1546
  88. package/dist/bin/dispatcher.js +26 -37
  89. package/dist/bin/loader.js +23 -34
  90. package/dist/channels/index.js +98 -234
  91. package/dist/cli/index.js +1951 -5308
  92. package/dist/client-logger/index.js +31 -61
  93. package/dist/common/index.js +20 -20
  94. package/dist/components/index.js +4211 -8586
  95. package/dist/core-events/index.js +2 -66
  96. package/dist/core-server/index.js +3054 -7290
  97. package/dist/core-server/presets/common-manager.css +2 -2
  98. package/dist/core-server/presets/common-manager.js +1806 -3427
  99. package/dist/core-server/presets/common-override-preset.js +31 -60
  100. package/dist/core-server/presets/common-preset.js +434 -924
  101. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +15 -19
  102. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +12 -17
  103. package/dist/csf/index.js +534 -1179
  104. package/dist/csf-tools/index.js +9 -9
  105. package/dist/docs-tools/index.js +6 -6
  106. package/dist/highlight/index.js +2 -2
  107. package/dist/instrumenter/index.js +199 -415
  108. package/dist/manager/globals-runtime.js +24150 -47364
  109. package/dist/manager/globals.js +2 -3
  110. package/dist/manager/runtime.js +3961 -8373
  111. package/dist/manager-api/index.js +1231 -2425
  112. package/dist/manager-errors.d.ts +3 -0
  113. package/dist/manager-errors.js +3 -3
  114. package/dist/node-logger/index.js +1253 -2601
  115. package/dist/preview/globals.js +2 -3
  116. package/dist/preview/runtime.js +10364 -21990
  117. package/dist/preview-api/index.d.ts +67 -68
  118. package/dist/preview-api/index.js +13 -13
  119. package/dist/preview-errors.d.ts +3 -0
  120. package/dist/preview-errors.js +4 -4
  121. package/dist/router/index.js +347 -899
  122. package/dist/server-errors.d.ts +3 -0
  123. package/dist/server-errors.js +10 -10
  124. package/dist/telemetry/index.js +24 -24
  125. package/dist/test/index.js +5860 -11645
  126. package/dist/theming/create.js +4 -4
  127. package/dist/theming/index.d.ts +3363 -2597
  128. package/dist/theming/index.js +490 -1086
  129. package/dist/types/index.js +2 -11
  130. package/dist/viewport/index.js +3 -3
  131. package/package.json +5 -5
  132. package/dist/_browser-chunks/Color-FQNEU7YS.js +0 -1695
  133. package/dist/_browser-chunks/WithTooltip-6NHN2GXF.js +0 -2343
  134. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  135. package/dist/_browser-chunks/chunk-AW46NMGV.js +0 -1308
  136. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  137. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  138. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  139. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  140. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  141. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  142. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  143. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  144. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  145. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  146. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  147. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  148. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  149. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  150. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  151. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  152. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  153. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  154. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  155. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  156. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  157. package/dist/_node-chunks/camelcase-QALD4XFE.js +0 -18
  158. package/dist/_node-chunks/chunk-2XY53ALL.js +0 -420
  159. package/dist/_node-chunks/chunk-3CBQMG2A.js +0 -6712
  160. package/dist/_node-chunks/chunk-3WDAPZYQ.js +0 -28
  161. package/dist/_node-chunks/chunk-4ZB555EJ.js +0 -697
  162. package/dist/_node-chunks/chunk-52DXKXY3.js +0 -4272
  163. package/dist/_node-chunks/chunk-5OVB4A6F.js +0 -69
  164. package/dist/_node-chunks/chunk-AGHGNXGH.js +0 -18
  165. package/dist/_node-chunks/chunk-B23X5ZCK.js +0 -1531
  166. package/dist/_node-chunks/chunk-B2DAHWJK.js +0 -220
  167. package/dist/_node-chunks/chunk-CC4PW5MJ.js +0 -34
  168. package/dist/_node-chunks/chunk-D7NIZELR.js +0 -2256
  169. package/dist/_node-chunks/chunk-DO5Q3H4L.js +0 -1250
  170. package/dist/_node-chunks/chunk-ECK7WVFX.js +0 -304
  171. package/dist/_node-chunks/chunk-EUH3NHXA.js +0 -79
  172. package/dist/_node-chunks/chunk-FOQHPHCV.js +0 -1657
  173. package/dist/_node-chunks/chunk-G6EL47NS.js +0 -111
  174. package/dist/_node-chunks/chunk-GFLS4TJB.js +0 -90
  175. package/dist/_node-chunks/chunk-J3XZKWHE.js +0 -1586
  176. package/dist/_node-chunks/chunk-LE63EHJ5.js +0 -1518
  177. package/dist/_node-chunks/chunk-M47XA42S.js +0 -4741
  178. package/dist/_node-chunks/chunk-OOI74AL3.js +0 -61
  179. package/dist/_node-chunks/chunk-PRJHT3GJ.js +0 -61
  180. package/dist/_node-chunks/chunk-Q52PVUSU.js +0 -101
  181. package/dist/_node-chunks/chunk-SDCF5RNN.js +0 -1198
  182. package/dist/_node-chunks/chunk-UJ5SJ23M.js +0 -5029
  183. package/dist/_node-chunks/chunk-UPHK4ETU.js +0 -64658
  184. package/dist/_node-chunks/chunk-V7VURIPB.js +0 -1544
  185. package/dist/_node-chunks/dist-6TXHNR5C.js +0 -175
  186. package/dist/_node-chunks/globby-PBTV6PX6.js +0 -5222
  187. package/dist/_node-chunks/lib-4RTDZVGX.js +0 -518
  188. package/dist/_node-chunks/mdx-N42X6CFJ-COWEH7KR.js +0 -22017
  189. package/dist/_node-chunks/p-limit-PBVZQOFY.js +0 -168
  190. package/dist/_node-chunks/plugin-EOZKYZAG.js +0 -159
  191. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-35HMSMR5.js +0 -69102
  192. package/dist/_node-chunks/webpack-mock-plugin-GT3MA5E2.js +0 -124
@@ -1,518 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __commonJS,
14
- __name,
15
- __require,
16
- __toESM
17
- } from "./chunk-OOI74AL3.js";
18
-
19
- // ../node_modules/app-root-dir/lib/index.js
20
- var require_lib = __commonJS({
21
- "../node_modules/app-root-dir/lib/index.js"(exports) {
22
- var GLOBAL_KEY = "app-root-dir";
23
- var _rootDir;
24
- exports.get = function() {
25
- var dir = global[GLOBAL_KEY];
26
- if (dir) {
27
- return dir;
28
- }
29
- if (_rootDir === void 0) {
30
- var fs2 = __require("fs");
31
- var path2 = __require("path");
32
- var NODE_MODULES = path2.sep + "node_modules" + path2.sep;
33
- var cwd = process.cwd();
34
- var pos = cwd.indexOf(NODE_MODULES);
35
- if (pos !== -1) {
36
- _rootDir = cwd.substring(0, pos);
37
- } else if (fs2.existsSync(path2.join(cwd, "package.json"))) {
38
- _rootDir = cwd;
39
- } else {
40
- pos = __dirname.indexOf(NODE_MODULES);
41
- if (pos === -1) {
42
- _rootDir = path2.normalize(path2.join(__dirname, ".."));
43
- } else {
44
- _rootDir = __dirname.substring(0, pos);
45
- }
46
- }
47
- }
48
- return _rootDir;
49
- };
50
- exports.set = function(dir) {
51
- global[GLOBAL_KEY] = _rootDir = dir;
52
- };
53
- }
54
- });
55
-
56
- // ../node_modules/dotenv/package.json
57
- var require_package = __commonJS({
58
- "../node_modules/dotenv/package.json"(exports, module) {
59
- module.exports = {
60
- name: "dotenv",
61
- version: "16.6.1",
62
- description: "Loads environment variables from .env file",
63
- main: "lib/main.js",
64
- types: "lib/main.d.ts",
65
- exports: {
66
- ".": {
67
- types: "./lib/main.d.ts",
68
- require: "./lib/main.js",
69
- default: "./lib/main.js"
70
- },
71
- "./config": "./config.js",
72
- "./config.js": "./config.js",
73
- "./lib/env-options": "./lib/env-options.js",
74
- "./lib/env-options.js": "./lib/env-options.js",
75
- "./lib/cli-options": "./lib/cli-options.js",
76
- "./lib/cli-options.js": "./lib/cli-options.js",
77
- "./package.json": "./package.json"
78
- },
79
- scripts: {
80
- "dts-check": "tsc --project tests/types/tsconfig.json",
81
- lint: "standard",
82
- pretest: "npm run lint && npm run dts-check",
83
- test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
84
- "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
85
- prerelease: "npm test",
86
- release: "standard-version"
87
- },
88
- repository: {
89
- type: "git",
90
- url: "git://github.com/motdotla/dotenv.git"
91
- },
92
- homepage: "https://github.com/motdotla/dotenv#readme",
93
- funding: "https://dotenvx.com",
94
- keywords: [
95
- "dotenv",
96
- "env",
97
- ".env",
98
- "environment",
99
- "variables",
100
- "config",
101
- "settings"
102
- ],
103
- readmeFilename: "README.md",
104
- license: "BSD-2-Clause",
105
- devDependencies: {
106
- "@types/node": "^18.11.3",
107
- decache: "^4.6.2",
108
- sinon: "^14.0.1",
109
- standard: "^17.0.0",
110
- "standard-version": "^9.5.0",
111
- tap: "^19.2.0",
112
- typescript: "^4.8.4"
113
- },
114
- engines: {
115
- node: ">=12"
116
- },
117
- browser: {
118
- fs: false
119
- }
120
- };
121
- }
122
- });
123
-
124
- // ../node_modules/dotenv/lib/main.js
125
- var require_main = __commonJS({
126
- "../node_modules/dotenv/lib/main.js"(exports, module) {
127
- var fs2 = __require("fs");
128
- var path2 = __require("path");
129
- var os = __require("os");
130
- var crypto = __require("crypto");
131
- var packageJson = require_package();
132
- var version = packageJson.version;
133
- var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
134
- function parse(src) {
135
- const obj = {};
136
- let lines = src.toString();
137
- lines = lines.replace(/\r\n?/mg, "\n");
138
- let match;
139
- while ((match = LINE.exec(lines)) != null) {
140
- const key = match[1];
141
- let value = match[2] || "";
142
- value = value.trim();
143
- const maybeQuote = value[0];
144
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
145
- if (maybeQuote === '"') {
146
- value = value.replace(/\\n/g, "\n");
147
- value = value.replace(/\\r/g, "\r");
148
- }
149
- obj[key] = value;
150
- }
151
- return obj;
152
- }
153
- __name(parse, "parse");
154
- function _parseVault(options) {
155
- options = options || {};
156
- const vaultPath = _vaultPath(options);
157
- options.path = vaultPath;
158
- const result = DotenvModule.configDotenv(options);
159
- if (!result.parsed) {
160
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
161
- err.code = "MISSING_DATA";
162
- throw err;
163
- }
164
- const keys = _dotenvKey(options).split(",");
165
- const length = keys.length;
166
- let decrypted;
167
- for (let i = 0; i < length; i++) {
168
- try {
169
- const key = keys[i].trim();
170
- const attrs = _instructions(result, key);
171
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
172
- break;
173
- } catch (error) {
174
- if (i + 1 >= length) {
175
- throw error;
176
- }
177
- }
178
- }
179
- return DotenvModule.parse(decrypted);
180
- }
181
- __name(_parseVault, "_parseVault");
182
- function _warn(message) {
183
- console.log(`[dotenv@${version}][WARN] ${message}`);
184
- }
185
- __name(_warn, "_warn");
186
- function _debug(message) {
187
- console.log(`[dotenv@${version}][DEBUG] ${message}`);
188
- }
189
- __name(_debug, "_debug");
190
- function _log(message) {
191
- console.log(`[dotenv@${version}] ${message}`);
192
- }
193
- __name(_log, "_log");
194
- function _dotenvKey(options) {
195
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
196
- return options.DOTENV_KEY;
197
- }
198
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
199
- return process.env.DOTENV_KEY;
200
- }
201
- return "";
202
- }
203
- __name(_dotenvKey, "_dotenvKey");
204
- function _instructions(result, dotenvKey) {
205
- let uri;
206
- try {
207
- uri = new URL(dotenvKey);
208
- } catch (error) {
209
- if (error.code === "ERR_INVALID_URL") {
210
- const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
211
- err.code = "INVALID_DOTENV_KEY";
212
- throw err;
213
- }
214
- throw error;
215
- }
216
- const key = uri.password;
217
- if (!key) {
218
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
219
- err.code = "INVALID_DOTENV_KEY";
220
- throw err;
221
- }
222
- const environment = uri.searchParams.get("environment");
223
- if (!environment) {
224
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
225
- err.code = "INVALID_DOTENV_KEY";
226
- throw err;
227
- }
228
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
229
- const ciphertext = result.parsed[environmentKey];
230
- if (!ciphertext) {
231
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
232
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
233
- throw err;
234
- }
235
- return { ciphertext, key };
236
- }
237
- __name(_instructions, "_instructions");
238
- function _vaultPath(options) {
239
- let possibleVaultPath = null;
240
- if (options && options.path && options.path.length > 0) {
241
- if (Array.isArray(options.path)) {
242
- for (const filepath of options.path) {
243
- if (fs2.existsSync(filepath)) {
244
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
245
- }
246
- }
247
- } else {
248
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
249
- }
250
- } else {
251
- possibleVaultPath = path2.resolve(process.cwd(), ".env.vault");
252
- }
253
- if (fs2.existsSync(possibleVaultPath)) {
254
- return possibleVaultPath;
255
- }
256
- return null;
257
- }
258
- __name(_vaultPath, "_vaultPath");
259
- function _resolveHome(envPath) {
260
- return envPath[0] === "~" ? path2.join(os.homedir(), envPath.slice(1)) : envPath;
261
- }
262
- __name(_resolveHome, "_resolveHome");
263
- function _configVault(options) {
264
- const debug = Boolean(options && options.debug);
265
- const quiet = options && "quiet" in options ? options.quiet : true;
266
- if (debug || !quiet) {
267
- _log("Loading env from encrypted .env.vault");
268
- }
269
- const parsed = DotenvModule._parseVault(options);
270
- let processEnv = process.env;
271
- if (options && options.processEnv != null) {
272
- processEnv = options.processEnv;
273
- }
274
- DotenvModule.populate(processEnv, parsed, options);
275
- return { parsed };
276
- }
277
- __name(_configVault, "_configVault");
278
- function configDotenv(options) {
279
- const dotenvPath = path2.resolve(process.cwd(), ".env");
280
- let encoding = "utf8";
281
- const debug = Boolean(options && options.debug);
282
- const quiet = options && "quiet" in options ? options.quiet : true;
283
- if (options && options.encoding) {
284
- encoding = options.encoding;
285
- } else {
286
- if (debug) {
287
- _debug("No encoding is specified. UTF-8 is used by default");
288
- }
289
- }
290
- let optionPaths = [dotenvPath];
291
- if (options && options.path) {
292
- if (!Array.isArray(options.path)) {
293
- optionPaths = [_resolveHome(options.path)];
294
- } else {
295
- optionPaths = [];
296
- for (const filepath of options.path) {
297
- optionPaths.push(_resolveHome(filepath));
298
- }
299
- }
300
- }
301
- let lastError;
302
- const parsedAll = {};
303
- for (const path3 of optionPaths) {
304
- try {
305
- const parsed = DotenvModule.parse(fs2.readFileSync(path3, { encoding }));
306
- DotenvModule.populate(parsedAll, parsed, options);
307
- } catch (e) {
308
- if (debug) {
309
- _debug(`Failed to load ${path3} ${e.message}`);
310
- }
311
- lastError = e;
312
- }
313
- }
314
- let processEnv = process.env;
315
- if (options && options.processEnv != null) {
316
- processEnv = options.processEnv;
317
- }
318
- DotenvModule.populate(processEnv, parsedAll, options);
319
- if (debug || !quiet) {
320
- const keysCount = Object.keys(parsedAll).length;
321
- const shortPaths = [];
322
- for (const filePath of optionPaths) {
323
- try {
324
- const relative = path2.relative(process.cwd(), filePath);
325
- shortPaths.push(relative);
326
- } catch (e) {
327
- if (debug) {
328
- _debug(`Failed to load ${filePath} ${e.message}`);
329
- }
330
- lastError = e;
331
- }
332
- }
333
- _log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
334
- }
335
- if (lastError) {
336
- return { parsed: parsedAll, error: lastError };
337
- } else {
338
- return { parsed: parsedAll };
339
- }
340
- }
341
- __name(configDotenv, "configDotenv");
342
- function config(options) {
343
- if (_dotenvKey(options).length === 0) {
344
- return DotenvModule.configDotenv(options);
345
- }
346
- const vaultPath = _vaultPath(options);
347
- if (!vaultPath) {
348
- _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
349
- return DotenvModule.configDotenv(options);
350
- }
351
- return DotenvModule._configVault(options);
352
- }
353
- __name(config, "config");
354
- function decrypt(encrypted, keyStr) {
355
- const key = Buffer.from(keyStr.slice(-64), "hex");
356
- let ciphertext = Buffer.from(encrypted, "base64");
357
- const nonce = ciphertext.subarray(0, 12);
358
- const authTag = ciphertext.subarray(-16);
359
- ciphertext = ciphertext.subarray(12, -16);
360
- try {
361
- const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
362
- aesgcm.setAuthTag(authTag);
363
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
364
- } catch (error) {
365
- const isRange = error instanceof RangeError;
366
- const invalidKeyLength = error.message === "Invalid key length";
367
- const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
368
- if (isRange || invalidKeyLength) {
369
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
370
- err.code = "INVALID_DOTENV_KEY";
371
- throw err;
372
- } else if (decryptionFailed) {
373
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
374
- err.code = "DECRYPTION_FAILED";
375
- throw err;
376
- } else {
377
- throw error;
378
- }
379
- }
380
- }
381
- __name(decrypt, "decrypt");
382
- function populate(processEnv, parsed, options = {}) {
383
- const debug = Boolean(options && options.debug);
384
- const override = Boolean(options && options.override);
385
- if (typeof parsed !== "object") {
386
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
387
- err.code = "OBJECT_REQUIRED";
388
- throw err;
389
- }
390
- for (const key of Object.keys(parsed)) {
391
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
392
- if (override === true) {
393
- processEnv[key] = parsed[key];
394
- }
395
- if (debug) {
396
- if (override === true) {
397
- _debug(`"${key}" is already defined and WAS overwritten`);
398
- } else {
399
- _debug(`"${key}" is already defined and was NOT overwritten`);
400
- }
401
- }
402
- } else {
403
- processEnv[key] = parsed[key];
404
- }
405
- }
406
- }
407
- __name(populate, "populate");
408
- var DotenvModule = {
409
- configDotenv,
410
- _configVault,
411
- _parseVault,
412
- config,
413
- decrypt,
414
- parse,
415
- populate
416
- };
417
- module.exports.configDotenv = DotenvModule.configDotenv;
418
- module.exports._configVault = DotenvModule._configVault;
419
- module.exports._parseVault = DotenvModule._parseVault;
420
- module.exports.config = DotenvModule.config;
421
- module.exports.decrypt = DotenvModule.decrypt;
422
- module.exports.parse = DotenvModule.parse;
423
- module.exports.populate = DotenvModule.populate;
424
- module.exports = DotenvModule;
425
- }
426
- });
427
-
428
- // ../node_modules/lazy-universal-dotenv/node_modules/dotenv-expand/lib/main.js
429
- var require_main2 = __commonJS({
430
- "../node_modules/lazy-universal-dotenv/node_modules/dotenv-expand/lib/main.js"(exports, module) {
431
- "use strict";
432
- function _searchLast(str, rgx) {
433
- const matches = Array.from(str.matchAll(rgx));
434
- return matches.length > 0 ? matches.slice(-1)[0].index : -1;
435
- }
436
- __name(_searchLast, "_searchLast");
437
- function _interpolate(envValue, environment, config) {
438
- const lastUnescapedDollarSignIndex = _searchLast(envValue, /(?!(?<=\\))\$/g);
439
- if (lastUnescapedDollarSignIndex === -1) return envValue;
440
- const rightMostGroup = envValue.slice(lastUnescapedDollarSignIndex);
441
- const matchGroup = /((?!(?<=\\))\${?([\w]+)(?::-([^}\\]*))?}?)/;
442
- const match = rightMostGroup.match(matchGroup);
443
- if (match != null) {
444
- const [, group, variableName, defaultValue] = match;
445
- return _interpolate(
446
- envValue.replace(
447
- group,
448
- environment[variableName] || defaultValue || config.parsed[variableName] || ""
449
- ),
450
- environment,
451
- config
452
- );
453
- }
454
- return envValue;
455
- }
456
- __name(_interpolate, "_interpolate");
457
- function _resolveEscapeSequences(value) {
458
- return value.replace(/\\\$/g, "$");
459
- }
460
- __name(_resolveEscapeSequences, "_resolveEscapeSequences");
461
- function expand(config) {
462
- const environment = config.ignoreProcessEnv ? {} : process.env;
463
- for (const configKey in config.parsed) {
464
- const value = Object.prototype.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey];
465
- config.parsed[configKey] = _resolveEscapeSequences(
466
- _interpolate(value, environment, config)
467
- );
468
- }
469
- for (const processKey in config.parsed) {
470
- environment[processKey] = config.parsed[processKey];
471
- }
472
- return config;
473
- }
474
- __name(expand, "expand");
475
- module.exports.expand = expand;
476
- }
477
- });
478
-
479
- // ../node_modules/lazy-universal-dotenv/lib/index.mjs
480
- var import_app_root_dir = __toESM(require_lib(), 1);
481
- var import_dotenv = __toESM(require_main(), 1);
482
- var import_dotenv_expand = __toESM(require_main2(), 1);
483
- import fs from "fs";
484
- import path from "path";
485
- var dotEnvBase = path.join(import_app_root_dir.default.get(), ".env");
486
- function getEnvironment({ nodeEnv, buildTarget } = {}) {
487
- let raw = {};
488
- const stringified = {};
489
- const webpack = { "process.env": stringified };
490
- const NODE_ENV = typeof nodeEnv === "undefined" ? process.env.NODE_ENV : nodeEnv;
491
- const BUILD_TARGET = typeof nodeEnv === "undefined" ? process.env.BUILD_TARGET : buildTarget;
492
- const dotenvFiles = [
493
- BUILD_TARGET && NODE_ENV && `${dotEnvBase}.${BUILD_TARGET}.${NODE_ENV}.local`,
494
- BUILD_TARGET && NODE_ENV && `${dotEnvBase}.${BUILD_TARGET}.${NODE_ENV}`,
495
- BUILD_TARGET && NODE_ENV !== "test" && `${dotEnvBase}.${BUILD_TARGET}.local`,
496
- BUILD_TARGET && `${dotEnvBase}.${BUILD_TARGET}`,
497
- NODE_ENV && `${dotEnvBase}.${NODE_ENV}.local`,
498
- NODE_ENV && `${dotEnvBase}.${NODE_ENV}`,
499
- NODE_ENV !== "test" && `${dotEnvBase}.local`,
500
- dotEnvBase
501
- ].filter(Boolean);
502
- dotenvFiles.forEach((dotenvFile) => {
503
- if (fs.existsSync(dotenvFile)) {
504
- const config = import_dotenv.default.config({
505
- path: dotenvFile
506
- });
507
- raw = Object.assign({}, raw, import_dotenv_expand.default.expand(config).parsed);
508
- }
509
- });
510
- Object.keys(raw).forEach((key) => {
511
- stringified[key] = JSON.stringify(raw[key]);
512
- });
513
- return { raw, stringified, webpack };
514
- }
515
- __name(getEnvironment, "getEnvironment");
516
- export {
517
- getEnvironment
518
- };