@powerlines/plugin-env 0.16.59 → 0.16.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
- package/dist/_virtual/{rolldown_runtime.mjs → _rolldown/runtime.mjs} +2 -3
- package/dist/babel/index.cjs +1 -0
- package/dist/babel/plugin.cjs +20 -19
- package/dist/babel/plugin.d.cts +0 -1
- package/dist/babel/plugin.d.cts.map +1 -1
- package/dist/babel/plugin.d.mts +0 -1
- package/dist/babel/plugin.d.mts.map +1 -1
- package/dist/babel/plugin.mjs +3 -3
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +26 -25
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env-builtin.cjs +155 -153
- package/dist/components/env-builtin.d.cts +0 -1
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts +0 -1
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.mjs +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/helpers/automd-generator.cjs +4 -3
- package/dist/helpers/automd-generator.d.cts +2 -3
- package/dist/helpers/automd-generator.d.cts.map +1 -1
- package/dist/helpers/automd-generator.d.mts +2 -3
- package/dist/helpers/automd-generator.d.mts.map +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.cjs +1 -0
- package/dist/helpers/create-reflection-resource.d.cts +0 -1
- package/dist/helpers/create-reflection-resource.d.cts.map +1 -1
- package/dist/helpers/create-reflection-resource.d.mts +0 -1
- package/dist/helpers/create-reflection-resource.d.mts.map +1 -1
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/docs-helper.cjs +4 -2
- package/dist/helpers/docs-helper.d.cts +0 -1
- package/dist/helpers/docs-helper.d.cts.map +1 -1
- package/dist/helpers/docs-helper.d.mts +0 -1
- package/dist/helpers/docs-helper.d.mts.map +1 -1
- package/dist/helpers/docs-helper.mjs +1 -1
- package/dist/helpers/docs-helper.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/load.cjs +19 -17
- package/dist/helpers/load.d.cts +0 -1
- package/dist/helpers/load.d.cts.map +1 -1
- package/dist/helpers/load.d.mts +0 -1
- package/dist/helpers/load.d.mts.map +1 -1
- package/dist/helpers/load.mjs +2 -2
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +59 -58
- package/dist/helpers/persistence.d.cts +0 -1
- package/dist/helpers/persistence.d.cts.map +1 -1
- package/dist/helpers/persistence.d.mts +0 -1
- package/dist/helpers/persistence.d.mts.map +1 -1
- package/dist/helpers/persistence.mjs +15 -15
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.cjs +40 -39
- package/dist/helpers/reflect.d.cts.map +1 -1
- package/dist/helpers/reflect.d.mts.map +1 -1
- package/dist/helpers/reflect.mjs +2 -2
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.cjs +8 -7
- package/dist/helpers/source-file-env.d.cts.map +1 -1
- package/dist/helpers/source-file-env.d.mts.map +1 -1
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.cjs +6 -5
- package/dist/helpers/template-helpers.d.cts +0 -1
- package/dist/helpers/template-helpers.d.cts.map +1 -1
- package/dist/helpers/template-helpers.d.mts +0 -1
- package/dist/helpers/template-helpers.d.mts.map +1 -1
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/index.cjs +49 -49
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.cjs +7 -7
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs +6 -6
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +6 -6
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +6 -6
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.cjs +655 -655
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs +655 -655
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.cjs +179 -179
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs +179 -179
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +188 -188
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +188 -188
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.cjs +297 -297
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs +297 -297
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.cjs +8 -8
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +8 -8
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs +4 -4
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.cjs +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.cjs +5 -5
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs +4 -4
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.cjs +2 -2
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs.map +1 -1
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +18 -18
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +1308 -1311
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +1294 -1297
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +2194 -2194
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +2193 -2193
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +1 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +3 -3
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +3 -3
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +34 -34
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +33 -33
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +221 -223
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +220 -222
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +1 -1
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.cjs +3 -3
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs +5 -5
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +1 -1
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +6 -6
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +5 -5
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +10 -10
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +16 -16
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +412 -412
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +189 -189
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/plugin.cjs +20 -19
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs.map +1 -1
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts.map +1 -1
- package/dist/types/runtime.d.mts.map +1 -1
- package/dist/types/runtime.mjs.map +1 -1
- package/package.json +45 -26
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.cjs +0 -37
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs +0 -38
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +0 -5
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +0 -6
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +0 -7
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +0 -63
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +0 -64
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +0 -17
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.cjs +0 -32
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs +0 -33
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.cjs +0 -28
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs +0 -29
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.cjs +0 -122
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs +0 -123
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs +0 -9
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs.map +0 -1
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const require_runtime = require('../../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
4
4
|
|
|
5
5
|
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs
|
|
6
|
-
var require_node_fetch_native_DhEqb06g = /* @__PURE__ */
|
|
6
|
+
var require_node_fetch_native_DhEqb06g = /* @__PURE__ */ require_runtime.__commonJSMin(((exports) => {
|
|
7
7
|
var l = Object.defineProperty;
|
|
8
8
|
var o = (e, t) => l(e, "name", {
|
|
9
9
|
value: t,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs
|
|
4
4
|
var require_node_fetch_native_DhEqb06g = /* @__PURE__ */ __commonJSMin(((exports) => {
|
package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_runtime = require('../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_index = require('../dist/index.cjs');
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs
|
|
5
|
-
var require_lib = /* @__PURE__ */
|
|
5
|
+
var require_lib = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
|
|
6
6
|
const nodeFetch = require_index.default;
|
|
7
7
|
function fetch(input, options) {
|
|
8
8
|
return nodeFetch.fetch(input, options);
|
package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../_virtual/
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { require_dist } from "../dist/index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_runtime = require('../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_pathe_M_eThtNZ = require('../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs');
|
|
3
3
|
const require_main = require('../../../../tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs');
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
|
-
node_fs =
|
|
5
|
+
node_fs = require_runtime.__toESM(node_fs);
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
let node_module = require("node:module");
|
|
@@ -148,7 +148,7 @@ async function detectPackageManager(cwd, options = {}) {
|
|
|
148
148
|
if (!detected && !options.ignoreArgv) {
|
|
149
149
|
const scriptArg = process.argv[1];
|
|
150
150
|
if (scriptArg) {
|
|
151
|
-
for (const packageManager of packageManagers) if (
|
|
151
|
+
for (const packageManager of packageManagers) if (new RegExp(`[/\\\\]\\.?${packageManager.command}`).test(scriptArg)) return packageManager;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return detected;
|
|
@@ -113,9 +113,9 @@ const packageManagers = [
|
|
|
113
113
|
}
|
|
114
114
|
];
|
|
115
115
|
async function detectPackageManager(cwd, options = {}) {
|
|
116
|
-
const detected = await findup(resolve$1(cwd || "."), async (path
|
|
116
|
+
const detected = await findup(resolve$1(cwd || "."), async (path) => {
|
|
117
117
|
if (!options.ignorePackageJSON) {
|
|
118
|
-
const packageJSONPath = join(path
|
|
118
|
+
const packageJSONPath = join(path, "package.json");
|
|
119
119
|
if (existsSync(packageJSONPath)) {
|
|
120
120
|
const packageJSON = JSON.parse(await readFile(packageJSONPath, "utf8"));
|
|
121
121
|
if (packageJSON?.packageManager) {
|
|
@@ -136,16 +136,16 @@ async function detectPackageManager(cwd, options = {}) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
if (existsSync(join(path
|
|
139
|
+
if (existsSync(join(path, "deno.json"))) return packageManagers.find((pm) => pm.name === "deno");
|
|
140
140
|
}
|
|
141
141
|
if (!options.ignoreLockFile) {
|
|
142
|
-
for (const packageManager of packageManagers) if ([packageManager.lockFile, packageManager.files].flat().filter(Boolean).some((file) => existsSync(resolve$1(path
|
|
142
|
+
for (const packageManager of packageManagers) if ([packageManager.lockFile, packageManager.files].flat().filter(Boolean).some((file) => existsSync(resolve$1(path, file)))) return { ...packageManager };
|
|
143
143
|
}
|
|
144
144
|
}, { includeParentDirs: options.includeParentDirs ?? true });
|
|
145
145
|
if (!detected && !options.ignoreArgv) {
|
|
146
146
|
const scriptArg = process.argv[1];
|
|
147
147
|
if (scriptArg) {
|
|
148
|
-
for (const packageManager of packageManagers) if (
|
|
148
|
+
for (const packageManager of packageManagers) if (new RegExp(`[/\\\\]\\.?${packageManager.command}`).test(scriptArg)) return packageManager;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
return detected;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["normalize","x","resolve","path"],"sources":["../../../../../../../../../node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, normalize, resolve } from \"pathe\";\nimport { x } from \"tinyexec\";\nimport { join as join$1 } from \"node:path\";\nasync function findup(cwd, match, options = {}) {\n\tconst segments = normalize(cwd).split(\"/\");\n\twhile (segments.length > 0) {\n\t\tconst result = await match(segments.join(\"/\") || \"/\");\n\t\tif (result || !options.includeParentDirs) return result;\n\t\tsegments.pop();\n\t}\n}\nasync function readPackageJSON(cwd) {\n\treturn findup(cwd, (p) => {\n\t\tconst pkgPath = join$1(p, \"package.json\");\n\t\tif (existsSync(pkgPath)) return readFile(pkgPath, \"utf8\").then((data) => JSON.parse(data));\n\t});\n}\nfunction cached(fn) {\n\tlet v;\n\treturn () => {\n\t\tif (v === void 0) v = fn().then((r) => {\n\t\t\tv = r;\n\t\t\treturn v;\n\t\t});\n\t\treturn v;\n\t};\n}\nconst hasCorepack = cached(async () => {\n\tif (globalThis.process?.versions?.webcontainer) return false;\n\ttry {\n\t\tconst { exitCode } = await x(\"corepack\", [\"--version\"]);\n\t\treturn exitCode === 0;\n\t} catch {\n\t\treturn false;\n\t}\n});\nasync function executeCommand(command, args, options = {}) {\n\tconst xArgs = command !== \"npm\" && command !== \"bun\" && command !== \"deno\" && options.corepack !== false && await hasCorepack() ? [\"corepack\", [command, ...args]] : [command, args];\n\tconst { exitCode, stdout, stderr } = await x(xArgs[0], xArgs[1], { nodeOptions: {\n\t\tcwd: resolve(options.cwd || process.cwd()),\n\t\tenv: options.env,\n\t\tstdio: options.silent ? \"pipe\" : \"inherit\"\n\t} });\n\tif (exitCode !== 0) throw new Error(`\\`${xArgs.flat().join(\" \")}\\` failed.${options.silent ? [\n\t\t\"\",\n\t\tstdout,\n\t\tstderr\n\t].join(\"\\n\") : \"\"}`);\n}\nconst NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG = \"No package manager auto-detected.\";\nasync function resolveOperationOptions(options = {}) {\n\tconst cwd = options.cwd || process.cwd();\n\tconst env = {\n\t\t...process.env,\n\t\t...options.env\n\t};\n\tconst packageManager = (typeof options.packageManager === \"string\" ? packageManagers.find((pm) => pm.name === options.packageManager) : options.packageManager) || await detectPackageManager(options.cwd || process.cwd());\n\tif (!packageManager) throw new Error(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG);\n\treturn {\n\t\tcwd,\n\t\tenv,\n\t\tsilent: options.silent ?? false,\n\t\tpackageManager,\n\t\tdev: options.dev ?? false,\n\t\tworkspace: options.workspace,\n\t\tglobal: options.global ?? false,\n\t\tdry: options.dry ?? false,\n\t\tcorepack: options.corepack ?? true\n\t};\n}\nfunction getWorkspaceArgs(options) {\n\tif (!options.workspace) return [];\n\tconst workspacePkg = typeof options.workspace === \"string\" && options.workspace !== \"\" ? options.workspace : void 0;\n\tif (options.packageManager.name === \"pnpm\") return workspacePkg ? [\"--filter\", workspacePkg] : [\"--workspace-root\"];\n\tif (options.packageManager.name === \"npm\") return workspacePkg ? [\"-w\", workspacePkg] : [\"--workspaces\"];\n\tif (options.packageManager.name === \"yarn\") if (!options.packageManager.majorVersion || options.packageManager.majorVersion === \"1\") return workspacePkg ? [\"--cwd\", workspacePkg] : [\"-W\"];\n\telse return workspacePkg ? [\"workspace\", workspacePkg] : [];\n\treturn [];\n}\nfunction getWorkspaceArgs2(options) {\n\tif (!options.workspace) return [];\n\tconst workspacePkg = typeof options.workspace === \"string\" && options.workspace !== \"\" ? options.workspace : void 0;\n\tif (options.packageManager === \"pnpm\") return workspacePkg ? [\"--filter\", workspacePkg] : [\"--workspace-root\"];\n\tif (options.packageManager === \"npm\") return workspacePkg ? [\"-w\", workspacePkg] : [\"--workspaces\"];\n\tif (options.packageManager === \"yarn\") if (options.yarnBerry) return workspacePkg ? [\"workspace\", workspacePkg] : [];\n\telse return workspacePkg ? [\"--cwd\", workspacePkg] : [\"-W\"];\n\treturn [];\n}\nfunction fmtCommand(args) {\n\treturn args.filter(Boolean).map((arg, i) => i > 0 && arg.includes(\" \") ? `\"${arg}\"` : arg).join(\" \");\n}\nfunction doesDependencyExist(name, options) {\n\tconst require = createRequire(options.cwd.endsWith(\"/\") ? options.cwd : options.cwd + \"/\");\n\ttry {\n\t\treturn require.resolve(name).startsWith(options.cwd);\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction parsePackageManagerField(packageManager) {\n\tconst [name, _version] = (packageManager || \"\").split(\"@\");\n\tconst [version, buildMeta] = _version?.split(\"+\") || [];\n\tif (name && name !== \"-\" && /^(@[a-z0-9-~][a-z0-9-._~]*\\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(name)) return {\n\t\tname,\n\t\tversion,\n\t\tbuildMeta\n\t};\n\tconst sanitized = (name || \"\").replace(/\\W+/g, \"\");\n\treturn {\n\t\tname: sanitized,\n\t\tversion,\n\t\tbuildMeta,\n\t\twarnings: [`Abnormal characters found in \\`packageManager\\` field, sanitizing from \\`${name}\\` to \\`${sanitized}\\``]\n\t};\n}\nconst packageManagers = [\n\t{\n\t\tname: \"npm\",\n\t\tcommand: \"npm\",\n\t\tlockFile: \"package-lock.json\"\n\t},\n\t{\n\t\tname: \"pnpm\",\n\t\tcommand: \"pnpm\",\n\t\tlockFile: \"pnpm-lock.yaml\",\n\t\tfiles: [\"pnpm-workspace.yaml\"]\n\t},\n\t{\n\t\tname: \"bun\",\n\t\tcommand: \"bun\",\n\t\tlockFile: [\"bun.lockb\", \"bun.lock\"]\n\t},\n\t{\n\t\tname: \"yarn\",\n\t\tcommand: \"yarn\",\n\t\tlockFile: \"yarn.lock\",\n\t\tfiles: [\".yarnrc.yml\"]\n\t},\n\t{\n\t\tname: \"deno\",\n\t\tcommand: \"deno\",\n\t\tlockFile: \"deno.lock\",\n\t\tfiles: [\"deno.json\"]\n\t}\n];\nasync function detectPackageManager(cwd, options = {}) {\n\tconst detected = await findup(resolve(cwd || \".\"), async (path) => {\n\t\tif (!options.ignorePackageJSON) {\n\t\t\tconst packageJSONPath = join(path, \"package.json\");\n\t\t\tif (existsSync(packageJSONPath)) {\n\t\t\t\tconst packageJSON = JSON.parse(await readFile(packageJSONPath, \"utf8\"));\n\t\t\t\tif (packageJSON?.packageManager) {\n\t\t\t\t\tconst { name, version = \"0.0.0\", buildMeta, warnings } = parsePackageManagerField(packageJSON.packageManager);\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tconst majorVersion = version.split(\".\")[0];\n\t\t\t\t\t\tconst packageManager = packageManagers.find((pm) => pm.name === name && pm.majorVersion === majorVersion) || packageManagers.find((pm) => pm.name === name);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tcommand: name,\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\tmajorVersion,\n\t\t\t\t\t\t\tbuildMeta,\n\t\t\t\t\t\t\twarnings,\n\t\t\t\t\t\t\tfiles: packageManager?.files,\n\t\t\t\t\t\t\tlockFile: packageManager?.lockFile\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (existsSync(join(path, \"deno.json\"))) return packageManagers.find((pm) => pm.name === \"deno\");\n\t\t}\n\t\tif (!options.ignoreLockFile) {\n\t\t\tfor (const packageManager of packageManagers) if ([packageManager.lockFile, packageManager.files].flat().filter(Boolean).some((file) => existsSync(resolve(path, file)))) return { ...packageManager };\n\t\t}\n\t}, { includeParentDirs: options.includeParentDirs ?? true });\n\tif (!detected && !options.ignoreArgv) {\n\t\tconst scriptArg = process.argv[1];\n\t\tif (scriptArg) {\n\t\t\tfor (const packageManager of packageManagers) if (new RegExp(`[/\\\\\\\\]\\\\.?${packageManager.command}`).test(scriptArg)) return packageManager;\n\t\t}\n\t}\n\treturn detected;\n}\nfunction installDependenciesCommand(packageManager, options = {}) {\n\tconst installCmd = options.short ? \"i\" : \"install\";\n\tconst pmToFrozenLockfileInstallCommand = {\n\t\tnpm: [\"ci\"],\n\t\tyarn: [installCmd, \"--immutable\"],\n\t\tbun: [installCmd, \"--frozen-lockfile\"],\n\t\tpnpm: [installCmd, \"--frozen-lockfile\"],\n\t\tdeno: [installCmd, \"--frozen\"]\n\t};\n\treturn fmtCommand([packageManager, ...options.frozenLockFile ? pmToFrozenLockfileInstallCommand[packageManager] : [installCmd]]);\n}\nfunction addDependencyCommand(packageManager, name, options = {}) {\n\tconst names = Array.isArray(name) ? name : [name];\n\tif (packageManager === \"deno\") {\n\t\tfor (let i = 0; i < names.length; i++) if (!/^(npm|jsr|file):.+$/.test(names[i])) names[i] = `npm:${names[i]}`;\n\t}\n\treturn fmtCommand([packageManager, ...(packageManager === \"yarn\" ? [\n\t\t...getWorkspaceArgs2({\n\t\t\tpackageManager,\n\t\t\t...options\n\t\t}),\n\t\toptions.global && !options.yarnBerry ? \"global\" : \"\",\n\t\t\"add\",\n\t\toptions.dev ? options.short ? \"-D\" : \"--dev\" : \"\",\n\t\t...names\n\t] : [\n\t\tpackageManager === \"npm\" ? options.short ? \"i\" : \"install\" : \"add\",\n\t\t...getWorkspaceArgs2({\n\t\t\tpackageManager,\n\t\t\t...options\n\t\t}),\n\t\toptions.dev ? options.short ? \"-D\" : \"--dev\" : \"\",\n\t\toptions.global ? \"-g\" : \"\",\n\t\t...names\n\t]).filter(Boolean)]);\n}\nfunction runScriptCommand(packageManager, name, options = {}) {\n\treturn fmtCommand([packageManager, ...[\n\t\tpackageManager === \"deno\" ? \"task\" : \"run\",\n\t\tname,\n\t\t...options.args || []\n\t]]);\n}\nfunction dlxCommand(packageManager, name, options = {}) {\n\tconst command = {\n\t\tnpm: options.short ? \"npx\" : \"npm exec\",\n\t\tyarn: \"yarn dlx\",\n\t\tpnpm: options.short ? \"pnpx\" : \"pnpm dlx\",\n\t\tbun: options.short ? \"bunx\" : \"bun x\",\n\t\tdeno: \"deno run -A\"\n\t}[packageManager];\n\tlet packages = options.packages || [];\n\tif (packageManager === \"deno\") {\n\t\tif (!name.startsWith(\"npm:\")) name = `npm:${name}`;\n\t\tpackages = packages.map((pkg) => pkg.startsWith(\"npm:\") ? pkg : `npm:${pkg}`);\n\t}\n\tconst packageArgs = [];\n\tif (packages.length > 0 && packageManager !== \"deno\") {\n\t\tconst packageFlag = options.short && /^npm|yarn$/.test(packageManager) ? \"-p\" : \"--package\";\n\t\tfor (const pkg of packages) packageArgs.push(`${packageFlag}=${pkg}`);\n\t}\n\tconst argSep = packageManager === \"npm\" && !options.short ? \"--\" : \"\";\n\treturn fmtCommand([\n\t\tcommand,\n\t\t...packageArgs,\n\t\tname,\n\t\targSep,\n\t\t...options.args || []\n\t]);\n}\nasync function installDependencies(options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst commandArgs = options.frozenLockFile ? {\n\t\tnpm: [\"ci\"],\n\t\tyarn: [\"install\", \"--immutable\"],\n\t\tbun: [\"install\", \"--frozen-lockfile\"],\n\t\tpnpm: [\"install\", \"--frozen-lockfile\"],\n\t\tdeno: [\"install\", \"--frozen\"]\n\t}[resolvedOptions.packageManager.name] : [\"install\"];\n\tif (options.ignoreWorkspace && resolvedOptions.packageManager.name === \"pnpm\") commandArgs.push(\"--ignore-workspace\");\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, commandArgs, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs: commandArgs\n\t} };\n}\nasync function addDependency(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst names = Array.isArray(name) ? name : [name];\n\tif (resolvedOptions.packageManager.name === \"deno\") {\n\t\tfor (let i = 0; i < names.length; i++) if (!/^(npm|jsr|file):.+$/.test(names[i] || \"\")) names[i] = `npm:${names[i]}`;\n\t}\n\tif (names.length === 0) return {};\n\tconst args = (resolvedOptions.packageManager.name === \"yarn\" ? [\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\tresolvedOptions.global && resolvedOptions.packageManager.majorVersion === \"1\" ? \"global\" : \"\",\n\t\t\"add\",\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\t...names\n\t] : [\n\t\tresolvedOptions.packageManager.name === \"npm\" ? \"install\" : \"add\",\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\tresolvedOptions.global ? \"-g\" : \"\",\n\t\t...names\n\t]).filter(Boolean);\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\tif (!resolvedOptions.dry && options.installPeerDependencies) {\n\t\tconst existingPkg = await readPackageJSON(resolvedOptions.cwd);\n\t\tconst peerDeps = [];\n\t\tconst peerDevDeps = [];\n\t\tconst _require = createRequire(join$1(resolvedOptions.cwd, \"/_.js\"));\n\t\tfor (const _name of names) {\n\t\t\tconst pkgName = _name.match(/^(.[^@]+)/)?.[0];\n\t\t\tconst pkg = await readPackageJSON(_require.resolve(pkgName));\n\t\t\tif (!pkg?.peerDependencies || pkg?.name !== pkgName) continue;\n\t\t\tfor (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {\n\t\t\t\tif (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;\n\t\t\t\tif (existingPkg?.dependencies?.[peerDependency] || existingPkg?.devDependencies?.[peerDependency]) continue;\n\t\t\t\t(pkg.peerDependenciesMeta?.[peerDependency]?.dev ? peerDevDeps : peerDeps).push(`${peerDependency}@${version}`);\n\t\t\t}\n\t\t}\n\t\tif (peerDeps.length > 0) await addDependency(peerDeps, { ...resolvedOptions });\n\t\tif (peerDevDeps.length > 0) await addDevDependency(peerDevDeps, { ...resolvedOptions });\n\t}\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs\n\t} };\n}\nasync function addDevDependency(name, options = {}) {\n\treturn await addDependency(name, {\n\t\t...options,\n\t\tdev: true\n\t});\n}\nasync function removeDependency(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst names = Array.isArray(name) ? name : [name];\n\tif (names.length === 0) return {};\n\tconst args = (resolvedOptions.packageManager.name === \"yarn\" ? [\n\t\tresolvedOptions.global && resolvedOptions.packageManager.majorVersion === \"1\" ? \"global\" : \"\",\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\t\"remove\",\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\tresolvedOptions.global ? \"-g\" : \"\",\n\t\t...names\n\t] : [\n\t\tresolvedOptions.packageManager.name === \"npm\" ? \"uninstall\" : \"remove\",\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\tresolvedOptions.global ? \"-g\" : \"\",\n\t\t...names\n\t]).filter(Boolean);\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs\n\t} };\n}\nasync function ensureDependencyInstalled(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tif (doesDependencyExist(name, resolvedOptions)) return true;\n\tawait addDependency(name, resolvedOptions);\n}\nasync function dedupeDependencies(options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst isSupported = ![\"bun\", \"deno\"].includes(resolvedOptions.packageManager.name);\n\tif (options.recreateLockfile ?? !isSupported) {\n\t\tconst lockfiles = Array.isArray(resolvedOptions.packageManager.lockFile) ? resolvedOptions.packageManager.lockFile : [resolvedOptions.packageManager.lockFile];\n\t\tfor (const lockfile of lockfiles) if (lockfile) fs.rmSync(resolve(resolvedOptions.cwd, lockfile), { force: true });\n\t\treturn await installDependencies(resolvedOptions);\n\t}\n\tif (isSupported) {\n\t\tconst isyarnv1 = resolvedOptions.packageManager.name === \"yarn\" && resolvedOptions.packageManager.majorVersion === \"1\";\n\t\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, [isyarnv1 ? \"install\" : \"dedupe\"], {\n\t\t\tcwd: resolvedOptions.cwd,\n\t\t\tsilent: resolvedOptions.silent,\n\t\t\tcorepack: resolvedOptions.corepack\n\t\t});\n\t\treturn { exec: {\n\t\t\tcommand: resolvedOptions.packageManager.command,\n\t\t\targs: [isyarnv1 ? \"install\" : \"dedupe\"]\n\t\t} };\n\t}\n\tthrow new Error(`Deduplication is not supported for ${resolvedOptions.packageManager.name}`);\n}\nasync function runScript(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst args = [\n\t\tresolvedOptions.packageManager.name === \"deno\" ? \"task\" : \"run\",\n\t\tname,\n\t\t...options.args || []\n\t];\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tenv: resolvedOptions.env,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs\n\t} };\n}\nasync function dlx(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst [command, ...args] = dlxCommand(resolvedOptions.packageManager.name, name, {\n\t\targs: options.args,\n\t\tshort: options.short,\n\t\tpackages: options.packages\n\t}).split(\" \");\n\tif (!resolvedOptions.dry) await executeCommand(command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tenv: resolvedOptions.env,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand,\n\t\targs\n\t} };\n}\nexport { addDependency, addDependencyCommand, addDevDependency, dedupeDependencies, detectPackageManager, dlx, dlxCommand, ensureDependencyInstalled, installDependencies, installDependenciesCommand, packageManagers, removeDependency, runScript, runScriptCommand };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAOA,eAAe,OAAO,KAAK,OAAO,UAAU,EAAE,EAAE;CAC/C,MAAM,WAAWA,YAAU,IAAI,CAAC,MAAM,IAAI;AAC1C,QAAO,SAAS,SAAS,GAAG;EAC3B,MAAM,SAAS,MAAM,MAAM,SAAS,KAAK,IAAI,IAAI,IAAI;AACrD,MAAI,UAAU,CAAC,QAAQ,kBAAmB,QAAO;AACjD,WAAS,KAAK;;;AAShB,SAAS,OAAO,IAAI;CACnB,IAAI;AACJ,cAAa;AACZ,MAAI,MAAM,KAAK,EAAG,KAAI,IAAI,CAAC,MAAM,MAAM;AACtC,OAAI;AACJ,UAAO;IACN;AACF,SAAO;;;AAGT,MAAM,cAAc,OAAO,YAAY;AACtC,KAAI,WAAW,SAAS,UAAU,aAAc,QAAO;AACvD,KAAI;EACH,MAAM,EAAE,aAAa,MAAMC,EAAE,YAAY,CAAC,YAAY,CAAC;AACvD,SAAO,aAAa;SACb;AACP,SAAO;;EAEP;AACF,eAAe,eAAe,SAAS,MAAM,UAAU,EAAE,EAAE;CAC1D,MAAM,QAAQ,YAAY,SAAS,YAAY,SAAS,YAAY,UAA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cesContent":["import { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport { existsSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { join, normalize, resolve } from \"pathe\";\nimport { x } from \"tinyexec\";\nimport { join as join$1 } from \"node:path\";\nasync function findup(cwd, match, options = {}) {\n\tconst segments = normalize(cwd).split(\"/\");\n\twhile (segments.length > 0) {\n\t\tconst result = await match(segments.join(\"/\") || \"/\");\n\t\tif (result || !options.includeParentDirs) return result;\n\t\tsegments.pop();\n\t}\n}\nasync function readPackageJSON(cwd) {\n\treturn findup(cwd, (p) => {\n\t\tconst pkgPath = join$1(p, \"package.json\");\n\t\tif (existsSync(pkgPath)) return readFile(pkgPath, \"utf8\").then((data) => JSON.parse(data));\n\t});\n}\nfunction cached(fn) {\n\tlet v;\n\treturn () => {\n\t\tif (v === void 0) v = fn().then((r) => {\n\t\t\tv = r;\n\t\t\treturn v;\n\t\t});\n\t\treturn v;\n\t};\n}\nconst hasCorepack = cached(async () => {\n\tif (globalThis.process?.versions?.webcontainer) return false;\n\ttry {\n\t\tconst { exitCode } = await x(\"corepack\", [\"--version\"]);\n\t\treturn exitCode === 0;\n\t} catch {\n\t\treturn false;\n\t}\n});\nasync function executeCommand(command, args, options = {}) {\n\tconst xArgs = command !== \"npm\" && command !== \"bun\" && command !== \"deno\" && options.corepack !== false && await hasCorepack() ? [\"corepack\", [command, ...args]] : [command, args];\n\tconst { exitCode, stdout, stderr } = await x(xArgs[0], xArgs[1], { nodeOptions: {\n\t\tcwd: resolve(options.cwd || process.cwd()),\n\t\tenv: options.env,\n\t\tstdio: options.silent ? \"pipe\" : \"inherit\"\n\t} });\n\tif (exitCode !== 0) throw new Error(`\\`${xArgs.flat().join(\" \")}\\` failed.${options.silent ? [\n\t\t\"\",\n\t\tstdout,\n\t\tstderr\n\t].join(\"\\n\") : \"\"}`);\n}\nconst NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG = \"No package manager auto-detected.\";\nasync function resolveOperationOptions(options = {}) {\n\tconst cwd = options.cwd || process.cwd();\n\tconst env = {\n\t\t...process.env,\n\t\t...options.env\n\t};\n\tconst packageManager = (typeof options.packageManager === \"string\" ? packageManagers.find((pm) => pm.name === options.packageManager) : options.packageManager) || await detectPackageManager(options.cwd || process.cwd());\n\tif (!packageManager) throw new Error(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG);\n\treturn {\n\t\tcwd,\n\t\tenv,\n\t\tsilent: options.silent ?? false,\n\t\tpackageManager,\n\t\tdev: options.dev ?? false,\n\t\tworkspace: options.workspace,\n\t\tglobal: options.global ?? false,\n\t\tdry: options.dry ?? false,\n\t\tcorepack: options.corepack ?? true\n\t};\n}\nfunction getWorkspaceArgs(options) {\n\tif (!options.workspace) return [];\n\tconst workspacePkg = typeof options.workspace === \"string\" && options.workspace !== \"\" ? options.workspace : void 0;\n\tif (options.packageManager.name === \"pnpm\") return workspacePkg ? [\"--filter\", workspacePkg] : [\"--workspace-root\"];\n\tif (options.packageManager.name === \"npm\") return workspacePkg ? [\"-w\", workspacePkg] : [\"--workspaces\"];\n\tif (options.packageManager.name === \"yarn\") if (!options.packageManager.majorVersion || options.packageManager.majorVersion === \"1\") return workspacePkg ? [\"--cwd\", workspacePkg] : [\"-W\"];\n\telse return workspacePkg ? [\"workspace\", workspacePkg] : [];\n\treturn [];\n}\nfunction getWorkspaceArgs2(options) {\n\tif (!options.workspace) return [];\n\tconst workspacePkg = typeof options.workspace === \"string\" && options.workspace !== \"\" ? options.workspace : void 0;\n\tif (options.packageManager === \"pnpm\") return workspacePkg ? [\"--filter\", workspacePkg] : [\"--workspace-root\"];\n\tif (options.packageManager === \"npm\") return workspacePkg ? [\"-w\", workspacePkg] : [\"--workspaces\"];\n\tif (options.packageManager === \"yarn\") if (options.yarnBerry) return workspacePkg ? [\"workspace\", workspacePkg] : [];\n\telse return workspacePkg ? [\"--cwd\", workspacePkg] : [\"-W\"];\n\treturn [];\n}\nfunction fmtCommand(args) {\n\treturn args.filter(Boolean).map((arg, i) => i > 0 && arg.includes(\" \") ? `\"${arg}\"` : arg).join(\" \");\n}\nfunction doesDependencyExist(name, options) {\n\tconst require = createRequire(options.cwd.endsWith(\"/\") ? options.cwd : options.cwd + \"/\");\n\ttry {\n\t\treturn require.resolve(name).startsWith(options.cwd);\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction parsePackageManagerField(packageManager) {\n\tconst [name, _version] = (packageManager || \"\").split(\"@\");\n\tconst [version, buildMeta] = _version?.split(\"+\") || [];\n\tif (name && name !== \"-\" && /^(@[a-z0-9-~][a-z0-9-._~]*\\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(name)) return {\n\t\tname,\n\t\tversion,\n\t\tbuildMeta\n\t};\n\tconst sanitized = (name || \"\").replace(/\\W+/g, \"\");\n\treturn {\n\t\tname: sanitized,\n\t\tversion,\n\t\tbuildMeta,\n\t\twarnings: [`Abnormal characters found in \\`packageManager\\` field, sanitizing from \\`${name}\\` to \\`${sanitized}\\``]\n\t};\n}\nconst packageManagers = [\n\t{\n\t\tname: \"npm\",\n\t\tcommand: \"npm\",\n\t\tlockFile: \"package-lock.json\"\n\t},\n\t{\n\t\tname: \"pnpm\",\n\t\tcommand: \"pnpm\",\n\t\tlockFile: \"pnpm-lock.yaml\",\n\t\tfiles: [\"pnpm-workspace.yaml\"]\n\t},\n\t{\n\t\tname: \"bun\",\n\t\tcommand: \"bun\",\n\t\tlockFile: [\"bun.lockb\", \"bun.lock\"]\n\t},\n\t{\n\t\tname: \"yarn\",\n\t\tcommand: \"yarn\",\n\t\tlockFile: \"yarn.lock\",\n\t\tfiles: [\".yarnrc.yml\"]\n\t},\n\t{\n\t\tname: \"deno\",\n\t\tcommand: \"deno\",\n\t\tlockFile: \"deno.lock\",\n\t\tfiles: [\"deno.json\"]\n\t}\n];\nasync function detectPackageManager(cwd, options = {}) {\n\tconst detected = await findup(resolve(cwd || \".\"), async (path) => {\n\t\tif (!options.ignorePackageJSON) {\n\t\t\tconst packageJSONPath = join(path, \"package.json\");\n\t\t\tif (existsSync(packageJSONPath)) {\n\t\t\t\tconst packageJSON = JSON.parse(await readFile(packageJSONPath, \"utf8\"));\n\t\t\t\tif (packageJSON?.packageManager) {\n\t\t\t\t\tconst { name, version = \"0.0.0\", buildMeta, warnings } = parsePackageManagerField(packageJSON.packageManager);\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tconst majorVersion = version.split(\".\")[0];\n\t\t\t\t\t\tconst packageManager = packageManagers.find((pm) => pm.name === name && pm.majorVersion === majorVersion) || packageManagers.find((pm) => pm.name === name);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tcommand: name,\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\tmajorVersion,\n\t\t\t\t\t\t\tbuildMeta,\n\t\t\t\t\t\t\twarnings,\n\t\t\t\t\t\t\tfiles: packageManager?.files,\n\t\t\t\t\t\t\tlockFile: packageManager?.lockFile\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (existsSync(join(path, \"deno.json\"))) return packageManagers.find((pm) => pm.name === \"deno\");\n\t\t}\n\t\tif (!options.ignoreLockFile) {\n\t\t\tfor (const packageManager of packageManagers) if ([packageManager.lockFile, packageManager.files].flat().filter(Boolean).some((file) => existsSync(resolve(path, file)))) return { ...packageManager };\n\t\t}\n\t}, { includeParentDirs: options.includeParentDirs ?? true });\n\tif (!detected && !options.ignoreArgv) {\n\t\tconst scriptArg = process.argv[1];\n\t\tif (scriptArg) {\n\t\t\tfor (const packageManager of packageManagers) if (new RegExp(`[/\\\\\\\\]\\\\.?${packageManager.command}`).test(scriptArg)) return packageManager;\n\t\t}\n\t}\n\treturn detected;\n}\nfunction installDependenciesCommand(packageManager, options = {}) {\n\tconst installCmd = options.short ? \"i\" : \"install\";\n\tconst pmToFrozenLockfileInstallCommand = {\n\t\tnpm: [\"ci\"],\n\t\tyarn: [installCmd, \"--immutable\"],\n\t\tbun: [installCmd, \"--frozen-lockfile\"],\n\t\tpnpm: [installCmd, \"--frozen-lockfile\"],\n\t\tdeno: [installCmd, \"--frozen\"]\n\t};\n\treturn fmtCommand([packageManager, ...options.frozenLockFile ? pmToFrozenLockfileInstallCommand[packageManager] : [installCmd]]);\n}\nfunction addDependencyCommand(packageManager, name, options = {}) {\n\tconst names = Array.isArray(name) ? name : [name];\n\tif (packageManager === \"deno\") {\n\t\tfor (let i = 0; i < names.length; i++) if (!/^(npm|jsr|file):.+$/.test(names[i])) names[i] = `npm:${names[i]}`;\n\t}\n\treturn fmtCommand([packageManager, ...(packageManager === \"yarn\" ? [\n\t\t...getWorkspaceArgs2({\n\t\t\tpackageManager,\n\t\t\t...options\n\t\t}),\n\t\toptions.global && !options.yarnBerry ? \"global\" : \"\",\n\t\t\"add\",\n\t\toptions.dev ? options.short ? \"-D\" : \"--dev\" : \"\",\n\t\t...names\n\t] : [\n\t\tpackageManager === \"npm\" ? options.short ? \"i\" : \"install\" : \"add\",\n\t\t...getWorkspaceArgs2({\n\t\t\tpackageManager,\n\t\t\t...options\n\t\t}),\n\t\toptions.dev ? options.short ? \"-D\" : \"--dev\" : \"\",\n\t\toptions.global ? \"-g\" : \"\",\n\t\t...names\n\t]).filter(Boolean)]);\n}\nfunction runScriptCommand(packageManager, name, options = {}) {\n\treturn fmtCommand([packageManager, ...[\n\t\tpackageManager === \"deno\" ? \"task\" : \"run\",\n\t\tname,\n\t\t...options.args || []\n\t]]);\n}\nfunction dlxCommand(packageManager, name, options = {}) {\n\tconst command = {\n\t\tnpm: options.short ? \"npx\" : \"npm exec\",\n\t\tyarn: \"yarn dlx\",\n\t\tpnpm: options.short ? \"pnpx\" : \"pnpm dlx\",\n\t\tbun: options.short ? \"bunx\" : \"bun x\",\n\t\tdeno: \"deno run -A\"\n\t}[packageManager];\n\tlet packages = options.packages || [];\n\tif (packageManager === \"deno\") {\n\t\tif (!name.startsWith(\"npm:\")) name = `npm:${name}`;\n\t\tpackages = packages.map((pkg) => pkg.startsWith(\"npm:\") ? pkg : `npm:${pkg}`);\n\t}\n\tconst packageArgs = [];\n\tif (packages.length > 0 && packageManager !== \"deno\") {\n\t\tconst packageFlag = options.short && /^npm|yarn$/.test(packageManager) ? \"-p\" : \"--package\";\n\t\tfor (const pkg of packages) packageArgs.push(`${packageFlag}=${pkg}`);\n\t}\n\tconst argSep = packageManager === \"npm\" && !options.short ? \"--\" : \"\";\n\treturn fmtCommand([\n\t\tcommand,\n\t\t...packageArgs,\n\t\tname,\n\t\targSep,\n\t\t...options.args || []\n\t]);\n}\nasync function installDependencies(options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst commandArgs = options.frozenLockFile ? {\n\t\tnpm: [\"ci\"],\n\t\tyarn: [\"install\", \"--immutable\"],\n\t\tbun: [\"install\", \"--frozen-lockfile\"],\n\t\tpnpm: [\"install\", \"--frozen-lockfile\"],\n\t\tdeno: [\"install\", \"--frozen\"]\n\t}[resolvedOptions.packageManager.name] : [\"install\"];\n\tif (options.ignoreWorkspace && resolvedOptions.packageManager.name === \"pnpm\") commandArgs.push(\"--ignore-workspace\");\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, commandArgs, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs: commandArgs\n\t} };\n}\nasync function addDependency(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst names = Array.isArray(name) ? name : [name];\n\tif (resolvedOptions.packageManager.name === \"deno\") {\n\t\tfor (let i = 0; i < names.length; i++) if (!/^(npm|jsr|file):.+$/.test(names[i] || \"\")) names[i] = `npm:${names[i]}`;\n\t}\n\tif (names.length === 0) return {};\n\tconst args = (resolvedOptions.packageManager.name === \"yarn\" ? [\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\tresolvedOptions.global && resolvedOptions.packageManager.majorVersion === \"1\" ? \"global\" : \"\",\n\t\t\"add\",\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\t...names\n\t] : [\n\t\tresolvedOptions.packageManager.name === \"npm\" ? \"install\" : \"add\",\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\tresolvedOptions.global ? \"-g\" : \"\",\n\t\t...names\n\t]).filter(Boolean);\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\tif (!resolvedOptions.dry && options.installPeerDependencies) {\n\t\tconst existingPkg = await readPackageJSON(resolvedOptions.cwd);\n\t\tconst peerDeps = [];\n\t\tconst peerDevDeps = [];\n\t\tconst _require = createRequire(join$1(resolvedOptions.cwd, \"/_.js\"));\n\t\tfor (const _name of names) {\n\t\t\tconst pkgName = _name.match(/^(.[^@]+)/)?.[0];\n\t\t\tconst pkg = await readPackageJSON(_require.resolve(pkgName));\n\t\t\tif (!pkg?.peerDependencies || pkg?.name !== pkgName) continue;\n\t\t\tfor (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {\n\t\t\t\tif (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;\n\t\t\t\tif (existingPkg?.dependencies?.[peerDependency] || existingPkg?.devDependencies?.[peerDependency]) continue;\n\t\t\t\t(pkg.peerDependenciesMeta?.[peerDependency]?.dev ? peerDevDeps : peerDeps).push(`${peerDependency}@${version}`);\n\t\t\t}\n\t\t}\n\t\tif (peerDeps.length > 0) await addDependency(peerDeps, { ...resolvedOptions });\n\t\tif (peerDevDeps.length > 0) await addDevDependency(peerDevDeps, { ...resolvedOptions });\n\t}\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs\n\t} };\n}\nasync function addDevDependency(name, options = {}) {\n\treturn await addDependency(name, {\n\t\t...options,\n\t\tdev: true\n\t});\n}\nasync function removeDependency(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst names = Array.isArray(name) ? name : [name];\n\tif (names.length === 0) return {};\n\tconst args = (resolvedOptions.packageManager.name === \"yarn\" ? [\n\t\tresolvedOptions.global && resolvedOptions.packageManager.majorVersion === \"1\" ? \"global\" : \"\",\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\t\"remove\",\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\tresolvedOptions.global ? \"-g\" : \"\",\n\t\t...names\n\t] : [\n\t\tresolvedOptions.packageManager.name === \"npm\" ? \"uninstall\" : \"remove\",\n\t\t...getWorkspaceArgs(resolvedOptions),\n\t\tresolvedOptions.dev ? \"-D\" : \"\",\n\t\tresolvedOptions.global ? \"-g\" : \"\",\n\t\t...names\n\t]).filter(Boolean);\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs\n\t} };\n}\nasync function ensureDependencyInstalled(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tif (doesDependencyExist(name, resolvedOptions)) return true;\n\tawait addDependency(name, resolvedOptions);\n}\nasync function dedupeDependencies(options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst isSupported = ![\"bun\", \"deno\"].includes(resolvedOptions.packageManager.name);\n\tif (options.recreateLockfile ?? !isSupported) {\n\t\tconst lockfiles = Array.isArray(resolvedOptions.packageManager.lockFile) ? resolvedOptions.packageManager.lockFile : [resolvedOptions.packageManager.lockFile];\n\t\tfor (const lockfile of lockfiles) if (lockfile) fs.rmSync(resolve(resolvedOptions.cwd, lockfile), { force: true });\n\t\treturn await installDependencies(resolvedOptions);\n\t}\n\tif (isSupported) {\n\t\tconst isyarnv1 = resolvedOptions.packageManager.name === \"yarn\" && resolvedOptions.packageManager.majorVersion === \"1\";\n\t\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, [isyarnv1 ? \"install\" : \"dedupe\"], {\n\t\t\tcwd: resolvedOptions.cwd,\n\t\t\tsilent: resolvedOptions.silent,\n\t\t\tcorepack: resolvedOptions.corepack\n\t\t});\n\t\treturn { exec: {\n\t\t\tcommand: resolvedOptions.packageManager.command,\n\t\t\targs: [isyarnv1 ? \"install\" : \"dedupe\"]\n\t\t} };\n\t}\n\tthrow new Error(`Deduplication is not supported for ${resolvedOptions.packageManager.name}`);\n}\nasync function runScript(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst args = [\n\t\tresolvedOptions.packageManager.name === \"deno\" ? \"task\" : \"run\",\n\t\tname,\n\t\t...options.args || []\n\t];\n\tif (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tenv: resolvedOptions.env,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand: resolvedOptions.packageManager.command,\n\t\targs\n\t} };\n}\nasync function dlx(name, options = {}) {\n\tconst resolvedOptions = await resolveOperationOptions(options);\n\tconst [command, ...args] = dlxCommand(resolvedOptions.packageManager.name, name, {\n\t\targs: options.args,\n\t\tshort: options.short,\n\t\tpackages: options.packages\n\t}).split(\" \");\n\tif (!resolvedOptions.dry) await executeCommand(command, args, {\n\t\tcwd: resolvedOptions.cwd,\n\t\tenv: resolvedOptions.env,\n\t\tsilent: resolvedOptions.silent,\n\t\tcorepack: resolvedOptions.corepack\n\t});\n\treturn { exec: {\n\t\tcommand,\n\t\targs\n\t} };\n}\nexport { addDependency, addDependencyCommand, addDevDependency, dedupeDependencies, detectPackageManager, dlx, dlxCommand, ensureDependencyInstalled, installDependencies, installDependenciesCommand, packageManagers, removeD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AO;;;AAG/H,QAAO;;AAwER,eAAe,oBAAoB,UAAU,EAAE,EAAE;CAChD,MAAM,kBAAkB,MAAM,wBAAwB,QAAQ;CAC9D,MAAM,cAAc,QAAQ,iBAAiB;EAC5C,KAAK,CAAC,KAAK;EACX,MAAM,CAAC,WAAW,cAAc;EAChC,KAAK,CAAC,WAAW,oBAAoB;EACrC,MAAM,CAAC,WAAW,oBAAoB;EACtC,MAAM,CAAC,WAAW,WAAW;EAC7B,CAAC,gBAAgB,eAAe,QAAQ,CAAC,UAAU;AACpD,KAAI,QAAQ,mBAAmB,gBAAgB,eAAe,SAAS,OAAQ,aAAY,KAAK,qBAAqB;AACrH,KAAI,CAAC,gBAAgB,IAAK,OAAM,eAAe,gBAAgB,eAAe,SAAS,aAAa;EACnG,KAAK,gBAAgB;EACrB,QAAQ,gBAAgB;EACxB,UAAU,gBAAgB;EAC1B,CAAC;AACF,QAAO,EAAE,MAAM;EACd,SAAS,gBAAgB,eAAe;EACxC,MAAM;EACN,EAAE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_runtime = require('../../../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
let node_crypto = require("node:crypto");
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_runtime = require('../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_pathe_M_eThtNZ = require('../../../../pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs');
|
|
3
3
|
const require_index = require('../../../../exsolve@1.0.8/node_modules/exsolve/dist/index.cjs');
|
|
4
4
|
const require_json = require('../../../../confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs');
|
|
@@ -29,7 +29,7 @@ async function findFile(filename, _options = {}) {
|
|
|
29
29
|
const segments = basePath.split("/").filter(Boolean);
|
|
30
30
|
if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
|
|
31
31
|
if (leadingSlash) segments[0] = "/" + segments[0];
|
|
32
|
-
let root = segments.findIndex((r
|
|
32
|
+
let root = segments.findIndex((r) => r.match(options.rootPattern));
|
|
33
33
|
if (root === -1) root = 0;
|
|
34
34
|
if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename2 of filenames) {
|
|
35
35
|
const filePath = require_pathe_M_eThtNZ.join(...segments.slice(0, index), filename2);
|
|
@@ -96,10 +96,10 @@ async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
const workspaceTests = {
|
|
99
|
-
workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r
|
|
100
|
-
gitConfig: (opts) => findFile(".git/config", opts).then((r
|
|
101
|
-
lockFile: (opts) => findFile(lockFiles, opts).then((r
|
|
102
|
-
packageJson: (opts) => findFile(packageFiles, opts).then((r
|
|
99
|
+
workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => require_pathe_M_eThtNZ.dirname(r)),
|
|
100
|
+
gitConfig: (opts) => findFile(".git/config", opts).then((r) => require_pathe_M_eThtNZ.resolve(r, "../..")),
|
|
101
|
+
lockFile: (opts) => findFile(lockFiles, opts).then((r) => require_pathe_M_eThtNZ.dirname(r)),
|
|
102
|
+
packageJson: (opts) => findFile(packageFiles, opts).then((r) => require_pathe_M_eThtNZ.dirname(r))
|
|
103
103
|
};
|
|
104
104
|
async function findWorkspaceDir(id = process.cwd(), options = {}) {
|
|
105
105
|
const startingFrom = _resolvePath(id, options);
|
|
@@ -28,7 +28,7 @@ async function findFile(filename, _options = {}) {
|
|
|
28
28
|
const segments = basePath.split("/").filter(Boolean);
|
|
29
29
|
if (filenames.includes(segments.at(-1)) && await options.test(basePath)) return basePath;
|
|
30
30
|
if (leadingSlash) segments[0] = "/" + segments[0];
|
|
31
|
-
let root = segments.findIndex((r
|
|
31
|
+
let root = segments.findIndex((r) => r.match(options.rootPattern));
|
|
32
32
|
if (root === -1) root = 0;
|
|
33
33
|
if (options.reverse) for (let index = root + 1; index <= segments.length; index++) for (const filename2 of filenames) {
|
|
34
34
|
const filePath = join(...segments.slice(0, index), filename2);
|
|
@@ -95,10 +95,10 @@ async function resolvePackageJSON(id = process.cwd(), options = {}) {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
const workspaceTests = {
|
|
98
|
-
workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r
|
|
99
|
-
gitConfig: (opts) => findFile(".git/config", opts).then((r
|
|
100
|
-
lockFile: (opts) => findFile(lockFiles, opts).then((r
|
|
101
|
-
packageJson: (opts) => findFile(packageFiles, opts).then((r
|
|
98
|
+
workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => dirname(r)),
|
|
99
|
+
gitConfig: (opts) => findFile(".git/config", opts).then((r) => resolve(r, "../..")),
|
|
100
|
+
lockFile: (opts) => findFile(lockFiles, opts).then((r) => dirname(r)),
|
|
101
|
+
packageJson: (opts) => findFile(packageFiles, opts).then((r) => dirname(r))
|
|
102
102
|
};
|
|
103
103
|
async function findWorkspaceDir(id = process.cwd(), options = {}) {
|
|
104
104
|
const startingFrom = _resolvePath(id, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["r","parseJSON","parseJSONC"],"sources":["../../../../../../../../../node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs"],"sourcesContent":["import { statSync, promises } from 'node:fs';\nimport { resolve, join, normalize, isAbsolute, dirname } from 'pathe';\nimport { parseJSONC, stringifyJSONC, parseJSON, stringifyJSON, parseJSON5, parseYAML, stringifyJSON5, stringifyYAML } from 'confbox';\nimport { resolveModulePath } from 'exsolve';\nimport { fileURLToPath } from 'node:url';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { parseINI, stringifyINI } from 'confbox/ini';\n\nconst defaultFindOptions = {\n startingFrom: \".\",\n rootPattern: /^node_modules$/,\n reverse: false,\n test: (filePath) => {\n try {\n if (statSync(filePath).isFile()) {\n return true;\n }\n } catch {\n }\n }\n};\nasync function findFile(filename, _options = {}) {\n const filenames = Array.isArray(filename) ? filename : [filename];\n const options = { ...defaultFindOptions, ..._options };\n const basePath = resolve(options.startingFrom);\n const leadingSlash = basePath[0] === \"/\";\n const segments = basePath.split(\"/\").filter(Boolean);\n if (filenames.includes(segments.at(-1)) && await options.test(basePath)) {\n return basePath;\n }\n if (leadingSlash) {\n segments[0] = \"/\" + segments[0];\n }\n let root = segments.findIndex((r) => r.match(options.rootPattern));\n if (root === -1) {\n root = 0;\n }\n if (options.reverse) {\n for (let index = root + 1; index <= segments.length; index++) {\n for (const filename2 of filenames) {\n const filePath = join(...segments.slice(0, index), filename2);\n if (await options.test(filePath)) {\n return filePath;\n }\n }\n }\n } else {\n for (let index = segments.length; index > root; index--) {\n for (const filename2 of filenames) {\n const filePath = join(...segments.slice(0, index), filename2);\n if (await options.test(filePath)) {\n return filePath;\n }\n }\n }\n }\n throw new Error(\n `Cannot find matching ${filename} in ${options.startingFrom} or parent directories`\n );\n}\nfunction findNearestFile(filename, options = {}) {\n return findFile(filename, options);\n}\nfunction findFarthestFile(filename, options = {}) {\n return findFile(filename, { ...options, reverse: true });\n}\n\nfunction _resolvePath(id, opts = {}) {\n if (id instanceof URL || id.startsWith(\"file://\")) {\n return normalize(fileURLToPath(id));\n }\n if (isAbsolute(id)) {\n return normalize(id);\n }\n return resolveModulePath(id, {\n ...opts,\n from: opts.from || opts.parent || opts.url\n });\n}\n\nconst FileCache$1 = /* @__PURE__ */ new Map();\nfunction defineTSConfig(tsconfig) {\n return tsconfig;\n}\nasync function readTSConfig(id, options = {}) {\n const resolvedPath = await resolveTSConfig(id, options);\n const cache = options.cache && typeof options.cache !== \"boolean\" ? options.cache : FileCache$1;\n if (options.cache && cache.has(resolvedPath)) {\n return cache.get(resolvedPath);\n }\n const text = await promises.readFile(resolvedPath, \"utf8\");\n const parsed = parseJSONC(text);\n cache.set(resolvedPath, parsed);\n return parsed;\n}\nasync function writeTSConfig(path, tsconfig) {\n await promises.writeFile(path, stringifyJSONC(tsconfig));\n}\nasync function resolveTSConfig(id = process.cwd(), options = {}) {\n return findNearestFile(\"tsconfig.json\", {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\n\nconst lockFiles = [\n \"yarn.lock\",\n \"package-lock.json\",\n \"pnpm-lock.yaml\",\n \"npm-shrinkwrap.json\",\n \"bun.lockb\",\n \"bun.lock\",\n \"deno.lock\"\n];\nconst packageFiles = [\"package.json\", \"package.json5\", \"package.yaml\"];\nconst workspaceFiles = [\n \"pnpm-workspace.yaml\",\n \"lerna.json\",\n \"turbo.json\",\n \"rush.json\",\n \"deno.json\",\n \"deno.jsonc\"\n];\nconst FileCache = /* @__PURE__ */ new Map();\nfunction definePackageJSON(pkg) {\n return pkg;\n}\nasync function findPackage(id = process.cwd(), options = {}) {\n return findNearestFile(packageFiles, {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\nasync function readPackage(id, options = {}) {\n const resolvedPath = await findPackage(id, options);\n const cache = options.cache && typeof options.cache !== \"boolean\" ? options.cache : FileCache;\n if (options.cache && cache.has(resolvedPath)) {\n return cache.get(resolvedPath);\n }\n const blob = await promises.readFile(resolvedPath, \"utf8\");\n let parsed;\n if (resolvedPath.endsWith(\".json5\")) {\n parsed = parseJSON5(blob);\n } else if (resolvedPath.endsWith(\".yaml\")) {\n parsed = parseYAML(blob);\n } else {\n try {\n parsed = parseJSON(blob);\n } catch {\n parsed = parseJSONC(blob);\n }\n }\n cache.set(resolvedPath, parsed);\n return parsed;\n}\nasync function writePackage(path, pkg) {\n let content;\n if (path.endsWith(\".json5\")) {\n content = stringifyJSON5(pkg);\n } else if (path.endsWith(\".yaml\")) {\n content = stringifyYAML(pkg);\n } else {\n content = stringifyJSON(pkg);\n }\n await promises.writeFile(path, content);\n}\nasync function readPackageJSON(id, options = {}) {\n const resolvedPath = await resolvePackageJSON(id, options);\n const cache = options.cache && typeof options.cache !== \"boolean\" ? options.cache : FileCache;\n if (options.cache && cache.has(resolvedPath)) {\n return cache.get(resolvedPath);\n }\n const blob = await promises.readFile(resolvedPath, \"utf8\");\n let parsed;\n try {\n parsed = parseJSON(blob);\n } catch {\n parsed = parseJSONC(blob);\n }\n cache.set(resolvedPath, parsed);\n return parsed;\n}\nasync function writePackageJSON(path, pkg) {\n await promises.writeFile(path, stringifyJSON(pkg));\n}\nasync function resolvePackageJSON(id = process.cwd(), options = {}) {\n return findNearestFile(\"package.json\", {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\nasync function resolveLockfile(id = process.cwd(), options = {}) {\n return findNearestFile(lockFiles, {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\nconst workspaceTests = {\n workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => dirname(r)),\n gitConfig: (opts) => findFile(\".git/config\", opts).then((r) => resolve(r, \"../..\")),\n lockFile: (opts) => findFile(lockFiles, opts).then((r) => dirname(r)),\n packageJson: (opts) => findFile(packageFiles, opts).then((r) => dirname(r))\n};\nasync function findWorkspaceDir(id = process.cwd(), options = {}) {\n const startingFrom = _resolvePath(id, options);\n const tests = options.tests || [\"workspaceFile\", \"gitConfig\", \"lockFile\", \"packageJson\"];\n for (const testName of tests) {\n const test = workspaceTests[testName];\n if (options[testName] === false || !test) {\n continue;\n }\n const direction = options[testName] || (testName === \"gitConfig\" ? \"closest\" : \"furthest\");\n const detected = await test({\n ...options,\n startingFrom,\n reverse: direction === \"furthest\"\n }).catch(() => {\n });\n if (detected) {\n return detected;\n }\n }\n throw new Error(`Cannot detect workspace root from ${id}`);\n}\nasync function updatePackage(id, callback, options = {}) {\n const resolvedPath = await findPackage(id, options);\n const pkg = await readPackage(id, options);\n const proxy = new Proxy(pkg, {\n get(target, prop) {\n if (typeof prop === \"string\" && objectKeys.has(prop) && !Object.hasOwn(target, prop)) {\n target[prop] = {};\n }\n return Reflect.get(target, prop);\n }\n });\n const updated = await callback(proxy) || pkg;\n await writePackage(resolvedPath, updated);\n}\nfunction sortPackage(pkg) {\n const sorted = {};\n const originalKeys = Object.keys(pkg);\n const knownKeysPresent = defaultFieldOrder.filter(\n (key) => Object.hasOwn(pkg, key)\n );\n for (const key of originalKeys) {\n const currentIndex = knownKeysPresent.indexOf(key);\n if (currentIndex === -1) {\n sorted[key] = pkg[key];\n continue;\n }\n for (let i = 0; i <= currentIndex; i++) {\n const knownKey = knownKeysPresent[i];\n if (!Object.hasOwn(sorted, knownKey)) {\n sorted[knownKey] = pkg[knownKey];\n }\n }\n }\n for (const key of [...dependencyKeys, \"scripts\"]) {\n const value = sorted[key];\n if (isObject(value)) {\n sorted[key] = sortObject(value);\n }\n }\n return sorted;\n}\nfunction normalizePackage(pkg) {\n const normalized = sortPackage(pkg);\n for (const key of dependencyKeys) {\n if (!Object.hasOwn(normalized, key)) {\n continue;\n }\n const value = normalized[key];\n if (!isObject(value)) {\n delete normalized[key];\n }\n }\n return normalized;\n}\nfunction isObject(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction sortObject(obj) {\n return Object.fromEntries(\n Object.entries(obj).sort(([a], [b]) => a.localeCompare(b))\n );\n}\nconst dependencyKeys = [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\"\n];\nconst objectKeys = /* @__PURE__ */ new Set([\n \"typesVersions\",\n \"scripts\",\n \"resolutions\",\n \"overrides\",\n \"dependencies\",\n \"devDependencies\",\n \"dependenciesMeta\",\n \"peerDependencies\",\n \"peerDependenciesMeta\",\n \"optionalDependencies\",\n \"engines\",\n \"publishConfig\"\n]);\nconst defaultFieldOrder = [\n \"$schema\",\n \"name\",\n \"version\",\n \"private\",\n \"description\",\n \"keywords\",\n \"homepage\",\n \"bugs\",\n \"repository\",\n \"funding\",\n \"license\",\n \"author\",\n \"sideEffects\",\n \"type\",\n \"imports\",\n \"exports\",\n \"main\",\n \"module\",\n \"browser\",\n \"types\",\n \"typesVersions\",\n \"typings\",\n \"bin\",\n \"man\",\n \"files\",\n \"workspaces\",\n \"scripts\",\n \"resolutions\",\n \"overrides\",\n \"dependencies\",\n \"devDependencies\",\n \"dependenciesMeta\",\n \"peerDependencies\",\n \"peerDependenciesMeta\",\n \"optionalDependencies\",\n \"bundledDependencies\",\n \"bundleDependencies\",\n \"packageManager\",\n \"engines\",\n \"publishConfig\"\n];\n\nfunction defineGitConfig(config) {\n return config;\n}\nasync function resolveGitConfig(dir, opts) {\n return findNearestFile(\".git/config\", { ...opts, startingFrom: dir });\n}\nasync function readGitConfig(dir, opts) {\n const path = await resolveGitConfig(dir, opts);\n const ini = await readFile(path, \"utf8\");\n return parseGitConfig(ini);\n}\nasync function writeGitConfig(path, config) {\n await writeFile(path, stringifyGitConfig(config));\n}\nfunction parseGitConfig(ini) {\n return parseINI(ini.replaceAll(/^\\[(\\w+) \"(.+)\"\\]$/gm, \"[$1.$2]\"));\n}\nfunction stringifyGitConfig(config) {\n return stringifyINI(config).replaceAll(/^\\[(\\w+)\\.(\\w+)\\]$/gm, '[$1 \"$2\"]');\n}\n\nexport { defineGitConfig, definePackageJSON, defineTSConfig, findFarthestFile, findFile, findNearestFile, findPackage, findWorkspaceDir, normalizePackage, parseGitConfig, readGitConfig, readPackage, readPackageJSON, readTSConfig, resolveGitConfig, resolveLockfile, resolvePackageJSON, resolveTSConfig, sortPackage, stringifyGitConfig, updatePackage, writeGitConfig, writePackage, writePackageJSON, writeTSConfig };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAQA,MAAM,qBAAqB;CACzB,cAAc;CACd,aAAa;CACb,SAAS;CACT,OAAO,aAAa;AAClB,MAAI;AACF,OAAI,SAAS,SAAS,CAAC,QAAQ,CAC7B,QAAO;UAEH;;CAGX;AACD,eAAe,SAAS,UAAU,WAAW,EAAE,EAAE;CAC/C,MAAM,YAAY,MAAM,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS;CAC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C;EAAiB;EAAa;EAAY;EAAc;AACxF,MAAK,MAAM,YAAY,OAAO;EAC5B,MAAM,OAAO,eAAe;AAC5B,MAAI,QAAQ,cAAc,SAAS,CAAC,KAClC;EAEF,MAAM,YAAY,QAAQ,cAAc,aAAa,cAAc,YAAY;EAC/E,MAAM,WAAW,MAAM,KAAK;GAC1B,GAAG;GACH;GACA,SAAS,cAAc;GACxB,CAAC,CAAC,YAAY,GACb;AACF,MAAI,SACF,QAAO;;AAGX,OAAM,IAAI,MAAM,qCAAqC,KAAK"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["parseJSON","parseJSONC"],"sources":["../../../../../../../../../node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs"],"sourcesContent":["import { statSync, promises } from 'node:fs';\nimport { resolve, join, normalize, isAbsolute, dirname } from 'pathe';\nimport { parseJSONC, stringifyJSONC, parseJSON, stringifyJSON, parseJSON5, parseYAML, stringifyJSON5, stringifyYAML } from 'confbox';\nimport { resolveModulePath } from 'exsolve';\nimport { fileURLToPath } from 'node:url';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { parseINI, stringifyINI } from 'confbox/ini';\n\nconst defaultFindOptions = {\n startingFrom: \".\",\n rootPattern: /^node_modules$/,\n reverse: false,\n test: (filePath) => {\n try {\n if (statSync(filePath).isFile()) {\n return true;\n }\n } catch {\n }\n }\n};\nasync function findFile(filename, _options = {}) {\n const filenames = Array.isArray(filename) ? filename : [filename];\n const options = { ...defaultFindOptions, ..._options };\n const basePath = resolve(options.startingFrom);\n const leadingSlash = basePath[0] === \"/\";\n const segments = basePath.split(\"/\").filter(Boolean);\n if (filenames.includes(segments.at(-1)) && await options.test(basePath)) {\n return basePath;\n }\n if (leadingSlash) {\n segments[0] = \"/\" + segments[0];\n }\n let root = segments.findIndex((r) => r.match(options.rootPattern));\n if (root === -1) {\n root = 0;\n }\n if (options.reverse) {\n for (let index = root + 1; index <= segments.length; index++) {\n for (const filename2 of filenames) {\n const filePath = join(...segments.slice(0, index), filename2);\n if (await options.test(filePath)) {\n return filePath;\n }\n }\n }\n } else {\n for (let index = segments.length; index > root; index--) {\n for (const filename2 of filenames) {\n const filePath = join(...segments.slice(0, index), filename2);\n if (await options.test(filePath)) {\n return filePath;\n }\n }\n }\n }\n throw new Error(\n `Cannot find matching ${filename} in ${options.startingFrom} or parent directories`\n );\n}\nfunction findNearestFile(filename, options = {}) {\n return findFile(filename, options);\n}\nfunction findFarthestFile(filename, options = {}) {\n return findFile(filename, { ...options, reverse: true });\n}\n\nfunction _resolvePath(id, opts = {}) {\n if (id instanceof URL || id.startsWith(\"file://\")) {\n return normalize(fileURLToPath(id));\n }\n if (isAbsolute(id)) {\n return normalize(id);\n }\n return resolveModulePath(id, {\n ...opts,\n from: opts.from || opts.parent || opts.url\n });\n}\n\nconst FileCache$1 = /* @__PURE__ */ new Map();\nfunction defineTSConfig(tsconfig) {\n return tsconfig;\n}\nasync function readTSConfig(id, options = {}) {\n const resolvedPath = await resolveTSConfig(id, options);\n const cache = options.cache && typeof options.cache !== \"boolean\" ? options.cache : FileCache$1;\n if (options.cache && cache.has(resolvedPath)) {\n return cache.get(resolvedPath);\n }\n const text = await promises.readFile(resolvedPath, \"utf8\");\n const parsed = parseJSONC(text);\n cache.set(resolvedPath, parsed);\n return parsed;\n}\nasync function writeTSConfig(path, tsconfig) {\n await promises.writeFile(path, stringifyJSONC(tsconfig));\n}\nasync function resolveTSConfig(id = process.cwd(), options = {}) {\n return findNearestFile(\"tsconfig.json\", {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\n\nconst lockFiles = [\n \"yarn.lock\",\n \"package-lock.json\",\n \"pnpm-lock.yaml\",\n \"npm-shrinkwrap.json\",\n \"bun.lockb\",\n \"bun.lock\",\n \"deno.lock\"\n];\nconst packageFiles = [\"package.json\", \"package.json5\", \"package.yaml\"];\nconst workspaceFiles = [\n \"pnpm-workspace.yaml\",\n \"lerna.json\",\n \"turbo.json\",\n \"rush.json\",\n \"deno.json\",\n \"deno.jsonc\"\n];\nconst FileCache = /* @__PURE__ */ new Map();\nfunction definePackageJSON(pkg) {\n return pkg;\n}\nasync function findPackage(id = process.cwd(), options = {}) {\n return findNearestFile(packageFiles, {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\nasync function readPackage(id, options = {}) {\n const resolvedPath = await findPackage(id, options);\n const cache = options.cache && typeof options.cache !== \"boolean\" ? options.cache : FileCache;\n if (options.cache && cache.has(resolvedPath)) {\n return cache.get(resolvedPath);\n }\n const blob = await promises.readFile(resolvedPath, \"utf8\");\n let parsed;\n if (resolvedPath.endsWith(\".json5\")) {\n parsed = parseJSON5(blob);\n } else if (resolvedPath.endsWith(\".yaml\")) {\n parsed = parseYAML(blob);\n } else {\n try {\n parsed = parseJSON(blob);\n } catch {\n parsed = parseJSONC(blob);\n }\n }\n cache.set(resolvedPath, parsed);\n return parsed;\n}\nasync function writePackage(path, pkg) {\n let content;\n if (path.endsWith(\".json5\")) {\n content = stringifyJSON5(pkg);\n } else if (path.endsWith(\".yaml\")) {\n content = stringifyYAML(pkg);\n } else {\n content = stringifyJSON(pkg);\n }\n await promises.writeFile(path, content);\n}\nasync function readPackageJSON(id, options = {}) {\n const resolvedPath = await resolvePackageJSON(id, options);\n const cache = options.cache && typeof options.cache !== \"boolean\" ? options.cache : FileCache;\n if (options.cache && cache.has(resolvedPath)) {\n return cache.get(resolvedPath);\n }\n const blob = await promises.readFile(resolvedPath, \"utf8\");\n let parsed;\n try {\n parsed = parseJSON(blob);\n } catch {\n parsed = parseJSONC(blob);\n }\n cache.set(resolvedPath, parsed);\n return parsed;\n}\nasync function writePackageJSON(path, pkg) {\n await promises.writeFile(path, stringifyJSON(pkg));\n}\nasync function resolvePackageJSON(id = process.cwd(), options = {}) {\n return findNearestFile(\"package.json\", {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\nasync function resolveLockfile(id = process.cwd(), options = {}) {\n return findNearestFile(lockFiles, {\n ...options,\n startingFrom: _resolvePath(id, options)\n });\n}\nconst workspaceTests = {\n workspaceFile: (opts) => findFile(workspaceFiles, opts).then((r) => dirname(r)),\n gitConfig: (opts) => findFile(\".git/config\", opts).then((r) => resolve(r, \"../..\")),\n lockFile: (opts) => findFile(lockFiles, opts).then((r) => dirname(r)),\n packageJson: (opts) => findFile(packageFiles, opts).then((r) => dirname(r))\n};\nasync function findWorkspaceDir(id = process.cwd(), options = {}) {\n const startingFrom = _resolvePath(id, options);\n const tests = options.tests || [\"workspaceFile\", \"gitConfig\", \"lockFile\", \"packageJson\"];\n for (const testName of tests) {\n const test = workspaceTests[testName];\n if (options[testName] === false || !test) {\n continue;\n }\n const direction = options[testName] || (testName === \"gitConfig\" ? \"closest\" : \"furthest\");\n const detected = await test({\n ...options,\n startingFrom,\n reverse: direction === \"furthest\"\n }).catch(() => {\n });\n if (detected) {\n return detected;\n }\n }\n throw new Error(`Cannot detect workspace root from ${id}`);\n}\nasync function updatePackage(id, callback, options = {}) {\n const resolvedPath = await findPackage(id, options);\n const pkg = await readPackage(id, options);\n const proxy = new Proxy(pkg, {\n get(target, prop) {\n if (typeof prop === \"string\" && objectKeys.has(prop) && !Object.hasOwn(target, prop)) {\n target[prop] = {};\n }\n return Reflect.get(target, prop);\n }\n });\n const updated = await callback(proxy) || pkg;\n await writePackage(resolvedPath, updated);\n}\nfunction sortPackage(pkg) {\n const sorted = {};\n const originalKeys = Object.keys(pkg);\n const knownKeysPresent = defaultFieldOrder.filter(\n (key) => Object.hasOwn(pkg, key)\n );\n for (const key of originalKeys) {\n const currentIndex = knownKeysPresent.indexOf(key);\n if (currentIndex === -1) {\n sorted[key] = pkg[key];\n continue;\n }\n for (let i = 0; i <= currentIndex; i++) {\n const knownKey = knownKeysPresent[i];\n if (!Object.hasOwn(sorted, knownKey)) {\n sorted[knownKey] = pkg[knownKey];\n }\n }\n }\n for (const key of [...dependencyKeys, \"scripts\"]) {\n const value = sorted[key];\n if (isObject(value)) {\n sorted[key] = sortObject(value);\n }\n }\n return sorted;\n}\nfunction normalizePackage(pkg) {\n const normalized = sortPackage(pkg);\n for (const key of dependencyKeys) {\n if (!Object.hasOwn(normalized, key)) {\n continue;\n }\n const value = normalized[key];\n if (!isObject(value)) {\n delete normalized[key];\n }\n }\n return normalized;\n}\nfunction isObject(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction sortObject(obj) {\n return Object.fromEntries(\n Object.entries(obj).sort(([a], [b]) => a.localeCompare(b))\n );\n}\nconst dependencyKeys = [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\"\n];\nconst objectKeys = /* @__PURE__ */ new Set([\n \"typesVersions\",\n \"scripts\",\n \"resolutions\",\n \"overrides\",\n \"dependencies\",\n \"devDependencies\",\n \"dependenciesMeta\",\n \"peerDependencies\",\n \"peerDependenciesMeta\",\n \"optionalDependencies\",\n \"engines\",\n \"publishConfig\"\n]);\nconst defaultFieldOrder = [\n \"$schema\",\n \"name\",\n \"version\",\n \"private\",\n \"description\",\n \"keywords\",\n \"homepage\",\n \"bugs\",\n \"repository\",\n \"funding\",\n \"license\",\n \"author\",\n \"sideEffects\",\n \"type\",\n \"imports\",\n \"exports\",\n \"main\",\n \"module\",\n \"browser\",\n \"types\",\n \"typesVersions\",\n \"typings\",\n \"bin\",\n \"man\",\n \"files\",\n \"workspaces\",\n \"scripts\",\n \"resolutions\",\n \"overrides\",\n \"dependencies\",\n \"devDependencies\",\n \"dependenciesMeta\",\n \"peerDependencies\",\n \"peerDependenciesMeta\",\n \"optionalDependencies\",\n \"bundledDependencies\",\n \"bundleDependencies\",\n \"packageManager\",\n \"engines\",\n \"publishConfig\"\n];\n\nfunction defineGitConfig(config) {\n return config;\n}\nasync function resolveGitConfig(dir, opts) {\n return findNearestFile(\".git/config\", { ...opts, startingFrom: dir });\n}\nasync function readGitConfig(dir, opts) {\n const path = await resolveGitConfig(dir, opts);\n const ini = await readFile(path, \"utf8\");\n return parseGitConfig(ini);\n}\nasync function writeGitConfig(path, config) {\n await writeFile(path, stringifyGitConfig(config));\n}\nfunction parseGitConfig(ini) {\n return parseINI(ini.replaceAll(/^\\[(\\w+) \"(.+)\"\\]$/gm, \"[$1.$2]\"));\n}\nfunction stringifyGitConfig(config) {\n return stringifyINI(config).replaceAll(/^\\[(\\w+)\\.(\\w+)\\]$/gm, '[$1 \"$2\"]');\n}\n\nexport { defineGitConfig, definePackageJSON, defineTSConfig, findFarthestFile, findFile, findNearestFile, findPackage, findWorkspaceDir, normalizePackage, parseGitConfig, readGitConfig, readPackage, readPackageJSON, readTSConfig, resolveGitConfig, resolveLockfile, resolvePackageJSON, resolveTSConfig, sortPackage, stringifyGitConfig, updatePackage, writeGitConfig, writePackage, writePackageJSON, writeTSConfig };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAQA,MAAM,qBAAqB;CACzB,cAAc;CACd,aAAa;CACb,SAAS;CACT,OAAO,aAAa;AAClB,MAAI;AACF,OAAI,SAAS,SAAS,CAAC,QAAQ,CAC7B,QAAO;UAEH;;CAGX;AACD,eAAe,SAAS,UAAU,WAAW,EAAE,EAAE;CAC/C,MAAM,YAAY,MAAM,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS;CACjE,MAAM,UAAU;EAAE,GAAG;EAAoB,GAAG;EAAU;CACtD,MAAM,WAAW,QAAQ,QAAQ,aAAa;CAC9C,MAAM,eAAe,SAAS,OAAO;CACrC,MAAM,WAAW,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AACpD,KAAI,UAAU,SAAS,SAAS,GAAG,GAAG,CAAC,IAAI,MAAM,QAAQ,KAAK,SAAS,CACrE,QAAO;AAET,KAAI,aACF,UAAS,KAAK,MAAM,SAAS;CAE/B,IAAI,OAAO,SAAS,WAAW,MAAM,EAAE,MAAM,QAAQ,YAAY,CAAC;AAClE,KAAI,SAAS,GACX,QAAO;AAET,KAAI,QAAQ,QACV,MAAK,IAAI,QAAQ,OAAO,GAAG,SAAS,SAAS,QAAQ,QACnD,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OAAO;CAC1D,IAAI;AACJ,KAAI;AACF,WAASA,EAAU,KAAK;SAClB;AACN,WAASC,EAAW,KAAK;;AAE3B,OAAM,IAAI,cAAc,OAAO;AAC/B,QAAO;;AAKT,eAAe,mBAAmB,KAAK,QAAQ,KAAK,EAAE,UAAU,EAAE,EAAE;AAClE,QAAO,gBAAgB,gBAAgB;EACrC,GAAG;EACH,cAAc,aAAa,IAAI,QAAQ;EACxC,CAAC;;AAQJ,MAAM,iBAAiB;CACrB,gBAAgB,SAAS,SAAS,gBAAgB,KAAK,CAAC,MAAM,MAAM,QAAQ,EAAE,CAAC;CAC/E,YAAY,SAAS,SAAS,eAAe,KAAK,CAAC,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;CACnF,WAAW,SAAS,SAAS,WAAW,KAAK,CAAC,MAAM,MAAM,QAAQ,EAAE,CAAC;CACrE,cAAc,SAAS,SAAS,cAAc,KAAK,CAAC,MAAM,MAAM,QAAQ,EAAE,CAAC;CAC5E;AACD,eAAe,iBAAiB,KAAK,QAAQ,KAAK,EAAE,UAAU,EAAE,EAAE;CAChE,MAAM,eAAe,aAAa,IAAI,QAAQ;CAC9C,MAAM,QAAQ,QAAQ,SAAS;EAAC;EAAiB;EAAa;EAAY;EAAc;AACxF,MAAK,MAAM,YAAY,OAAO;EAC5B,MAAM,OAAO,eAAe;AAC5B,MAAI,QAAQ,cAAc,SAAS,CAAC,KAClC;EAEF,MAAM,YAAY,QAAQ,cAAc,aAAa,cAAc,YAAY;EAC/E,MAAM,WAAW,MAAM,KAAK;GAC1B,GAAG;GACH;GACA,SAAS,cAAc;GACxB,CAAC,CAAC,YAAY,GACb;AACF,MAAI,SACF,QAAO;;AAGX,OAAM,IAAI,MAAM,qCAAqC,KAAK"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_runtime = require('../../../../../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_index = require('../../../../destr@2.0.5/node_modules/destr/dist/index.cjs');
|
|
3
|
-
require('../../../../defu@6.1.4/node_modules/defu/dist/defu.cjs');
|
|
4
3
|
let node_fs = require("node:fs");
|
|
5
4
|
let node_path = require("node:path");
|
|
6
5
|
let node_os = require("node:os");
|
|
6
|
+
let defu = require("defu");
|
|
7
7
|
|
|
8
8
|
//#region ../../node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs
|
|
9
9
|
function isBuffer(obj) {
|
|
@@ -45,10 +45,10 @@ function unflatten(target, opts) {
|
|
|
45
45
|
const parsedKey = Number(key);
|
|
46
46
|
return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
|
|
47
47
|
}
|
|
48
|
-
function addKeys(keyPrefix, recipient, target
|
|
49
|
-
return Object.keys(target
|
|
50
|
-
result
|
|
51
|
-
return result
|
|
48
|
+
function addKeys(keyPrefix, recipient, target) {
|
|
49
|
+
return Object.keys(target).reduce(function(result, key) {
|
|
50
|
+
result[keyPrefix + delimiter + key] = target[key];
|
|
51
|
+
return result;
|
|
52
52
|
}, recipient);
|
|
53
53
|
}
|
|
54
54
|
function isEmpty(val) {
|
|
@@ -59,12 +59,12 @@ function unflatten(target, opts) {
|
|
|
59
59
|
else if (isArray) return !val.length;
|
|
60
60
|
else if (isObject) return !Object.keys(val).length;
|
|
61
61
|
}
|
|
62
|
-
target = Object.keys(target).reduce(function(result
|
|
62
|
+
target = Object.keys(target).reduce(function(result, key) {
|
|
63
63
|
const type = Object.prototype.toString.call(target[key]);
|
|
64
64
|
if (!(type === "[object Object]" || type === "[object Array]") || isEmpty(target[key])) {
|
|
65
|
-
result
|
|
66
|
-
return result
|
|
67
|
-
} else return addKeys(key, result
|
|
65
|
+
result[key] = target[key];
|
|
66
|
+
return result;
|
|
67
|
+
} else return addKeys(key, result, flatten(target[key], opts));
|
|
68
68
|
}, {});
|
|
69
69
|
Object.keys(target).forEach(function(key) {
|
|
70
70
|
const split = key.split(delimiter).map(transformKey);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { destr } from "../../../../destr@2.0.5/node_modules/destr/dist/index.mjs";
|
|
2
|
-
import "../../../../defu@6.1.4/node_modules/defu/dist/defu.mjs";
|
|
3
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
3
|
import { resolve } from "node:path";
|
|
5
4
|
import { homedir } from "node:os";
|
|
5
|
+
import { defu as defu$1 } from "defu";
|
|
6
6
|
|
|
7
7
|
//#region ../../node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs
|
|
8
8
|
function isBuffer(obj) {
|
|
@@ -13,7 +13,7 @@ function keyIdentity(key) {
|
|
|
13
13
|
}
|
|
14
14
|
function flatten(target, opts) {
|
|
15
15
|
opts = opts || {};
|
|
16
|
-
const delimiter
|
|
16
|
+
const delimiter = opts.delimiter || ".";
|
|
17
17
|
const maxDepth = opts.maxDepth;
|
|
18
18
|
const transformKey = opts.transformKey || keyIdentity;
|
|
19
19
|
const output = {};
|
|
@@ -25,7 +25,7 @@ function flatten(target, opts) {
|
|
|
25
25
|
const type = Object.prototype.toString.call(value);
|
|
26
26
|
const isbuffer = isBuffer(value);
|
|
27
27
|
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
28
|
-
const newKey = prev ? prev + delimiter
|
|
28
|
+
const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
|
|
29
29
|
if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
|
|
30
30
|
output[newKey] = value;
|
|
31
31
|
});
|
|
@@ -35,7 +35,7 @@ function flatten(target, opts) {
|
|
|
35
35
|
}
|
|
36
36
|
function unflatten(target, opts) {
|
|
37
37
|
opts = opts || {};
|
|
38
|
-
const delimiter
|
|
38
|
+
const delimiter = opts.delimiter || ".";
|
|
39
39
|
const overwrite = opts.overwrite || false;
|
|
40
40
|
const transformKey = opts.transformKey || keyIdentity;
|
|
41
41
|
const result = {};
|
|
@@ -44,10 +44,10 @@ function unflatten(target, opts) {
|
|
|
44
44
|
const parsedKey = Number(key);
|
|
45
45
|
return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
|
|
46
46
|
}
|
|
47
|
-
function addKeys(keyPrefix, recipient, target
|
|
48
|
-
return Object.keys(target
|
|
49
|
-
result
|
|
50
|
-
return result
|
|
47
|
+
function addKeys(keyPrefix, recipient, target) {
|
|
48
|
+
return Object.keys(target).reduce(function(result, key) {
|
|
49
|
+
result[keyPrefix + delimiter + key] = target[key];
|
|
50
|
+
return result;
|
|
51
51
|
}, recipient);
|
|
52
52
|
}
|
|
53
53
|
function isEmpty(val) {
|
|
@@ -58,15 +58,15 @@ function unflatten(target, opts) {
|
|
|
58
58
|
else if (isArray) return !val.length;
|
|
59
59
|
else if (isObject) return !Object.keys(val).length;
|
|
60
60
|
}
|
|
61
|
-
target = Object.keys(target).reduce(function(result
|
|
61
|
+
target = Object.keys(target).reduce(function(result, key) {
|
|
62
62
|
const type = Object.prototype.toString.call(target[key]);
|
|
63
63
|
if (!(type === "[object Object]" || type === "[object Array]") || isEmpty(target[key])) {
|
|
64
|
-
result
|
|
65
|
-
return result
|
|
66
|
-
} else return addKeys(key, result
|
|
64
|
+
result[key] = target[key];
|
|
65
|
+
return result;
|
|
66
|
+
} else return addKeys(key, result, flatten(target[key], opts));
|
|
67
67
|
}, {});
|
|
68
68
|
Object.keys(target).forEach(function(key) {
|
|
69
|
-
const split = key.split(delimiter
|
|
69
|
+
const split = key.split(delimiter).map(transformKey);
|
|
70
70
|
let key1 = getkey(split.shift());
|
|
71
71
|
let key2 = getkey(split[0]);
|
|
72
72
|
let recipient = result;
|
|
@@ -118,9 +118,9 @@ function parse(contents, options = {}) {
|
|
|
118
118
|
}
|
|
119
119
|
return options.flat ? config : unflatten(config, { overwrite: true });
|
|
120
120
|
}
|
|
121
|
-
function parseFile(path
|
|
122
|
-
if (!existsSync(path
|
|
123
|
-
return parse(readFileSync(path
|
|
121
|
+
function parseFile(path, options) {
|
|
122
|
+
if (!existsSync(path)) return {};
|
|
123
|
+
return parse(readFileSync(path, "utf8"), options);
|
|
124
124
|
}
|
|
125
125
|
function read(options) {
|
|
126
126
|
options = withDefaults(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["delimiter","target","result","path"],"sources":["../../../../../../../../../node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs"],"sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { homedir } from 'node:os';\nimport destr from 'destr';\nimport { defu } from 'defu';\n\nfunction isBuffer (obj) {\n return obj &&\n obj.constructor &&\n (typeof obj.constructor.isBuffer === 'function') &&\n obj.constructor.isBuffer(obj)\n}\n\nfunction keyIdentity (key) {\n return key\n}\n\nfunction flatten (target, opts) {\n opts = opts || {};\n\n const delimiter = opts.delimiter || '.';\n const maxDepth = opts.maxDepth;\n const transformKey = opts.transformKey || keyIdentity;\n const output = {};\n\n function step (object, prev, currentDepth) {\n currentDepth = currentDepth || 1;\n Object.keys(object).forEach(function (key) {\n const value = object[key];\n const isarray = opts.safe && Array.isArray(value);\n const type = Object.prototype.toString.call(value);\n const isbuffer = isBuffer(value);\n const isobject = (\n type === '[object Object]' ||\n type === '[object Array]'\n );\n\n const newKey = prev\n ? prev + delimiter + transformKey(key)\n : transformKey(key);\n\n if (!isarray && !isbuffer && isobject && Object.keys(value).length &&\n (!opts.maxDepth || currentDepth < maxDepth)) {\n return step(value, newKey, currentDepth + 1)\n }\n\n output[newKey] = value;\n });\n }\n\n step(target);\n\n return output\n}\n\nfunction unflatten (target, opts) {\n opts = opts || {};\n\n const delimiter = opts.delimiter || '.';\n const overwrite = opts.overwrite || false;\n const transformKey = opts.transformKey || keyIdentity;\n const result = {};\n\n const isbuffer = isBuffer(target);\n if (isbuffer || Object.prototype.toString.call(target) !== '[object Object]') {\n return target\n }\n\n // safely ensure that the key is\n // an integer.\n function getkey (key) {\n const parsedKey = Number(key);\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n )\n ? key\n : parsedKey\n }\n\n function addKeys (keyPrefix, recipient, target) {\n return Object.keys(target).reduce(function (result, key) {\n result[keyPrefix + delimiter + key] = target[key];\n\n return result\n }, recipient)\n }\n\n function isEmpty (val) {\n const type = Object.prototype.toString.call(val);\n const isArray = type === '[object Array]';\n const isObject = type === '[object Object]';\n\n if (!val) {\n return true\n } else if (isArray) {\n return !val.length\n } else if (isObject) {\n return !Object.keys(val).length\n }\n }\n\n target = Object.keys(target).reduce(function (result, key) {\n const type = Object.prototype.toString.call(target[key]);\n const isObject = (type === '[object Object]' || type === '[object Array]');\n if (!isObject || isEmpty(target[key])) {\n result[key] = target[key];\n return result\n } else {\n return addKeys(\n key,\n result,\n flatten(target[key], opts)\n )\n }\n }, {});\n\n Object.keys(target).forEach(function (key) {\n const split = key.split(delimiter).map(transformKey);\n let key1 = getkey(split.shift());\n let key2 = getkey(split[0]);\n let recipient = result;\n\n while (key2 !== undefined) {\n if (key1 === '__proto__') {\n return\n }\n\n const type = Object.prototype.toString.call(recipient[key1]);\n const isobject = (\n type === '[object Object]' ||\n type === '[object Array]'\n );\n\n // do not write over falsey, non-undefined values if overwrite is false\n if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') {\n return\n }\n\n if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) {\n recipient[key1] = (\n typeof key2 === 'number' &&\n !opts.object\n ? []\n : {}\n );\n }\n\n recipient = recipient[key1];\n if (split.length > 0) {\n key1 = getkey(split.shift());\n key2 = getkey(split[0]);\n }\n }\n\n // unflatten again for 'messy objects'\n recipient[key1] = unflatten(target[key], opts);\n });\n\n return result\n}\n\nconst RE_KEY_VAL = /^\\s*([^\\s=]+)\\s*=\\s*(.*)?\\s*$/;\nconst RE_LINES = /\\n|\\r|\\r\\n/;\nconst defaults = {\n name: \".conf\",\n dir: process.cwd(),\n flat: false\n};\nfunction withDefaults(options) {\n if (typeof options === \"string\") {\n options = { name: options };\n }\n return { ...defaults, ...options };\n}\nfunction parse(contents, options = {}) {\n const config = {};\n const lines = contents.split(RE_LINES);\n for (const line of lines) {\n const match = line.match(RE_KEY_VAL);\n if (!match) {\n continue;\n }\n const key = match[1];\n if (!key || key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = destr(\n (match[2] || \"\").trim()\n /* val */\n );\n if (key.endsWith(\"[]\")) {\n const nkey = key.slice(0, Math.max(0, key.length - 2));\n config[nkey] = (config[nkey] || []).concat(value);\n continue;\n }\n config[key] = value;\n }\n return options.flat ? config : unflatten(config, { overwrite: true });\n}\nfunction parseFile(path, options) {\n if (!existsSync(path)) {\n return {};\n }\n return parse(readFileSync(path, \"utf8\"), options);\n}\nfunction read(options) {\n options = withDefaults(options);\n return parseFile(resolve(options.dir, options.name), options);\n}\nfunction readUser(options) {\n options = withDefaults(options);\n options.dir = process.env.XDG_CONFIG_HOME || homedir();\n return read(options);\n}\nfunction serialize(config) {\n return Object.entries(flatten(config)).map(([key, value]) => `${key}=${JSON.stringify(value)}`).join(\"\\n\");\n}\nfunction write(config, options) {\n options = withDefaults(options);\n writeFileSync(resolve(options.dir, options.name), serialize(config), {\n encoding: \"utf8\"\n });\n}\nfunction writeUser(config, options) {\n options = withDefaults(options);\n options.dir = process.env.XDG_CONFIG_HOME || homedir();\n write(config, options);\n}\nfunction update(config, options) {\n options = withDefaults(options);\n if (!options.flat) {\n config = unflatten(config, { overwrite: true });\n }\n const newConfig = defu(config, read(options));\n write(newConfig, options);\n return newConfig;\n}\nfunction updateUser(config, options) {\n options = withDefaults(options);\n options.dir = process.env.XDG_CONFIG_HOME || homedir();\n return update(config, options);\n}\n\nexport { defaults, parse, parseFile, read, readUser, serialize, update, updateUser, write, writeUser };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAMA,SAAS,SAAU,KAAK;AACtB,QAAO,OACL,IAAI,eACH,OAAO,IAAI,YAAY,aAAa,cACrC,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WAAU,aAAa,QAAQ;AAC/B,SAAQ,MAAM,QAAQ,IAAI,mBAAmB,SAAS;AACtD,QAAO,KAAK,QAAQ"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs"],"sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { homedir } from 'node:os';\nimport destr from 'destr';\nimport { defu } from 'defu';\n\nfunction isBuffer (obj) {\n return obj &&\n obj.constructor &&\n (typeof obj.constructor.isBuffer === 'function') &&\n obj.constructor.isBuffer(obj)\n}\n\nfunction keyIdentity (key) {\n return key\n}\n\nfunction flatten (target, opts) {\n opts = opts || {};\n\n const delimiter = opts.delimiter || '.';\n const maxDepth = opts.maxDepth;\n const transformKey = opts.transformKey || keyIdentity;\n const output = {};\n\n function step (object, prev, currentDepth) {\n currentDepth = currentDepth || 1;\n Object.keys(object).forEach(function (key) {\n const value = object[key];\n const isarray = opts.safe && Array.isArray(value);\n const type = Object.prototype.toString.call(value);\n const isbuffer = isBuffer(value);\n const isobject = (\n type === '[object Object]' ||\n type === '[object Array]'\n );\n\n const newKey = prev\n ? prev + delimiter + transformKey(key)\n : transformKey(key);\n\n if (!isarray && !isbuffer && isobject && Object.keys(value).length &&\n (!opts.maxDepth || currentDepth < maxDepth)) {\n return step(value, newKey, currentDepth + 1)\n }\n\n output[newKey] = value;\n });\n }\n\n step(target);\n\n return output\n}\n\nfunction unflatten (target, opts) {\n opts = opts || {};\n\n const delimiter = opts.delimiter || '.';\n const overwrite = opts.overwrite || false;\n const transformKey = opts.transformKey || keyIdentity;\n const result = {};\n\n const isbuffer = isBuffer(target);\n if (isbuffer || Object.prototype.toString.call(target) !== '[object Object]') {\n return target\n }\n\n // safely ensure that the key is\n // an integer.\n function getkey (key) {\n const parsedKey = Number(key);\n\n return (\n isNaN(parsedKey) ||\n key.indexOf('.') !== -1 ||\n opts.object\n )\n ? key\n : parsedKey\n }\n\n function addKeys (keyPrefix, recipient, target) {\n return Object.keys(target).reduce(function (result, key) {\n result[keyPrefix + delimiter + key] = target[key];\n\n return result\n }, recipient)\n }\n\n function isEmpty (val) {\n const type = Object.prototype.toString.call(val);\n const isArray = type === '[object Array]';\n const isObject = type === '[object Object]';\n\n if (!val) {\n return true\n } else if (isArray) {\n return !val.length\n } else if (isObject) {\n return !Object.keys(val).length\n }\n }\n\n target = Object.keys(target).reduce(function (result, key) {\n const type = Object.prototype.toString.call(target[key]);\n const isObject = (type === '[object Object]' || type === '[object Array]');\n if (!isObject || isEmpty(target[key])) {\n result[key] = target[key];\n return result\n } else {\n return addKeys(\n key,\n result,\n flatten(target[key], opts)\n )\n }\n }, {});\n\n Object.keys(target).forEach(function (key) {\n const split = key.split(delimiter).map(transformKey);\n let key1 = getkey(split.shift());\n let key2 = getkey(split[0]);\n let recipient = result;\n\n while (key2 !== undefined) {\n if (key1 === '__proto__') {\n return\n }\n\n const type = Object.prototype.toString.call(recipient[key1]);\n const isobject = (\n type === '[object Object]' ||\n type === '[object Array]'\n );\n\n // do not write over falsey, non-undefined values if overwrite is false\n if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') {\n return\n }\n\n if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) {\n recipient[key1] = (\n typeof key2 === 'number' &&\n !opts.object\n ? []\n : {}\n );\n }\n\n recipient = recipient[key1];\n if (split.length > 0) {\n key1 = getkey(split.shift());\n key2 = getkey(split[0]);\n }\n }\n\n // unflatten again for 'messy objects'\n recipient[key1] = unflatten(target[key], opts);\n });\n\n return result\n}\n\nconst RE_KEY_VAL = /^\\s*([^\\s=]+)\\s*=\\s*(.*)?\\s*$/;\nconst RE_LINES = /\\n|\\r|\\r\\n/;\nconst defaults = {\n name: \".conf\",\n dir: process.cwd(),\n flat: false\n};\nfunction withDefaults(options) {\n if (typeof options === \"string\") {\n options = { name: options };\n }\n return { ...defaults, ...options };\n}\nfunction parse(contents, options = {}) {\n const config = {};\n const lines = contents.split(RE_LINES);\n for (const line of lines) {\n const match = line.match(RE_KEY_VAL);\n if (!match) {\n continue;\n }\n const key = match[1];\n if (!key || key === \"__proto__\" || key === \"constructor\") {\n continue;\n }\n const value = destr(\n (match[2] || \"\").trim()\n /* val */\n );\n if (key.endsWith(\"[]\")) {\n const nkey = key.slice(0, Math.max(0, key.length - 2));\n config[nkey] = (config[nkey] || []).concat(value);\n continue;\n }\n config[key] = value;\n }\n return options.flat ? config : unflatten(config, { overwrite: true });\n}\nfunction parseFile(path, options) {\n if (!existsSync(path)) {\n return {};\n }\n return parse(readFileSync(path, \"utf8\"), options);\n}\nfunction read(options) {\n options = withDefaults(options);\n return parseFile(resolve(options.dir, options.name), options);\n}\nfunction readUser(options) {\n options = withDefaults(options);\n options.dir = process.env.XDG_CONFIG_HOME || homedir();\n return read(options);\n}\nfunction serialize(config) {\n return Object.entries(flatten(config)).map(([key, value]) => `${key}=${JSON.stringify(value)}`).join(\"\\n\");\n}\nfunction write(config, options) {\n options = withDefaults(options);\n writeFileSync(resolve(options.dir, options.name), serialize(config), {\n encoding: \"utf8\"\n });\n}\nfunction writeUser(config, options) {\n options = withDefaults(options);\n options.dir = process.env.XDG_CONFIG_HOME || homedir();\n write(config, options);\n}\nfunction update(config, options) {\n options = withDefaults(options);\n if (!options.flat) {\n config = unflatten(config, { overwrite: true });\n }\n const newConfig = defu(config, read(options));\n write(newConfig, options);\n return newConfig;\n}\nfunction updateUser(config, options) {\n options = withDefaults(options);\n options.dir = process.env.XDG_CONFIG_HOME || homedir();\n return update(config, options);\n}\n\nexport { defaults, parse, parseFile, read, readUser, serialize, update, updateUser, write, writeUser };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAMA,SAAS,SAAU,KAAK;AACtB,QAAO,OACL,IAAI,eACH,OAAO,IAAI,YAAY,aAAa,cACrC,IAAI,YAAY,SAAS,IAAI;;AAGjC,SAAS,YAAa,KAAK;AACzB,QAAO;;AAGT,SAAS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