@emulsify/cli 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -12
- package/dist/handlers/componentInstall.js +65 -4
- package/dist/index.js +2 -0
- package/dist/node_modules/.package-lock.json +6 -216
- package/dist/node_modules/@types/node/README.md +1 -1
- package/dist/node_modules/@types/node/http2.d.ts +1 -0
- package/dist/node_modules/@types/node/package.json +2 -2
- package/dist/package-lock.json +61 -42
- package/dist/package.json +5 -6
- package/dist/schemas/emulsifyProjectConfig.json +80 -0
- package/dist/util/fs/executeScript.js +10 -4
- package/dist/util/fs/loadJsonFile.js +14 -4
- package/dist/util/fs/safeResolveWithin.js +22 -0
- package/dist/util/getRepositoryLatestTag.js +96 -13
- package/dist/util/project/buildComponentDependencyList.js +35 -10
- package/dist/util/project/generateComponent.js +52 -23
- package/dist/util/project/getEmulsifyConfig.js +35 -1
- package/dist/util/project/installComponentFromCache.js +3 -2
- package/dist/util/project/installGeneralAssetsFromCache.js +4 -2
- package/dist/util/system/getAvailableSystems.js +0 -5
- package/package.json +5 -6
- package/dist/node_modules/@babel/code-frame/LICENSE +0 -22
- package/dist/node_modules/@babel/code-frame/README.md +0 -19
- package/dist/node_modules/@babel/code-frame/lib/index.js +0 -217
- package/dist/node_modules/@babel/code-frame/lib/index.js.map +0 -1
- package/dist/node_modules/@babel/code-frame/package.json +0 -32
- package/dist/node_modules/@babel/helper-validator-identifier/LICENSE +0 -22
- package/dist/node_modules/@babel/helper-validator-identifier/README.md +0 -19
- package/dist/node_modules/@babel/helper-validator-identifier/lib/identifier.js +0 -70
- package/dist/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +0 -1
- package/dist/node_modules/@babel/helper-validator-identifier/lib/index.js +0 -57
- package/dist/node_modules/@babel/helper-validator-identifier/lib/index.js.map +0 -1
- package/dist/node_modules/@babel/helper-validator-identifier/lib/keyword.js +0 -35
- package/dist/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +0 -1
- package/dist/node_modules/@babel/helper-validator-identifier/package.json +0 -31
- package/dist/node_modules/@types/progress/LICENSE +0 -21
- package/dist/node_modules/@types/progress/README.md +0 -15
- package/dist/node_modules/@types/progress/index.d.ts +0 -143
- package/dist/node_modules/@types/progress/package.json +0 -27
- package/dist/node_modules/argparse/CHANGELOG.md +0 -216
- package/dist/node_modules/argparse/LICENSE +0 -254
- package/dist/node_modules/argparse/README.md +0 -84
- package/dist/node_modules/argparse/argparse.js +0 -3707
- package/dist/node_modules/argparse/lib/sub.js +0 -67
- package/dist/node_modules/argparse/lib/textwrap.js +0 -440
- package/dist/node_modules/argparse/package.json +0 -31
- package/dist/node_modules/callsites/index.d.ts +0 -96
- package/dist/node_modules/callsites/index.js +0 -13
- package/dist/node_modules/callsites/license +0 -9
- package/dist/node_modules/callsites/package.json +0 -39
- package/dist/node_modules/callsites/readme.md +0 -48
- package/dist/node_modules/cosmiconfig/LICENSE +0 -22
- package/dist/node_modules/cosmiconfig/README.md +0 -782
- package/dist/node_modules/cosmiconfig/dist/Explorer.d.ts +0 -2
- package/dist/node_modules/cosmiconfig/dist/Explorer.js +0 -174
- package/dist/node_modules/cosmiconfig/dist/ExplorerBase.d.ts +0 -2
- package/dist/node_modules/cosmiconfig/dist/ExplorerBase.js +0 -126
- package/dist/node_modules/cosmiconfig/dist/ExplorerSync.d.ts +0 -2
- package/dist/node_modules/cosmiconfig/dist/ExplorerSync.js +0 -188
- package/dist/node_modules/cosmiconfig/dist/defaults.d.ts +0 -25
- package/dist/node_modules/cosmiconfig/dist/defaults.js +0 -105
- package/dist/node_modules/cosmiconfig/dist/index.d.ts +0 -6
- package/dist/node_modules/cosmiconfig/dist/index.js +0 -148
- package/dist/node_modules/cosmiconfig/dist/loaders.d.ts +0 -8
- package/dist/node_modules/cosmiconfig/dist/loaders.js +0 -150
- package/dist/node_modules/cosmiconfig/dist/merge.d.ts +0 -9
- package/dist/node_modules/cosmiconfig/dist/merge.js +0 -44
- package/dist/node_modules/cosmiconfig/dist/types.d.ts +0 -98
- package/dist/node_modules/cosmiconfig/dist/types.js +0 -3
- package/dist/node_modules/cosmiconfig/dist/util.d.ts +0 -2
- package/dist/node_modules/cosmiconfig/dist/util.js +0 -108
- package/dist/node_modules/cosmiconfig/package.json +0 -103
- package/dist/node_modules/env-paths/index.d.ts +0 -101
- package/dist/node_modules/env-paths/index.js +0 -74
- package/dist/node_modules/env-paths/license +0 -9
- package/dist/node_modules/env-paths/package.json +0 -45
- package/dist/node_modules/env-paths/readme.md +0 -115
- package/dist/node_modules/error-ex/LICENSE +0 -21
- package/dist/node_modules/error-ex/README.md +0 -144
- package/dist/node_modules/error-ex/index.js +0 -141
- package/dist/node_modules/error-ex/package.json +0 -46
- package/dist/node_modules/import-fresh/index.d.ts +0 -30
- package/dist/node_modules/import-fresh/index.js +0 -34
- package/dist/node_modules/import-fresh/license +0 -9
- package/dist/node_modules/import-fresh/node_modules/resolve-from/index.js +0 -47
- package/dist/node_modules/import-fresh/node_modules/resolve-from/license +0 -9
- package/dist/node_modules/import-fresh/node_modules/resolve-from/package.json +0 -34
- package/dist/node_modules/import-fresh/node_modules/resolve-from/readme.md +0 -72
- package/dist/node_modules/import-fresh/package.json +0 -48
- package/dist/node_modules/import-fresh/readme.md +0 -54
- package/dist/node_modules/is-arrayish/.editorconfig +0 -18
- package/dist/node_modules/is-arrayish/.istanbul.yml +0 -4
- package/dist/node_modules/is-arrayish/.travis.yml +0 -17
- package/dist/node_modules/is-arrayish/LICENSE +0 -21
- package/dist/node_modules/is-arrayish/README.md +0 -16
- package/dist/node_modules/is-arrayish/index.js +0 -10
- package/dist/node_modules/is-arrayish/package.json +0 -34
- package/dist/node_modules/js-tokens/CHANGELOG.md +0 -151
- package/dist/node_modules/js-tokens/LICENSE +0 -21
- package/dist/node_modules/js-tokens/README.md +0 -240
- package/dist/node_modules/js-tokens/index.js +0 -23
- package/dist/node_modules/js-tokens/package.json +0 -30
- package/dist/node_modules/js-yaml/LICENSE +0 -21
- package/dist/node_modules/js-yaml/README.md +0 -231
- package/dist/node_modules/js-yaml/bin/js-yaml.js +0 -117
- package/dist/node_modules/js-yaml/dist/js-yaml.js +0 -2404
- package/dist/node_modules/js-yaml/dist/js-yaml.js.map +0 -1
- package/dist/node_modules/js-yaml/dist/js-yaml.min.js +0 -33
- package/dist/node_modules/js-yaml/dist/js-yaml.min.js.map +0 -1
- package/dist/node_modules/js-yaml/dist/js-yaml.mjs +0 -2382
- package/dist/node_modules/js-yaml/dist/js-yaml.mjs.map +0 -1
- package/dist/node_modules/js-yaml/index.js +0 -44
- package/dist/node_modules/js-yaml/lib/common.js +0 -50
- package/dist/node_modules/js-yaml/lib/dumper.js +0 -937
- package/dist/node_modules/js-yaml/lib/exception.js +0 -51
- package/dist/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs +0 -37
- package/dist/node_modules/js-yaml/lib/loader.js +0 -1794
- package/dist/node_modules/js-yaml/lib/schema/core.js +0 -9
- package/dist/node_modules/js-yaml/lib/schema/default.js +0 -20
- package/dist/node_modules/js-yaml/lib/schema/failsafe.js +0 -14
- package/dist/node_modules/js-yaml/lib/schema/json.js +0 -17
- package/dist/node_modules/js-yaml/lib/schema.js +0 -109
- package/dist/node_modules/js-yaml/lib/snippet.js +0 -96
- package/dist/node_modules/js-yaml/lib/type/binary.js +0 -122
- package/dist/node_modules/js-yaml/lib/type/bool.js +0 -35
- package/dist/node_modules/js-yaml/lib/type/float.js +0 -99
- package/dist/node_modules/js-yaml/lib/type/int.js +0 -142
- package/dist/node_modules/js-yaml/lib/type/map.js +0 -8
- package/dist/node_modules/js-yaml/lib/type/merge.js +0 -12
- package/dist/node_modules/js-yaml/lib/type/null.js +0 -35
- package/dist/node_modules/js-yaml/lib/type/omap.js +0 -45
- package/dist/node_modules/js-yaml/lib/type/pairs.js +0 -50
- package/dist/node_modules/js-yaml/lib/type/seq.js +0 -8
- package/dist/node_modules/js-yaml/lib/type/set.js +0 -29
- package/dist/node_modules/js-yaml/lib/type/str.js +0 -8
- package/dist/node_modules/js-yaml/lib/type/timestamp.js +0 -88
- package/dist/node_modules/js-yaml/lib/type.js +0 -66
- package/dist/node_modules/js-yaml/package.json +0 -77
- package/dist/node_modules/json-parse-even-better-errors/CHANGELOG.md +0 -50
- package/dist/node_modules/json-parse-even-better-errors/LICENSE.md +0 -25
- package/dist/node_modules/json-parse-even-better-errors/README.md +0 -96
- package/dist/node_modules/json-parse-even-better-errors/index.js +0 -121
- package/dist/node_modules/json-parse-even-better-errors/package.json +0 -33
- package/dist/node_modules/lines-and-columns/LICENSE +0 -21
- package/dist/node_modules/lines-and-columns/README.md +0 -33
- package/dist/node_modules/lines-and-columns/build/index.d.ts +0 -13
- package/dist/node_modules/lines-and-columns/build/index.js +0 -62
- package/dist/node_modules/lines-and-columns/package.json +0 -49
- package/dist/node_modules/parent-module/index.js +0 -37
- package/dist/node_modules/parent-module/license +0 -9
- package/dist/node_modules/parent-module/package.json +0 -46
- package/dist/node_modules/parent-module/readme.md +0 -67
- package/dist/node_modules/parse-json/index.js +0 -54
- package/dist/node_modules/parse-json/license +0 -9
- package/dist/node_modules/parse-json/package.json +0 -45
- package/dist/node_modules/parse-json/readme.md +0 -119
- package/dist/node_modules/picocolors/LICENSE +0 -15
- package/dist/node_modules/picocolors/README.md +0 -21
- package/dist/node_modules/picocolors/package.json +0 -25
- package/dist/node_modules/picocolors/picocolors.browser.js +0 -4
- package/dist/node_modules/picocolors/picocolors.d.ts +0 -5
- package/dist/node_modules/picocolors/picocolors.js +0 -75
- package/dist/node_modules/picocolors/types.d.ts +0 -51
- package/dist/node_modules/typescript/LICENSE.txt +0 -55
- package/dist/node_modules/typescript/README.md +0 -50
- package/dist/node_modules/typescript/SECURITY.md +0 -39
- package/dist/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
- package/dist/node_modules/typescript/bin/tsc +0 -2
- package/dist/node_modules/typescript/bin/tsserver +0 -2
- package/dist/node_modules/typescript/lib/_tsc.js +0 -134465
- package/dist/node_modules/typescript/lib/_tsserver.js +0 -659
- package/dist/node_modules/typescript/lib/_typingsInstaller.js +0 -222
- package/dist/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2125
- package/dist/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2125
- package/dist/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/lib.d.ts +0 -20
- package/dist/node_modules/typescript/lib/lib.decorators.d.ts +0 -382
- package/dist/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -20
- package/dist/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -18
- package/dist/node_modules/typescript/lib/lib.dom.d.ts +0 -45125
- package/dist/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -18
- package/dist/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -150
- package/dist/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -595
- package/dist/node_modules/typescript/lib/lib.es2015.d.ts +0 -26
- package/dist/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -75
- package/dist/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -603
- package/dist/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -79
- package/dist/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -126
- package/dist/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -142
- package/dist/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -44
- package/dist/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -324
- package/dist/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -114
- package/dist/node_modules/typescript/lib/lib.es2016.d.ts +0 -19
- package/dist/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -29
- package/dist/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -19
- package/dist/node_modules/typescript/lib/lib.es2017.d.ts +0 -24
- package/dist/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -29
- package/dist/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -42
- package/dist/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -47
- package/dist/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -133
- package/dist/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -43
- package/dist/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -51
- package/dist/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -75
- package/dist/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -51
- package/dist/node_modules/typescript/lib/lib.es2018.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -81
- package/dist/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -28
- package/dist/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -35
- package/dist/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -77
- package/dist/node_modules/typescript/lib/lib.es2019.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -31
- package/dist/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -35
- package/dist/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -763
- package/dist/node_modules/typescript/lib/lib.es2020.d.ts +0 -25
- package/dist/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -40
- package/dist/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -472
- package/dist/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -26
- package/dist/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -45
- package/dist/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -97
- package/dist/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -42
- package/dist/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -39
- package/dist/node_modules/typescript/lib/lib.es2021.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -164
- package/dist/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -46
- package/dist/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -31
- package/dist/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -76
- package/dist/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -119
- package/dist/node_modules/typescript/lib/lib.es2022.d.ts +0 -23
- package/dist/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -73
- package/dist/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -143
- package/dist/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -24
- package/dist/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -37
- package/dist/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -23
- package/dist/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -922
- package/dist/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -19
- package/dist/node_modules/typescript/lib/lib.es2023.d.ts +0 -20
- package/dist/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -62
- package/dist/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -63
- package/dist/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -27
- package/dist/node_modules/typescript/lib/lib.es2024.d.ts +0 -24
- package/dist/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -27
- package/dist/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -33
- package/dist/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -23
- package/dist/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -66
- package/dist/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -27
- package/dist/node_modules/typescript/lib/lib.es2025.collection.d.ts +0 -94
- package/dist/node_modules/typescript/lib/lib.es2025.d.ts +0 -23
- package/dist/node_modules/typescript/lib/lib.es2025.float16.d.ts +0 -443
- package/dist/node_modules/typescript/lib/lib.es2025.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.es2025.intl.d.ts +0 -200
- package/dist/node_modules/typescript/lib/lib.es2025.iterator.d.ts +0 -146
- package/dist/node_modules/typescript/lib/lib.es2025.promise.d.ts +0 -32
- package/dist/node_modules/typescript/lib/lib.es2025.regexp.d.ts +0 -30
- package/dist/node_modules/typescript/lib/lib.es5.d.ts +0 -4599
- package/dist/node_modules/typescript/lib/lib.es6.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -33
- package/dist/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -47
- package/dist/node_modules/typescript/lib/lib.esnext.d.ts +0 -27
- package/dist/node_modules/typescript/lib/lib.esnext.date.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -26
- package/dist/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -191
- package/dist/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -22
- package/dist/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -107
- package/dist/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -23
- package/dist/node_modules/typescript/lib/lib.esnext.temporal.d.ts +0 -485
- package/dist/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts +0 -90
- package/dist/node_modules/typescript/lib/lib.scripthost.d.ts +0 -320
- package/dist/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -18
- package/dist/node_modules/typescript/lib/lib.webworker.d.ts +0 -15606
- package/dist/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -21
- package/dist/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -18
- package/dist/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2125
- package/dist/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/tsc.js +0 -8
- package/dist/node_modules/typescript/lib/tsserver.js +0 -8
- package/dist/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
- package/dist/node_modules/typescript/lib/tsserverlibrary.js +0 -21
- package/dist/node_modules/typescript/lib/typesMap.json +0 -497
- package/dist/node_modules/typescript/lib/typescript.d.ts +0 -11448
- package/dist/node_modules/typescript/lib/typescript.js +0 -201039
- package/dist/node_modules/typescript/lib/typingsInstaller.js +0 -8
- package/dist/node_modules/typescript/lib/watchGuard.js +0 -53
- package/dist/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2129
- package/dist/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2125
- package/dist/node_modules/typescript/package.json +0 -118
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultLoadersSync = exports.defaultLoaders = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = void 0;
|
|
4
|
-
exports.cosmiconfig = cosmiconfig;
|
|
5
|
-
exports.cosmiconfigSync = cosmiconfigSync;
|
|
6
|
-
const defaults_1 = require("./defaults");
|
|
7
|
-
Object.defineProperty(exports, "defaultLoaders", { enumerable: true, get: function () { return defaults_1.defaultLoaders; } });
|
|
8
|
-
Object.defineProperty(exports, "defaultLoadersSync", { enumerable: true, get: function () { return defaults_1.defaultLoadersSync; } });
|
|
9
|
-
Object.defineProperty(exports, "getDefaultSearchPlaces", { enumerable: true, get: function () { return defaults_1.getDefaultSearchPlaces; } });
|
|
10
|
-
Object.defineProperty(exports, "getDefaultSearchPlacesSync", { enumerable: true, get: function () { return defaults_1.getDefaultSearchPlacesSync; } });
|
|
11
|
-
Object.defineProperty(exports, "globalConfigSearchPlaces", { enumerable: true, get: function () { return defaults_1.globalConfigSearchPlaces; } });
|
|
12
|
-
Object.defineProperty(exports, "globalConfigSearchPlacesSync", { enumerable: true, get: function () { return defaults_1.globalConfigSearchPlacesSync; } });
|
|
13
|
-
const Explorer_js_1 = require("./Explorer.js");
|
|
14
|
-
const ExplorerSync_js_1 = require("./ExplorerSync.js");
|
|
15
|
-
const util_1 = require("./util");
|
|
16
|
-
const identity = function identity(x) {
|
|
17
|
-
return x;
|
|
18
|
-
};
|
|
19
|
-
function getUserDefinedOptionsFromMetaConfig() {
|
|
20
|
-
const metaExplorer = new ExplorerSync_js_1.ExplorerSync({
|
|
21
|
-
moduleName: 'cosmiconfig',
|
|
22
|
-
stopDir: process.cwd(),
|
|
23
|
-
searchPlaces: defaults_1.metaSearchPlaces,
|
|
24
|
-
ignoreEmptySearchPlaces: false,
|
|
25
|
-
applyPackagePropertyPathToConfiguration: true,
|
|
26
|
-
loaders: defaults_1.defaultLoaders,
|
|
27
|
-
transform: identity,
|
|
28
|
-
cache: true,
|
|
29
|
-
metaConfigFilePath: null,
|
|
30
|
-
mergeImportArrays: true,
|
|
31
|
-
mergeSearchPlaces: true,
|
|
32
|
-
searchStrategy: 'none',
|
|
33
|
-
});
|
|
34
|
-
const metaConfig = metaExplorer.search();
|
|
35
|
-
if (!metaConfig) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
if (metaConfig.config?.loaders) {
|
|
39
|
-
throw new Error('Can not specify loaders in meta config file');
|
|
40
|
-
}
|
|
41
|
-
if (metaConfig.config?.searchStrategy) {
|
|
42
|
-
throw new Error('Can not specify searchStrategy in meta config file');
|
|
43
|
-
}
|
|
44
|
-
const overrideOptions = {
|
|
45
|
-
mergeSearchPlaces: true,
|
|
46
|
-
...(metaConfig.config ?? {}),
|
|
47
|
-
};
|
|
48
|
-
return {
|
|
49
|
-
config: (0, util_1.removeUndefinedValuesFromObject)(overrideOptions),
|
|
50
|
-
filepath: metaConfig.filepath,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
54
|
-
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path) => path.replace('{name}', moduleName));
|
|
55
|
-
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
56
|
-
return [...(userConfiguredSearchPlaces ?? []), ...toolDefinedSearchPlaces];
|
|
57
|
-
}
|
|
58
|
-
return (userConfiguredSearchPlaces ??
|
|
59
|
-
/* istanbul ignore next */ toolDefinedSearchPlaces);
|
|
60
|
-
}
|
|
61
|
-
function mergeOptionsBase(moduleName, defaults, options) {
|
|
62
|
-
const userDefinedConfig = getUserDefinedOptionsFromMetaConfig();
|
|
63
|
-
if (!userDefinedConfig) {
|
|
64
|
-
return {
|
|
65
|
-
...defaults,
|
|
66
|
-
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
67
|
-
loaders: {
|
|
68
|
-
...defaults.loaders,
|
|
69
|
-
...options.loaders,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
const userConfiguredOptions = userDefinedConfig.config;
|
|
74
|
-
const toolDefinedSearchPlaces = options.searchPlaces ?? defaults.searchPlaces;
|
|
75
|
-
return {
|
|
76
|
-
...defaults,
|
|
77
|
-
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
78
|
-
metaConfigFilePath: userDefinedConfig.filepath,
|
|
79
|
-
...userConfiguredOptions,
|
|
80
|
-
searchPlaces: getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions),
|
|
81
|
-
loaders: {
|
|
82
|
-
...defaults.loaders,
|
|
83
|
-
...options.loaders,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function validateOptions(options) {
|
|
88
|
-
if (options.searchStrategy != null &&
|
|
89
|
-
options.searchStrategy !== 'global' &&
|
|
90
|
-
options.stopDir) {
|
|
91
|
-
throw new Error('Can not supply `stopDir` option with `searchStrategy` other than "global"');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function mergeOptions(moduleName, options) {
|
|
95
|
-
validateOptions(options);
|
|
96
|
-
const defaults = {
|
|
97
|
-
moduleName,
|
|
98
|
-
searchPlaces: (0, defaults_1.getDefaultSearchPlaces)(moduleName),
|
|
99
|
-
ignoreEmptySearchPlaces: true,
|
|
100
|
-
cache: true,
|
|
101
|
-
transform: identity,
|
|
102
|
-
loaders: defaults_1.defaultLoaders,
|
|
103
|
-
metaConfigFilePath: null,
|
|
104
|
-
mergeImportArrays: true,
|
|
105
|
-
mergeSearchPlaces: true,
|
|
106
|
-
searchStrategy: options.stopDir ? 'global' : 'none',
|
|
107
|
-
};
|
|
108
|
-
return mergeOptionsBase(moduleName, defaults, options);
|
|
109
|
-
}
|
|
110
|
-
function mergeOptionsSync(moduleName, options) {
|
|
111
|
-
validateOptions(options);
|
|
112
|
-
const defaults = {
|
|
113
|
-
moduleName,
|
|
114
|
-
searchPlaces: (0, defaults_1.getDefaultSearchPlacesSync)(moduleName),
|
|
115
|
-
ignoreEmptySearchPlaces: true,
|
|
116
|
-
cache: true,
|
|
117
|
-
transform: identity,
|
|
118
|
-
loaders: defaults_1.defaultLoadersSync,
|
|
119
|
-
metaConfigFilePath: null,
|
|
120
|
-
mergeImportArrays: true,
|
|
121
|
-
mergeSearchPlaces: true,
|
|
122
|
-
searchStrategy: options.stopDir ? 'global' : 'none',
|
|
123
|
-
};
|
|
124
|
-
return mergeOptionsBase(moduleName, defaults, options);
|
|
125
|
-
}
|
|
126
|
-
function cosmiconfig(moduleName, options = {}) {
|
|
127
|
-
const normalizedOptions = mergeOptions(moduleName, options);
|
|
128
|
-
const explorer = new Explorer_js_1.Explorer(normalizedOptions);
|
|
129
|
-
return {
|
|
130
|
-
search: explorer.search.bind(explorer),
|
|
131
|
-
load: explorer.load.bind(explorer),
|
|
132
|
-
clearLoadCache: explorer.clearLoadCache.bind(explorer),
|
|
133
|
-
clearSearchCache: explorer.clearSearchCache.bind(explorer),
|
|
134
|
-
clearCaches: explorer.clearCaches.bind(explorer),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function cosmiconfigSync(moduleName, options = {}) {
|
|
138
|
-
const normalizedOptions = mergeOptionsSync(moduleName, options);
|
|
139
|
-
const explorerSync = new ExplorerSync_js_1.ExplorerSync(normalizedOptions);
|
|
140
|
-
return {
|
|
141
|
-
search: explorerSync.search.bind(explorerSync),
|
|
142
|
-
load: explorerSync.load.bind(explorerSync),
|
|
143
|
-
clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync),
|
|
144
|
-
clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync),
|
|
145
|
-
clearCaches: explorerSync.clearCaches.bind(explorerSync),
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Loader, LoaderSync } from './types.js';
|
|
2
|
-
export declare const loadJsSync: LoaderSync;
|
|
3
|
-
export declare const loadJs: Loader;
|
|
4
|
-
export declare const loadJson: LoaderSync;
|
|
5
|
-
export declare const loadYaml: LoaderSync;
|
|
6
|
-
export declare const loadTsSync: LoaderSync;
|
|
7
|
-
export declare const loadTs: Loader;
|
|
8
|
-
//# sourceMappingURL=loaders.d.ts.map
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.loadTs = exports.loadTsSync = exports.loadYaml = exports.loadJson = exports.loadJs = exports.loadJsSync = void 0;
|
|
8
|
-
const fs_1 = require("fs");
|
|
9
|
-
const promises_1 = require("fs/promises");
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const url_1 = require("url");
|
|
12
|
-
const crypto_1 = require("crypto");
|
|
13
|
-
let importFresh;
|
|
14
|
-
const loadJsSync = function loadJsSync(filepath) {
|
|
15
|
-
if (importFresh === undefined) {
|
|
16
|
-
importFresh = require('import-fresh');
|
|
17
|
-
}
|
|
18
|
-
return importFresh(filepath);
|
|
19
|
-
};
|
|
20
|
-
exports.loadJsSync = loadJsSync;
|
|
21
|
-
const loadJs = async function loadJs(filepath) {
|
|
22
|
-
try {
|
|
23
|
-
const { href } = (0, url_1.pathToFileURL)(await (0, promises_1.realpath)(filepath));
|
|
24
|
-
return (await import(href)).default;
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
try {
|
|
28
|
-
return (0, exports.loadJsSync)(filepath, '');
|
|
29
|
-
}
|
|
30
|
-
catch (requireError) {
|
|
31
|
-
/* istanbul ignore next -- @preserve */
|
|
32
|
-
if (requireError.code === 'ERR_REQUIRE_ESM' ||
|
|
33
|
-
(requireError instanceof SyntaxError &&
|
|
34
|
-
requireError
|
|
35
|
-
.toString()
|
|
36
|
-
.includes('Cannot use import statement outside a module'))) {
|
|
37
|
-
throw error;
|
|
38
|
-
}
|
|
39
|
-
throw requireError;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.loadJs = loadJs;
|
|
44
|
-
let parseJson;
|
|
45
|
-
const loadJson = function loadJson(filepath, content) {
|
|
46
|
-
if (parseJson === undefined) {
|
|
47
|
-
parseJson = require('parse-json');
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
return parseJson(content);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
error.message = `JSON Error in ${filepath}:\n${error.message}`;
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
exports.loadJson = loadJson;
|
|
58
|
-
let yaml;
|
|
59
|
-
const loadYaml = function loadYaml(filepath, content) {
|
|
60
|
-
if (yaml === undefined) {
|
|
61
|
-
yaml = require('js-yaml');
|
|
62
|
-
}
|
|
63
|
-
try {
|
|
64
|
-
return yaml.load(content);
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
error.message = `YAML Error in ${filepath}:\n${error.message}`;
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
exports.loadYaml = loadYaml;
|
|
72
|
-
let typescript;
|
|
73
|
-
const loadTsSync = function loadTsSync(filepath, content) {
|
|
74
|
-
/* istanbul ignore next -- @preserve */
|
|
75
|
-
if (typescript === undefined) {
|
|
76
|
-
typescript = require('typescript');
|
|
77
|
-
}
|
|
78
|
-
const compiledFilepath = `${filepath}.${(0, crypto_1.randomUUID)()}.cjs`;
|
|
79
|
-
try {
|
|
80
|
-
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
|
|
81
|
-
config.compilerOptions = {
|
|
82
|
-
...config.compilerOptions,
|
|
83
|
-
module: typescript.ModuleKind.NodeNext,
|
|
84
|
-
moduleResolution: typescript.ModuleResolutionKind.NodeNext,
|
|
85
|
-
target: typescript.ScriptTarget.ES2022,
|
|
86
|
-
noEmit: false,
|
|
87
|
-
};
|
|
88
|
-
content = typescript.transpileModule(content, config).outputText;
|
|
89
|
-
(0, fs_1.writeFileSync)(compiledFilepath, content);
|
|
90
|
-
return (0, exports.loadJsSync)(compiledFilepath, content).default;
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
error.message = `TypeScript Error in ${filepath}:\n${error.message}`;
|
|
94
|
-
throw error;
|
|
95
|
-
}
|
|
96
|
-
finally {
|
|
97
|
-
if ((0, fs_1.existsSync)(compiledFilepath)) {
|
|
98
|
-
(0, fs_1.rmSync)(compiledFilepath);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
exports.loadTsSync = loadTsSync;
|
|
103
|
-
const loadTs = async function loadTs(filepath, content) {
|
|
104
|
-
if (typescript === undefined) {
|
|
105
|
-
typescript = (await import('typescript')).default;
|
|
106
|
-
}
|
|
107
|
-
const compiledFilepath = `${filepath}.${(0, crypto_1.randomUUID)()}.mjs`;
|
|
108
|
-
let transpiledContent;
|
|
109
|
-
try {
|
|
110
|
-
try {
|
|
111
|
-
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
|
|
112
|
-
config.compilerOptions = {
|
|
113
|
-
...config.compilerOptions,
|
|
114
|
-
module: typescript.ModuleKind.ES2022,
|
|
115
|
-
moduleResolution: typescript.ModuleResolutionKind.Bundler,
|
|
116
|
-
target: typescript.ScriptTarget.ES2022,
|
|
117
|
-
noEmit: false,
|
|
118
|
-
};
|
|
119
|
-
transpiledContent = typescript.transpileModule(content, config).outputText;
|
|
120
|
-
await (0, promises_1.writeFile)(compiledFilepath, transpiledContent);
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
error.message = `TypeScript Error in ${filepath}:\n${error.message}`;
|
|
124
|
-
throw error;
|
|
125
|
-
}
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/return-await
|
|
127
|
-
return await (0, exports.loadJs)(compiledFilepath, transpiledContent);
|
|
128
|
-
}
|
|
129
|
-
finally {
|
|
130
|
-
if ((0, fs_1.existsSync)(compiledFilepath)) {
|
|
131
|
-
await (0, promises_1.rm)(compiledFilepath);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
exports.loadTs = loadTs;
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
137
|
-
function resolveTsConfig(directory) {
|
|
138
|
-
const filePath = typescript.findConfigFile(directory, (fileName) => {
|
|
139
|
-
return typescript.sys.fileExists(fileName);
|
|
140
|
-
});
|
|
141
|
-
if (filePath !== undefined) {
|
|
142
|
-
const { config, error } = typescript.readConfigFile(filePath, (path) => typescript.sys.readFile(path));
|
|
143
|
-
if (error) {
|
|
144
|
-
throw new Error(`Error in ${filePath}: ${error.messageText.toString()}`);
|
|
145
|
-
}
|
|
146
|
-
return config;
|
|
147
|
-
}
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=loaders.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const hasOwn: (thisArg: any, ...argArray: any[]) => any;
|
|
2
|
-
export interface MergeOptions {
|
|
3
|
-
mergeArrays: boolean;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Merges multiple objects. Doesn't care about cloning non-primitives, as we load all these objects fresh from a file.
|
|
7
|
-
*/
|
|
8
|
-
export declare function mergeAll(objects: ReadonlyArray<any>, options: MergeOptions): any;
|
|
9
|
-
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hasOwn = void 0;
|
|
4
|
-
exports.mergeAll = mergeAll;
|
|
5
|
-
/* eslint-disable @typescript-eslint/unbound-method */
|
|
6
|
-
exports.hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
7
|
-
const objToString = Function.prototype.call.bind(Object.prototype.toString);
|
|
8
|
-
/* eslint-enable @typescript-eslint/unbound-method */
|
|
9
|
-
function isPlainObject(obj) {
|
|
10
|
-
return objToString(obj) === '[object Object]';
|
|
11
|
-
}
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
-
function merge(target, source, options) {
|
|
14
|
-
for (const key of Object.keys(source)) {
|
|
15
|
-
/* istanbul ignore next -- @preserve */
|
|
16
|
-
if (key === '__proto__' || key === 'constructor') {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const newValue = source[key];
|
|
20
|
-
if ((0, exports.hasOwn)(target, key)) {
|
|
21
|
-
if (Array.isArray(target[key]) && Array.isArray(newValue)) {
|
|
22
|
-
if (options.mergeArrays) {
|
|
23
|
-
target[key].push(...newValue);
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else if (isPlainObject(target[key]) && isPlainObject(newValue)) {
|
|
28
|
-
target[key] = merge(target[key], newValue, options);
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
target[key] = newValue;
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Merges multiple objects. Doesn't care about cloning non-primitives, as we load all these objects fresh from a file.
|
|
38
|
-
*/
|
|
39
|
-
function mergeAll(
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
-
objects, options) {
|
|
42
|
-
return objects.reduce((target, source) => merge(target, source, options), {});
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=merge.js.map
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export type Config = any;
|
|
5
|
-
/**
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export type CosmiconfigResult = {
|
|
9
|
-
config: Config;
|
|
10
|
-
filepath: string;
|
|
11
|
-
isEmpty?: boolean;
|
|
12
|
-
} | null;
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export type LoaderResult = Config | null;
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export type Loader = ((filepath: string, content: string) => Promise<LoaderResult>) | LoaderSync;
|
|
21
|
-
/**
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export type LoaderSync = (filepath: string, content: string) => LoaderResult;
|
|
25
|
-
/**
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export type Transform = ((CosmiconfigResult: CosmiconfigResult) => Promise<CosmiconfigResult>) | TransformSync;
|
|
29
|
-
/**
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
export type TransformSync = (CosmiconfigResult: CosmiconfigResult) => CosmiconfigResult;
|
|
33
|
-
/**
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
export type SearchStrategy = 'none' | 'project' | 'global';
|
|
37
|
-
/**
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
export interface CommonOptions {
|
|
41
|
-
packageProp?: string | Array<string>;
|
|
42
|
-
searchPlaces: Array<string>;
|
|
43
|
-
ignoreEmptySearchPlaces: boolean;
|
|
44
|
-
stopDir?: string;
|
|
45
|
-
cache: boolean;
|
|
46
|
-
mergeImportArrays: boolean;
|
|
47
|
-
mergeSearchPlaces: boolean;
|
|
48
|
-
searchStrategy: SearchStrategy;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export interface Options extends CommonOptions {
|
|
54
|
-
loaders: Loaders;
|
|
55
|
-
transform: Transform;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
export interface OptionsSync extends CommonOptions {
|
|
61
|
-
loaders: LoadersSync;
|
|
62
|
-
transform: TransformSync;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @public
|
|
66
|
-
*/
|
|
67
|
-
export interface Loaders {
|
|
68
|
-
[key: string]: Loader;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
|
-
export interface LoadersSync {
|
|
74
|
-
[key: string]: LoaderSync;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* @public
|
|
78
|
-
*/
|
|
79
|
-
export interface PublicExplorerBase {
|
|
80
|
-
clearLoadCache: () => void;
|
|
81
|
-
clearSearchCache: () => void;
|
|
82
|
-
clearCaches: () => void;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
export interface PublicExplorer extends PublicExplorerBase {
|
|
88
|
-
search: (searchFrom?: string) => Promise<CosmiconfigResult>;
|
|
89
|
-
load: (filepath: string) => Promise<CosmiconfigResult>;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export interface PublicExplorerSync extends PublicExplorerBase {
|
|
95
|
-
search: (searchFrom?: string) => CosmiconfigResult;
|
|
96
|
-
load: (filepath: string) => CosmiconfigResult;
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.emplace = emplace;
|
|
37
|
-
exports.getPropertyByPath = getPropertyByPath;
|
|
38
|
-
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
39
|
-
exports.isDirectory = isDirectory;
|
|
40
|
-
exports.isDirectorySync = isDirectorySync;
|
|
41
|
-
const fs_1 = __importStar(require("fs"));
|
|
42
|
-
/**
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
function emplace(map, key, fn) {
|
|
46
|
-
const cached = map.get(key);
|
|
47
|
-
if (cached !== undefined) {
|
|
48
|
-
return cached;
|
|
49
|
-
}
|
|
50
|
-
const result = fn();
|
|
51
|
-
map.set(key, result);
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
// Resolves property names or property paths defined with period-delimited
|
|
55
|
-
// strings or arrays of strings. Property names that are found on the source
|
|
56
|
-
// object are used directly (even if they include a period).
|
|
57
|
-
// Nested property names that include periods, within a path, are only
|
|
58
|
-
// understood in array paths.
|
|
59
|
-
/**
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
function getPropertyByPath(source, path) {
|
|
63
|
-
if (typeof path === 'string' &&
|
|
64
|
-
Object.prototype.hasOwnProperty.call(source, path)) {
|
|
65
|
-
return source[path];
|
|
66
|
-
}
|
|
67
|
-
const parsedPath = typeof path === 'string' ? path.split('.') : path;
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
|
-
return parsedPath.reduce((previous, key) => {
|
|
70
|
-
if (previous === undefined) {
|
|
71
|
-
return previous;
|
|
72
|
-
}
|
|
73
|
-
return previous[key];
|
|
74
|
-
}, source);
|
|
75
|
-
}
|
|
76
|
-
/** @internal */
|
|
77
|
-
function removeUndefinedValuesFromObject(options) {
|
|
78
|
-
return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined));
|
|
79
|
-
}
|
|
80
|
-
/** @internal */
|
|
81
|
-
/* istanbul ignore next -- @preserve */
|
|
82
|
-
async function isDirectory(path) {
|
|
83
|
-
try {
|
|
84
|
-
const stat = await fs_1.promises.stat(path);
|
|
85
|
-
return stat.isDirectory();
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
if (e.code === 'ENOENT') {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
throw e;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/** @internal */
|
|
95
|
-
/* istanbul ignore next -- @preserve */
|
|
96
|
-
function isDirectorySync(path) {
|
|
97
|
-
try {
|
|
98
|
-
const stat = fs_1.default.statSync(path);
|
|
99
|
-
return stat.isDirectory();
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
if (e.code === 'ENOENT') {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
throw e;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cosmiconfig",
|
|
3
|
-
"version": "9.0.2",
|
|
4
|
-
"description": "Find and load configuration from a package.json property, rc file, TypeScript module, and more!",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"!dist/**/*.map"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"clean": "git clean -Xdf -e '!node_modules' .",
|
|
13
|
-
"build": "npm run build:tsc",
|
|
14
|
-
"build:tsc": "cross-env NODE_ENV=production tsc -b",
|
|
15
|
-
"dev": "npm run build:tsc -- --watch",
|
|
16
|
-
"lint": "eslint --ext .js,.ts .",
|
|
17
|
-
"lint:fix": "eslint --ext .js,.ts . --fix",
|
|
18
|
-
"lint:md": "remark-preset-davidtheclark",
|
|
19
|
-
"format": "prettier \"**/*.{js,ts,json,yml,yaml}\" --write",
|
|
20
|
-
"format:md": "remark-preset-davidtheclark --format",
|
|
21
|
-
"format:check": "prettier \"**/*.{js,ts,json,yml,yaml}\" --check",
|
|
22
|
-
"test": "vitest run --coverage",
|
|
23
|
-
"test:watch": "vitest",
|
|
24
|
-
"check:all": "npm run test && npm run lint && npm run format:check",
|
|
25
|
-
"prepublishOnly": "npm run check:all && npm run build",
|
|
26
|
-
"prepare": "husky install"
|
|
27
|
-
},
|
|
28
|
-
"lint-staged": {
|
|
29
|
-
"*.{js,ts}": [
|
|
30
|
-
"eslint --fix",
|
|
31
|
-
"prettier --write"
|
|
32
|
-
],
|
|
33
|
-
"*.{json,yml,yaml}": [
|
|
34
|
-
"prettier --write"
|
|
35
|
-
],
|
|
36
|
-
"*.md": [
|
|
37
|
-
"remark-preset-davidtheclark",
|
|
38
|
-
"remark-preset-davidtheclark --format"
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"repository": {
|
|
42
|
-
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/cosmiconfig/cosmiconfig.git"
|
|
44
|
-
},
|
|
45
|
-
"keywords": [
|
|
46
|
-
"load",
|
|
47
|
-
"configuration",
|
|
48
|
-
"config"
|
|
49
|
-
],
|
|
50
|
-
"author": "Daniel Fischer <daniel@d-fischer.dev>",
|
|
51
|
-
"contributors": [
|
|
52
|
-
"Randolf J <jrandolf@google.com>",
|
|
53
|
-
"David Clark <david.dave.clark@gmail.com>",
|
|
54
|
-
"Bogdan Chadkin <trysound@yandex.ru>",
|
|
55
|
-
"Suhas Karanth <sudo.suhas@gmail.com>"
|
|
56
|
-
],
|
|
57
|
-
"funding": "https://github.com/sponsors/d-fischer",
|
|
58
|
-
"license": "MIT",
|
|
59
|
-
"bugs": {
|
|
60
|
-
"url": "https://github.com/cosmiconfig/cosmiconfig/issues"
|
|
61
|
-
},
|
|
62
|
-
"homepage": "https://github.com/cosmiconfig/cosmiconfig#readme",
|
|
63
|
-
"peerDependencies": {
|
|
64
|
-
"typescript": ">=4.9.5"
|
|
65
|
-
},
|
|
66
|
-
"peerDependenciesMeta": {
|
|
67
|
-
"typescript": {
|
|
68
|
-
"optional": true
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"dependencies": {
|
|
72
|
-
"env-paths": "^2.2.1",
|
|
73
|
-
"import-fresh": "^3.3.0",
|
|
74
|
-
"js-yaml": "^4.1.0",
|
|
75
|
-
"parse-json": "^5.2.0"
|
|
76
|
-
},
|
|
77
|
-
"devDependencies": {
|
|
78
|
-
"@types/js-yaml": "^4.0.5",
|
|
79
|
-
"@types/node": "^14",
|
|
80
|
-
"@types/parse-json": "^4.0.0",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
|
82
|
-
"@typescript-eslint/parser": "^6.5.0",
|
|
83
|
-
"@vitest/coverage-istanbul": "^0.34.3",
|
|
84
|
-
"cross-env": "^7.0.3",
|
|
85
|
-
"eslint": "^8.48.0",
|
|
86
|
-
"eslint-config-davidtheclark-node": "^0.2.2",
|
|
87
|
-
"eslint-config-prettier": "^9.0.0",
|
|
88
|
-
"eslint-import-resolver-typescript": "^3.6.0",
|
|
89
|
-
"eslint-plugin-import": "^2.28.1",
|
|
90
|
-
"eslint-plugin-node": "^11.1.0",
|
|
91
|
-
"eslint-plugin-vitest": "^0.2.8",
|
|
92
|
-
"husky": "^8.0.3",
|
|
93
|
-
"lint-staged": "^14.0.1",
|
|
94
|
-
"parent-module": "^3.0.0",
|
|
95
|
-
"prettier": "^3.0.3",
|
|
96
|
-
"remark-preset-davidtheclark": "^0.12.0",
|
|
97
|
-
"typescript": "^5.2.2",
|
|
98
|
-
"vitest": "^0.34.3"
|
|
99
|
-
},
|
|
100
|
-
"engines": {
|
|
101
|
-
"node": ">=14"
|
|
102
|
-
}
|
|
103
|
-
}
|