storybook 10.1.0-alpha.9 → 10.1.0-beta.1

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 (198) 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-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
  5. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  6. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  7. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  8. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  9. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  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-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  15. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  16. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  17. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  18. package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
  19. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  20. package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -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-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
  26. package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
  27. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  28. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  29. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  30. package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
  31. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  32. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  33. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -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-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-SM3UWERX.js → builder-manager-FTVC2JL7.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3SMT5WKC.js +37 -0
  41. package/dist/_node-chunks/chunk-2OVULPK3.js +54 -0
  42. package/dist/_node-chunks/chunk-3JJPSDXI.js +3043 -0
  43. package/dist/_node-chunks/chunk-54NMJ4II.js +1564 -0
  44. package/dist/_node-chunks/chunk-5V4A6MSI.js +943 -0
  45. package/dist/_node-chunks/chunk-6DEMT5VX.js +299 -0
  46. package/dist/_node-chunks/{chunk-HHSTA6QS.js → chunk-6L7FFBOW.js} +8 -10
  47. package/dist/_node-chunks/chunk-6ULDIDXV.js +46662 -0
  48. package/dist/_node-chunks/chunk-AREL5IXS.js +603 -0
  49. package/dist/_node-chunks/chunk-DWA53E73.js +23 -0
  50. package/dist/_node-chunks/chunk-FNYKBULZ.js +765 -0
  51. package/dist/_node-chunks/chunk-IUYZQKSX.js +70 -0
  52. package/dist/_node-chunks/{chunk-F6EFOEC7.js → chunk-K673CX4Q.js} +469 -983
  53. package/dist/_node-chunks/chunk-KJAFCNZ3.js +61 -0
  54. package/dist/_node-chunks/chunk-N3BJOOY5.js +78 -0
  55. package/dist/_node-chunks/{chunk-EBUEXRH5.js → chunk-O5FMCQHP.js} +116 -276
  56. package/dist/_node-chunks/chunk-RIKQZHV3.js +29 -0
  57. package/dist/_node-chunks/chunk-RURZIE3W.js +3780 -0
  58. package/dist/_node-chunks/chunk-RVII4SK6.js +919 -0
  59. package/dist/_node-chunks/chunk-S3PBHOVC.js +6024 -0
  60. package/dist/_node-chunks/chunk-SQSFX47N.js +61 -0
  61. package/dist/_node-chunks/{chunk-SGM3ZCCT.js → chunk-TURUTKVH.js} +292 -688
  62. package/dist/_node-chunks/chunk-VRICJPXY.js +72 -0
  63. package/dist/_node-chunks/chunk-WIWWMCEU.js +119 -0
  64. package/dist/_node-chunks/{chunk-ATDHMMIZ.js → chunk-XGNRK7QB.js} +15 -24
  65. package/dist/_node-chunks/chunk-Y2FOTPAE.js +4523 -0
  66. package/dist/_node-chunks/{chunk-GHIBZRKD.js → chunk-Y4UYN72K.js} +8133 -8887
  67. package/dist/_node-chunks/chunk-Z4BMBA5L.js +18 -0
  68. package/dist/_node-chunks/chunk-ZMCJS2GU.js +20 -0
  69. package/dist/_node-chunks/dist-TZLZ3T6L.js +121 -0
  70. package/dist/_node-chunks/globby-22GFCZQD.js +3452 -0
  71. package/dist/_node-chunks/lib-37NQ4ZIJ.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-2TRB7OEH.js +14329 -0
  73. package/dist/_node-chunks/p-limit-UD7TYFDW.js +116 -0
  74. package/dist/actions/decorator.js +21 -42
  75. package/dist/actions/index.js +3 -3
  76. package/dist/babel/index.d.ts +671 -335
  77. package/dist/babel/index.js +10 -11
  78. package/dist/bin/core.js +602 -1549
  79. package/dist/bin/dispatcher.js +36 -36
  80. package/dist/bin/loader.js +24 -38
  81. package/dist/channels/index.js +98 -234
  82. package/dist/cli/index.d.ts +1479 -133
  83. package/dist/cli/index.js +30 -8540
  84. package/dist/client-logger/index.js +31 -61
  85. package/dist/common/index.d.ts +139 -62
  86. package/dist/common/index.js +66 -51
  87. package/dist/components/index.d.ts +575 -273
  88. package/dist/components/index.js +14863 -4313
  89. package/dist/core-events/index.js +2 -66
  90. package/dist/core-server/index.d.ts +3 -2
  91. package/dist/core-server/index.js +2911 -8519
  92. package/dist/core-server/presets/common-manager.css +2 -2
  93. package/dist/core-server/presets/common-manager.js +2521 -5233
  94. package/dist/core-server/presets/common-override-preset.js +31 -60
  95. package/dist/core-server/presets/common-preset.js +663 -962
  96. package/dist/csf/index.js +534 -1179
  97. package/dist/csf-tools/index.js +9 -9
  98. package/dist/docs-tools/index.js +6 -6
  99. package/dist/highlight/index.js +2 -2
  100. package/dist/instrumenter/index.js +199 -415
  101. package/dist/manager/globals-runtime.js +59044 -67141
  102. package/dist/manager/globals.js +2 -3
  103. package/dist/manager/manager-stores.d.ts +1 -0
  104. package/dist/manager/manager-stores.js +23 -0
  105. package/dist/manager/runtime.js +11569 -10953
  106. package/dist/manager-api/index.d.ts +1813 -2
  107. package/dist/manager-api/index.js +1348 -2401
  108. package/dist/manager-errors.d.ts +9 -0
  109. package/dist/manager-errors.js +3 -3
  110. package/dist/mocking-utils/index.d.ts +1126 -0
  111. package/dist/mocking-utils/index.js +1181 -0
  112. package/dist/node-logger/index.d.ts +192 -24
  113. package/dist/node-logger/index.js +23 -4471
  114. package/dist/preview/globals.js +2 -3
  115. package/dist/preview/runtime.js +10799 -22393
  116. package/dist/preview-api/index.d.ts +1 -1
  117. package/dist/preview-api/index.js +13 -13
  118. package/dist/preview-errors.d.ts +9 -0
  119. package/dist/preview-errors.js +4 -4
  120. package/dist/router/index.js +347 -899
  121. package/dist/server-errors.d.ts +34 -1
  122. package/dist/server-errors.js +17 -10
  123. package/dist/telemetry/index.d.ts +24 -3
  124. package/dist/telemetry/index.js +25 -24
  125. package/dist/test/index.js +6131 -11916
  126. package/dist/theming/create.d.ts +1 -0
  127. package/dist/theming/create.js +4 -4
  128. package/dist/theming/index.d.ts +3366 -2599
  129. package/dist/theming/index.js +501 -1091
  130. package/dist/types/index.d.ts +72 -8
  131. package/dist/types/index.js +27 -12
  132. package/dist/viewport/index.js +3 -3
  133. package/package.json +26 -17
  134. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  135. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  136. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  137. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  138. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  139. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  140. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  141. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  142. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  143. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  144. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  145. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  146. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  147. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  148. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  149. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  150. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  151. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  152. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  153. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  154. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  155. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  156. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  157. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  158. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  159. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  160. package/dist/_node-chunks/camelcase-H5QSGQLK.js +0 -18
  161. package/dist/_node-chunks/chunk-3THWHQOC.js +0 -61
  162. package/dist/_node-chunks/chunk-45YUOLTU.js +0 -69
  163. package/dist/_node-chunks/chunk-4QSNCPAU.js +0 -64656
  164. package/dist/_node-chunks/chunk-744PQSOU.js +0 -79
  165. package/dist/_node-chunks/chunk-74Z2U7QG.js +0 -1544
  166. package/dist/_node-chunks/chunk-7MB7TFPO.js +0 -1198
  167. package/dist/_node-chunks/chunk-A7GS4RFT.js +0 -697
  168. package/dist/_node-chunks/chunk-BIA3A5UM.js +0 -61
  169. package/dist/_node-chunks/chunk-C5G7CLWX.js +0 -1657
  170. package/dist/_node-chunks/chunk-DLFUKMYJ.js +0 -1531
  171. package/dist/_node-chunks/chunk-EMRGRXKT.js +0 -111
  172. package/dist/_node-chunks/chunk-EX46EHHY.js +0 -420
  173. package/dist/_node-chunks/chunk-F76QKNOJ.js +0 -304
  174. package/dist/_node-chunks/chunk-HDCRUTEF.js +0 -220
  175. package/dist/_node-chunks/chunk-HUYAOIPH.js +0 -90
  176. package/dist/_node-chunks/chunk-IBJZQZJC.js +0 -101
  177. package/dist/_node-chunks/chunk-KZN2RDDT.js +0 -6712
  178. package/dist/_node-chunks/chunk-LYUNFU3F.js +0 -4741
  179. package/dist/_node-chunks/chunk-N44SIS6K.js +0 -28
  180. package/dist/_node-chunks/chunk-NILZM6KR.js +0 -18
  181. package/dist/_node-chunks/chunk-PC4ZRP6W.js +0 -34
  182. package/dist/_node-chunks/chunk-TJNGOQUH.js +0 -4272
  183. package/dist/_node-chunks/chunk-UBSYLHIL.js +0 -1250
  184. package/dist/_node-chunks/chunk-UTCLXPOC.js +0 -1518
  185. package/dist/_node-chunks/chunk-WOXXODXP.js +0 -5029
  186. package/dist/_node-chunks/chunk-XC4MEUA6.js +0 -1586
  187. package/dist/_node-chunks/chunk-YRXXMKRR.js +0 -2256
  188. package/dist/_node-chunks/dist-SL73W244.js +0 -175
  189. package/dist/_node-chunks/globby-ZSHAUQZ5.js +0 -5222
  190. package/dist/_node-chunks/lib-U2VIPUTI.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-ZLHD33JK.js +0 -22017
  192. package/dist/_node-chunks/p-limit-K5BS5MSV.js +0 -168
  193. package/dist/_node-chunks/plugin-5PD4YIUH.js +0 -129
  194. package/dist/_node-chunks/plugin-MONDT2WL.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-EUZJRG3W.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-T4LDXEHE.js +0 -124
  197. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
  198. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
@@ -1,518 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_jpweijb0qqj from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_jpweijb0qqj from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_jpweijb0qqj from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_jpweijb0qqj.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_jpweijb0qqj.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_jpweijb0qqj.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-3THWHQOC.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
- };