dinou 9.3.0 → 10.0.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 (166) hide show
  1. package/CHANGELOG.md +196 -0
  2. package/README.md +157 -132
  3. package/dinou/adapters/bun.js +34 -5
  4. package/dinou/adapters/cloudflare.js +110 -17
  5. package/dinou/adapters/deno.js +46 -8
  6. package/dinou/adapters/netlify.js +86 -50
  7. package/dinou/adapters/node.js +8 -0
  8. package/dinou/assets.d.ts +32 -5
  9. package/dinou/bun/build.js +190 -106
  10. package/dinou/cli.js +992 -532
  11. package/dinou/cloudflare/build.js +187 -106
  12. package/dinou/compiled/autoprefixer/index.js +509 -517
  13. package/dinou/compiled/babel-core/index.js +738 -716
  14. package/dinou/compiled/babel-generator/index.js +341 -299
  15. package/dinou/compiled/babel-loader/index.js +766 -744
  16. package/dinou/compiled/babel-parser/index.js +2 -2
  17. package/dinou/compiled/babel-plugin-react-compiler/index.js +178 -178
  18. package/dinou/compiled/babel-plugin-syntax-import-meta/index.js +4 -4
  19. package/dinou/compiled/babel-preset-react/index.js +752 -730
  20. package/dinou/compiled/babel-preset-typescript/index.js +738 -716
  21. package/dinou/compiled/babel-traverse/index.js +463 -433
  22. package/dinou/compiled/babel-types/index.js +176 -176
  23. package/dinou/compiled/chokidar/index.js +4 -4
  24. package/dinou/compiled/commander/index.js +15 -15
  25. package/dinou/compiled/copy-webpack-plugin/index.js +433 -425
  26. package/dinou/compiled/css-loader/index.js +289 -289
  27. package/dinou/compiled/css-loader/runtime/api.js +85 -0
  28. package/dinou/compiled/css-loader/runtime/getUrl.js +26 -0
  29. package/dinou/compiled/css-loader/runtime/noSourceMaps.js +5 -0
  30. package/dinou/compiled/css-loader/runtime/package.json +3 -0
  31. package/dinou/compiled/css-loader/runtime/sourceMaps.js +16 -0
  32. package/dinou/compiled/fast-glob/index.js +5810 -0
  33. package/dinou/compiled/generic-names/index.js +16 -16
  34. package/dinou/compiled/mini-css-extract-plugin/{chunk-YYEJWYXE.js → chunk-R6DP5ZYM.js} +36 -36
  35. package/dinou/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +253 -0
  36. package/dinou/compiled/mini-css-extract-plugin/hmr/normalize-url.js +39 -0
  37. package/dinou/compiled/mini-css-extract-plugin/hmr/package.json +3 -0
  38. package/dinou/compiled/mini-css-extract-plugin/index.js +1 -1
  39. package/dinou/compiled/mini-css-extract-plugin/loader.js +5 -5
  40. package/dinou/compiled/postcss/index.js +83 -83
  41. package/dinou/compiled/postcss-import/index.js +147 -117
  42. package/dinou/compiled/postcss-modules/index.js +216 -216
  43. package/dinou/compiled/resolve/index.js +1224 -0
  44. package/dinou/compiled/rollup-plugin-babel/index.js +753 -731
  45. package/dinou/compiled/rollup-plugin-commonjs/index.js +43 -38
  46. package/dinou/compiled/rollup-plugin-delete/index.js +615 -253
  47. package/dinou/compiled/rollup-plugin-json/index.js +22 -18
  48. package/dinou/compiled/rollup-plugin-node-resolve/index.js +130 -100
  49. package/dinou/compiled/rollup-plugin-postcss/index.js +3299 -3277
  50. package/dinou/compiled/rollup-plugin-replace/index.js +34 -29
  51. package/dinou/compiled/tailwindcss-postcss/index.js +214 -211
  52. package/dinou/compiled/vendors-manifest.json +59 -83
  53. package/dinou/core/asset-extensions.js +482 -33
  54. package/dinou/core/bailout-proxy.js +21 -2
  55. package/dinou/core/build-static-pages.js +523 -371
  56. package/dinou/core/builtin-asset-extensions.js +63 -0
  57. package/dinou/core/cache-revalidate.js +449 -256
  58. package/dinou/core/cache-slot.js +289 -79
  59. package/dinou/core/client-webpack.jsx +470 -39
  60. package/dinou/core/client.jsx +402 -39
  61. package/dinou/core/config.js +3 -0
  62. package/dinou/core/copy-static-dirs.js +98 -0
  63. package/dinou/core/createScopedName.js +22 -4
  64. package/dinou/core/dinou-paths.js +1 -1
  65. package/dinou/core/discover-layouts.js +200 -0
  66. package/dinou/core/edge-ssr.js +1 -1
  67. package/dinou/core/ensure-vendor-mode.js +78 -19
  68. package/dinou/core/env.js +544 -0
  69. package/dinou/core/export-static.js +41 -9
  70. package/dinou/core/generate-route-types.js +989 -95
  71. package/dinou/core/generate-static-rsc.js +5 -6
  72. package/dinou/core/generate-static.js +45 -6
  73. package/dinou/core/get-abs-path-with-ext.js +217 -75
  74. package/dinou/core/get-asset-from-manifest.js +19 -8
  75. package/dinou/core/get-error-jsx.js +4 -5
  76. package/dinou/core/get-file-path-and-dynamic-params.js +561 -338
  77. package/dinou/core/get-jsx.js +220 -53
  78. package/dinou/core/handler.js +1647 -466
  79. package/dinou/core/import-module.js +7 -0
  80. package/dinou/core/layout-functions.js +72 -13
  81. package/dinou/core/link.jsx +34 -6
  82. package/dinou/core/load-dinou-config.js +520 -89
  83. package/dinou/core/manifest-provider.js +4 -14
  84. package/dinou/core/navigation-utils.js +141 -3
  85. package/dinou/core/navigation.js +134 -50
  86. package/dinou/core/node-middleware-runner.js +165 -0
  87. package/dinou/core/postcss-pipeline.js +236 -0
  88. package/dinou/core/ppr-context.js +114 -22
  89. package/dinou/core/ppr-runtime.js +391 -127
  90. package/dinou/core/redirect.jsx +1 -1
  91. package/dinou/core/render-jsx-to-client-jsx.js +216 -48
  92. package/dinou/core/request-context.js +59 -3
  93. package/dinou/core/resolve-contextual-dinou.js +523 -0
  94. package/dinou/core/resolve-setup-files.js +85 -27
  95. package/dinou/core/revalidating.js +10 -2
  96. package/dinou/core/route-generator.js +6 -2
  97. package/dinou/core/rsc-renderer.js +4 -1
  98. package/dinou/core/run-ssg.js +6 -0
  99. package/dinou/core/runtime-env.js +265 -0
  100. package/dinou/core/server-css-modules-plugin.js +155 -0
  101. package/dinou/core/server-function-proxy-webpack.js +27 -2
  102. package/dinou/core/server-function-proxy.js +27 -2
  103. package/dinou/core/slot.js +47 -2
  104. package/dinou/core/static-assets.js +503 -0
  105. package/dinou/core/storage-adapter.js +452 -24
  106. package/dinou/core/transform-server-functions.js +272 -24
  107. package/dinou/core/tsconfig-aliases.js +964 -0
  108. package/dinou/core/uneject.js +640 -0
  109. package/dinou/core/url-resolver.js +1 -1
  110. package/dinou/core/vfs.js +11 -2
  111. package/dinou/css.d.ts +4 -1
  112. package/dinou/deno/build.js +205 -153
  113. package/dinou/deno/seed-kv.js +4 -0
  114. package/dinou/env.d.ts +22 -2
  115. package/dinou/esbuild/build.js +40 -50
  116. package/dinou/esbuild/dev.js +33 -7
  117. package/dinou/esbuild/helpers-esbuild/get-config-esbuild-prod.js +41 -16
  118. package/dinou/esbuild/helpers-esbuild/get-config-esbuild.js +51 -49
  119. package/dinou/esbuild/helpers-esbuild/get-esbuild-entries.js +73 -60
  120. package/dinou/esbuild/helpers-esbuild/swc-disk-cache.js +35 -16
  121. package/dinou/esbuild/helpers-esbuild/write.js +13 -3
  122. package/dinou/esbuild/plugins-esbuild/assets-plugin.js +100 -238
  123. package/dinou/esbuild/plugins-esbuild/babel-react-compiler-plugin.js +73 -29
  124. package/dinou/esbuild/plugins-esbuild/css-processor-plugin.js +283 -91
  125. package/dinou/esbuild/plugins-esbuild/manifest-generator-plugin.js +3 -5
  126. package/dinou/esbuild/plugins-esbuild/react-client-manifest-plugin.js +9 -3
  127. package/dinou/esbuild/plugins-esbuild/server-functions-plugin.js +4 -3
  128. package/dinou/esbuild/plugins-esbuild/stable-chunk-names-and-maps-plugin.js +10 -1
  129. package/dinou/esbuild/plugins-postcss/postcss-extract-plugin.js +84 -21
  130. package/dinou/esbuild/react-refresh/esm-hmr/client.js +31 -10
  131. package/dinou/esbuild/react-refresh/esm-hmr-plugin.js +48 -18
  132. package/dinou/esbuild/react-refresh/is-react-refresh-boundary.js +9 -1
  133. package/dinou/esbuild/react-refresh/react-refresh-runtime.js +13 -7
  134. package/dinou/index.d.ts +1028 -88
  135. package/dinou/node/build.js +138 -74
  136. package/dinou/node/bundle-dual-engine.js +393 -131
  137. package/dinou/node/dev.js +1005 -275
  138. package/dinou/package.json +11 -34
  139. package/dinou/rollup/postcss.config.js +3 -4
  140. package/dinou/rollup/react-refresh/esm-hmr/client.js +31 -10
  141. package/dinou/rollup/react-refresh/react-refresh-wrap-modules.js +16 -13
  142. package/dinou/rollup/react-refresh/rollup-plugin-esm-hmr.js +53 -7
  143. package/dinou/rollup/rollup-plugins/dinou-asset-plugin.js +58 -20
  144. package/dinou/rollup/rollup-plugins/manifest-generator-plugin.js +16 -7
  145. package/dinou/rollup/rollup-plugins/rollup-plugin-react-client-manifest.js +118 -42
  146. package/dinou/rollup/rollup-plugins/rollup-plugin-server-functions.js +48 -36
  147. package/dinou/rollup/rollup.config.js +174 -101
  148. package/dinou/scripts/build-vendors.js +123 -33
  149. package/dinou/server.d.ts +126 -15
  150. package/dinou/webpack/helpers/get-webpack-entries.js +87 -41
  151. package/dinou/webpack/helpers/patch-webpack-internals.js +93 -1
  152. package/dinou/webpack/loaders/server-functions-loader.js +1 -1
  153. package/dinou/webpack/plugins/manifest-generator-plugin.js +27 -7
  154. package/dinou/webpack/plugins/server-functions-plugin.js +39 -12
  155. package/dinou/webpack/plugins/webpack-memory-plugin.js +25 -12
  156. package/dinou/webpack/postcss.config.js +3 -4
  157. package/dinou/webpack/webpack.config.js +408 -132
  158. package/eject.js +6 -224
  159. package/package.json +7 -9
  160. package/dinou/compiled/cross-env/index.js +0 -661
  161. package/dinou/compiled/dotenv/index.js +0 -375
  162. package/dinou/compiled/esbuild-copy-static-files/index.js +0 -63
  163. package/dinou/compiled/esbuild-tsconfig-paths/index.js +0 -1314
  164. package/dinou/compiled/rollup-plugin-copy/index.js +0 -12066
  165. package/dinou/compiled/rollup-plugin-tsconfig-paths/index.js +0 -569
  166. package/dinou/compiled/tsconfig-paths-webpack-plugin/index.js +0 -3956
@@ -1,375 +0,0 @@
1
- import { createRequire as __dinou_createRequire } from "node:module";
2
- import { fileURLToPath as __dinou_fileURLToPath } from "node:url";
3
- import __dinou_path from "node:path";
4
- const require = __dinou_createRequire(import.meta.url);
5
- const __filename = __dinou_fileURLToPath(import.meta.url);
6
- const __dirname = __dinou_path.dirname(__filename);
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __commonJS = (cb, mod) => function __require2() {
15
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
- };
17
-
18
- // ../node_modules/dotenv/package.json
19
- var require_package = __commonJS({
20
- "../node_modules/dotenv/package.json"(exports, module) {
21
- module.exports = {
22
- name: "dotenv",
23
- version: "16.6.1",
24
- description: "Loads environment variables from .env file",
25
- main: "lib/main.js",
26
- types: "lib/main.d.ts",
27
- exports: {
28
- ".": {
29
- types: "./lib/main.d.ts",
30
- require: "./lib/main.js",
31
- default: "./lib/main.js"
32
- },
33
- "./config": "./config.js",
34
- "./config.js": "./config.js",
35
- "./lib/env-options": "./lib/env-options.js",
36
- "./lib/env-options.js": "./lib/env-options.js",
37
- "./lib/cli-options": "./lib/cli-options.js",
38
- "./lib/cli-options.js": "./lib/cli-options.js",
39
- "./package.json": "./package.json"
40
- },
41
- scripts: {
42
- "dts-check": "tsc --project tests/types/tsconfig.json",
43
- lint: "standard",
44
- pretest: "npm run lint && npm run dts-check",
45
- test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
46
- "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
47
- prerelease: "npm test",
48
- release: "standard-version"
49
- },
50
- repository: {
51
- type: "git",
52
- url: "git://github.com/motdotla/dotenv.git"
53
- },
54
- homepage: "https://github.com/motdotla/dotenv#readme",
55
- funding: "https://dotenvx.com",
56
- keywords: [
57
- "dotenv",
58
- "env",
59
- ".env",
60
- "environment",
61
- "variables",
62
- "config",
63
- "settings"
64
- ],
65
- readmeFilename: "README.md",
66
- license: "BSD-2-Clause",
67
- devDependencies: {
68
- "@types/node": "^18.11.3",
69
- decache: "^4.6.2",
70
- sinon: "^14.0.1",
71
- standard: "^17.0.0",
72
- "standard-version": "^9.5.0",
73
- tap: "^19.2.0",
74
- typescript: "^4.8.4"
75
- },
76
- engines: {
77
- node: ">=12"
78
- },
79
- browser: {
80
- fs: false
81
- }
82
- };
83
- }
84
- });
85
-
86
- // ../node_modules/dotenv/lib/main.js
87
- var require_main = __commonJS({
88
- "../node_modules/dotenv/lib/main.js"(exports, module) {
89
- var fs = __require("fs");
90
- var path = __require("path");
91
- var os = __require("os");
92
- var crypto = __require("crypto");
93
- var packageJson = require_package();
94
- var version = packageJson.version;
95
- var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
96
- function parse(src) {
97
- const obj = {};
98
- let lines = src.toString();
99
- lines = lines.replace(/\r\n?/mg, "\n");
100
- let match;
101
- while ((match = LINE.exec(lines)) != null) {
102
- const key = match[1];
103
- let value = match[2] || "";
104
- value = value.trim();
105
- const maybeQuote = value[0];
106
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
107
- if (maybeQuote === '"') {
108
- value = value.replace(/\\n/g, "\n");
109
- value = value.replace(/\\r/g, "\r");
110
- }
111
- obj[key] = value;
112
- }
113
- return obj;
114
- }
115
- function _parseVault(options) {
116
- options = options || {};
117
- const vaultPath = _vaultPath(options);
118
- options.path = vaultPath;
119
- const result = DotenvModule.configDotenv(options);
120
- if (!result.parsed) {
121
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
122
- err.code = "MISSING_DATA";
123
- throw err;
124
- }
125
- const keys = _dotenvKey(options).split(",");
126
- const length = keys.length;
127
- let decrypted;
128
- for (let i = 0; i < length; i++) {
129
- try {
130
- const key = keys[i].trim();
131
- const attrs = _instructions(result, key);
132
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
133
- break;
134
- } catch (error) {
135
- if (i + 1 >= length) {
136
- throw error;
137
- }
138
- }
139
- }
140
- return DotenvModule.parse(decrypted);
141
- }
142
- function _warn(message) {
143
- console.log(`[dotenv@${version}][WARN] ${message}`);
144
- }
145
- function _debug(message) {
146
- console.log(`[dotenv@${version}][DEBUG] ${message}`);
147
- }
148
- function _log(message) {
149
- console.log(`[dotenv@${version}] ${message}`);
150
- }
151
- function _dotenvKey(options) {
152
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
153
- return options.DOTENV_KEY;
154
- }
155
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
156
- return process.env.DOTENV_KEY;
157
- }
158
- return "";
159
- }
160
- function _instructions(result, dotenvKey) {
161
- let uri;
162
- try {
163
- uri = new URL(dotenvKey);
164
- } catch (error) {
165
- if (error.code === "ERR_INVALID_URL") {
166
- 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");
167
- err.code = "INVALID_DOTENV_KEY";
168
- throw err;
169
- }
170
- throw error;
171
- }
172
- const key = uri.password;
173
- if (!key) {
174
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
175
- err.code = "INVALID_DOTENV_KEY";
176
- throw err;
177
- }
178
- const environment = uri.searchParams.get("environment");
179
- if (!environment) {
180
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
181
- err.code = "INVALID_DOTENV_KEY";
182
- throw err;
183
- }
184
- const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
185
- const ciphertext = result.parsed[environmentKey];
186
- if (!ciphertext) {
187
- const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
188
- err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
189
- throw err;
190
- }
191
- return { ciphertext, key };
192
- }
193
- function _vaultPath(options) {
194
- let possibleVaultPath = null;
195
- if (options && options.path && options.path.length > 0) {
196
- if (Array.isArray(options.path)) {
197
- for (const filepath of options.path) {
198
- if (fs.existsSync(filepath)) {
199
- possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
200
- }
201
- }
202
- } else {
203
- possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
204
- }
205
- } else {
206
- possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
207
- }
208
- if (fs.existsSync(possibleVaultPath)) {
209
- return possibleVaultPath;
210
- }
211
- return null;
212
- }
213
- function _resolveHome(envPath) {
214
- return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
215
- }
216
- function _configVault(options) {
217
- const debug = Boolean(options && options.debug);
218
- const quiet = options && "quiet" in options ? options.quiet : true;
219
- if (debug || !quiet) {
220
- _log("Loading env from encrypted .env.vault");
221
- }
222
- const parsed = DotenvModule._parseVault(options);
223
- let processEnv = process.env;
224
- if (options && options.processEnv != null) {
225
- processEnv = options.processEnv;
226
- }
227
- DotenvModule.populate(processEnv, parsed, options);
228
- return { parsed };
229
- }
230
- function configDotenv(options) {
231
- const dotenvPath = path.resolve(process.cwd(), ".env");
232
- let encoding = "utf8";
233
- const debug = Boolean(options && options.debug);
234
- const quiet = options && "quiet" in options ? options.quiet : true;
235
- if (options && options.encoding) {
236
- encoding = options.encoding;
237
- } else {
238
- if (debug) {
239
- _debug("No encoding is specified. UTF-8 is used by default");
240
- }
241
- }
242
- let optionPaths = [dotenvPath];
243
- if (options && options.path) {
244
- if (!Array.isArray(options.path)) {
245
- optionPaths = [_resolveHome(options.path)];
246
- } else {
247
- optionPaths = [];
248
- for (const filepath of options.path) {
249
- optionPaths.push(_resolveHome(filepath));
250
- }
251
- }
252
- }
253
- let lastError;
254
- const parsedAll = {};
255
- for (const path2 of optionPaths) {
256
- try {
257
- const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
258
- DotenvModule.populate(parsedAll, parsed, options);
259
- } catch (e) {
260
- if (debug) {
261
- _debug(`Failed to load ${path2} ${e.message}`);
262
- }
263
- lastError = e;
264
- }
265
- }
266
- let processEnv = process.env;
267
- if (options && options.processEnv != null) {
268
- processEnv = options.processEnv;
269
- }
270
- DotenvModule.populate(processEnv, parsedAll, options);
271
- if (debug || !quiet) {
272
- const keysCount = Object.keys(parsedAll).length;
273
- const shortPaths = [];
274
- for (const filePath of optionPaths) {
275
- try {
276
- const relative = path.relative(process.cwd(), filePath);
277
- shortPaths.push(relative);
278
- } catch (e) {
279
- if (debug) {
280
- _debug(`Failed to load ${filePath} ${e.message}`);
281
- }
282
- lastError = e;
283
- }
284
- }
285
- _log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
286
- }
287
- if (lastError) {
288
- return { parsed: parsedAll, error: lastError };
289
- } else {
290
- return { parsed: parsedAll };
291
- }
292
- }
293
- function config(options) {
294
- if (_dotenvKey(options).length === 0) {
295
- return DotenvModule.configDotenv(options);
296
- }
297
- const vaultPath = _vaultPath(options);
298
- if (!vaultPath) {
299
- _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
300
- return DotenvModule.configDotenv(options);
301
- }
302
- return DotenvModule._configVault(options);
303
- }
304
- function decrypt(encrypted, keyStr) {
305
- const key = Buffer.from(keyStr.slice(-64), "hex");
306
- let ciphertext = Buffer.from(encrypted, "base64");
307
- const nonce = ciphertext.subarray(0, 12);
308
- const authTag = ciphertext.subarray(-16);
309
- ciphertext = ciphertext.subarray(12, -16);
310
- try {
311
- const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
312
- aesgcm.setAuthTag(authTag);
313
- return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
314
- } catch (error) {
315
- const isRange = error instanceof RangeError;
316
- const invalidKeyLength = error.message === "Invalid key length";
317
- const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
318
- if (isRange || invalidKeyLength) {
319
- const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
320
- err.code = "INVALID_DOTENV_KEY";
321
- throw err;
322
- } else if (decryptionFailed) {
323
- const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
324
- err.code = "DECRYPTION_FAILED";
325
- throw err;
326
- } else {
327
- throw error;
328
- }
329
- }
330
- }
331
- function populate(processEnv, parsed, options = {}) {
332
- const debug = Boolean(options && options.debug);
333
- const override = Boolean(options && options.override);
334
- if (typeof parsed !== "object") {
335
- const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
336
- err.code = "OBJECT_REQUIRED";
337
- throw err;
338
- }
339
- for (const key of Object.keys(parsed)) {
340
- if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
341
- if (override === true) {
342
- processEnv[key] = parsed[key];
343
- }
344
- if (debug) {
345
- if (override === true) {
346
- _debug(`"${key}" is already defined and WAS overwritten`);
347
- } else {
348
- _debug(`"${key}" is already defined and was NOT overwritten`);
349
- }
350
- }
351
- } else {
352
- processEnv[key] = parsed[key];
353
- }
354
- }
355
- }
356
- var DotenvModule = {
357
- configDotenv,
358
- _configVault,
359
- _parseVault,
360
- config,
361
- decrypt,
362
- parse,
363
- populate
364
- };
365
- module.exports.configDotenv = DotenvModule.configDotenv;
366
- module.exports._configVault = DotenvModule._configVault;
367
- module.exports._parseVault = DotenvModule._parseVault;
368
- module.exports.config = DotenvModule.config;
369
- module.exports.decrypt = DotenvModule.decrypt;
370
- module.exports.parse = DotenvModule.parse;
371
- module.exports.populate = DotenvModule.populate;
372
- module.exports = DotenvModule;
373
- }
374
- });
375
- export default require_main();
@@ -1,63 +0,0 @@
1
- import { createRequire as __dinou_createRequire } from "node:module";
2
- import { fileURLToPath as __dinou_fileURLToPath } from "node:url";
3
- import __dinou_path from "node:path";
4
- const require = __dinou_createRequire(import.meta.url);
5
- const __filename = __dinou_fileURLToPath(import.meta.url);
6
- const __dirname = __dinou_path.dirname(__filename);
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __commonJS = (cb, mod) => function __require2() {
15
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
- };
17
-
18
- // ../node_modules/esbuild-copy-static-files/index.js
19
- var require_esbuild_copy_static_files = __commonJS({
20
- "../node_modules/esbuild-copy-static-files/index.js"(exports, module) {
21
- var crypto = __require("crypto");
22
- var fs = __require("fs");
23
- var getDigest = (string) => {
24
- const hash = crypto.createHash("md5");
25
- const data = hash.update(string, "utf-8");
26
- return data.digest("hex");
27
- };
28
- var getFileDigest = (path) => {
29
- if (!fs.existsSync(path)) {
30
- return null;
31
- }
32
- if (fs.statSync(path).isDirectory()) {
33
- return null;
34
- }
35
- return getDigest(fs.readFileSync(path));
36
- };
37
- function filter(src, dest) {
38
- if (!fs.existsSync(dest)) {
39
- return true;
40
- }
41
- if (fs.statSync(dest).isDirectory()) {
42
- return true;
43
- }
44
- return getFileDigest(src) !== getFileDigest(dest);
45
- }
46
- module.exports = (options = {}) => ({
47
- name: "copy-static-files",
48
- setup(build) {
49
- let src = options.src || "./static";
50
- let dest = options.dest || "../public";
51
- build.onEnd(() => fs.cpSync(src, dest, {
52
- dereference: options.dereference || true,
53
- errorOnExist: options.errorOnExist || false,
54
- filter: options.filter || filter,
55
- force: options.force || true,
56
- preserveTimestamps: options.preserveTimestamps || true,
57
- recursive: options.recursive || true
58
- }));
59
- }
60
- });
61
- }
62
- });
63
- export default require_esbuild_copy_static_files();