@emulsify/cli 2.0.0 → 2.1.0
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 +9 -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,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Explorer = void 0;
|
|
7
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const defaults_1 = require("./defaults");
|
|
10
|
-
const ExplorerBase_js_1 = require("./ExplorerBase.js");
|
|
11
|
-
const merge_1 = require("./merge");
|
|
12
|
-
const util_js_1 = require("./util.js");
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
class Explorer extends ExplorerBase_js_1.ExplorerBase {
|
|
17
|
-
async load(filepath) {
|
|
18
|
-
filepath = path_1.default.resolve(filepath);
|
|
19
|
-
const load = async () => {
|
|
20
|
-
return await this.config.transform(await this.#readConfiguration(filepath));
|
|
21
|
-
};
|
|
22
|
-
if (this.loadCache) {
|
|
23
|
-
return await (0, util_js_1.emplace)(this.loadCache, filepath, load);
|
|
24
|
-
}
|
|
25
|
-
return await load();
|
|
26
|
-
}
|
|
27
|
-
async search(from = '') {
|
|
28
|
-
if (this.config.metaConfigFilePath) {
|
|
29
|
-
this.loadingMetaConfig = true;
|
|
30
|
-
const config = await this.load(this.config.metaConfigFilePath);
|
|
31
|
-
this.loadingMetaConfig = false;
|
|
32
|
-
if (config && !config.isEmpty) {
|
|
33
|
-
return config;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
from = path_1.default.resolve(from);
|
|
37
|
-
const dirs = this.#getDirs(from);
|
|
38
|
-
const firstDirIter = await dirs.next();
|
|
39
|
-
/* istanbul ignore if -- @preserve */
|
|
40
|
-
if (firstDirIter.done) {
|
|
41
|
-
// this should never happen
|
|
42
|
-
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
|
|
43
|
-
}
|
|
44
|
-
let currentDir = firstDirIter.value;
|
|
45
|
-
const search = async () => {
|
|
46
|
-
/* istanbul ignore if -- @preserve */
|
|
47
|
-
if (await (0, util_js_1.isDirectory)(currentDir.path)) {
|
|
48
|
-
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlaces)) {
|
|
49
|
-
try {
|
|
50
|
-
const result = await this.#readConfiguration(filepath);
|
|
51
|
-
if (result !== null &&
|
|
52
|
-
!(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
|
|
53
|
-
return await this.config.transform(result);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
if (error.code === 'ENOENT' ||
|
|
58
|
-
error.code === 'EISDIR' ||
|
|
59
|
-
error.code === 'ENOTDIR' ||
|
|
60
|
-
error.code === 'EACCES') {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const nextDirIter = await dirs.next();
|
|
68
|
-
if (!nextDirIter.done) {
|
|
69
|
-
currentDir = nextDirIter.value;
|
|
70
|
-
if (this.searchCache) {
|
|
71
|
-
return await (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
|
|
72
|
-
}
|
|
73
|
-
return await search();
|
|
74
|
-
}
|
|
75
|
-
return await this.config.transform(null);
|
|
76
|
-
};
|
|
77
|
-
if (this.searchCache) {
|
|
78
|
-
return await (0, util_js_1.emplace)(this.searchCache, from, search);
|
|
79
|
-
}
|
|
80
|
-
return await search();
|
|
81
|
-
}
|
|
82
|
-
async #readConfiguration(filepath, importStack = []) {
|
|
83
|
-
const contents = await promises_1.default.readFile(filepath, { encoding: 'utf-8' });
|
|
84
|
-
return this.toCosmiconfigResult(filepath, await this.#loadConfigFileWithImports(filepath, contents, importStack));
|
|
85
|
-
}
|
|
86
|
-
async #loadConfigFileWithImports(filepath, contents, importStack) {
|
|
87
|
-
const loadedContent = await this.#loadConfiguration(filepath, contents);
|
|
88
|
-
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, '$import')) {
|
|
89
|
-
return loadedContent;
|
|
90
|
-
}
|
|
91
|
-
const fileDirectory = path_1.default.dirname(filepath);
|
|
92
|
-
const { $import: imports, ...ownContent } = loadedContent;
|
|
93
|
-
const importPaths = Array.isArray(imports) ? imports : [imports];
|
|
94
|
-
const newImportStack = [...importStack, filepath];
|
|
95
|
-
this.validateImports(filepath, importPaths, newImportStack);
|
|
96
|
-
const importedConfigs = await Promise.all(importPaths.map(async (importPath) => {
|
|
97
|
-
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
98
|
-
const result = await this.#readConfiguration(fullPath, newImportStack);
|
|
99
|
-
return result?.config;
|
|
100
|
-
}));
|
|
101
|
-
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
|
|
102
|
-
mergeArrays: this.config.mergeImportArrays,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
async #loadConfiguration(filepath, contents) {
|
|
106
|
-
if (contents.trim() === '') {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const extension = path_1.default.extname(filepath);
|
|
110
|
-
const loader = this.config.loaders[extension || 'noExt'] ??
|
|
111
|
-
this.config.loaders['default'];
|
|
112
|
-
if (!loader) {
|
|
113
|
-
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
const loadedContents = await loader(filepath, contents);
|
|
117
|
-
if (path_1.default.basename(filepath, extension) !== 'package') {
|
|
118
|
-
return loadedContents;
|
|
119
|
-
}
|
|
120
|
-
return ((0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null);
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
error.filepath = filepath;
|
|
124
|
-
throw error;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
async #fileExists(path) {
|
|
128
|
-
try {
|
|
129
|
-
await promises_1.default.stat(path);
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async *#getDirs(startDir) {
|
|
137
|
-
switch (this.config.searchStrategy) {
|
|
138
|
-
case 'none': {
|
|
139
|
-
// only check in the passed directory (defaults to working directory)
|
|
140
|
-
yield { path: startDir, isGlobalConfig: false };
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
case 'project': {
|
|
144
|
-
let currentDir = startDir;
|
|
145
|
-
while (true) {
|
|
146
|
-
yield { path: currentDir, isGlobalConfig: false };
|
|
147
|
-
let foundPackageFile = false;
|
|
148
|
-
for (const ext of ['json', 'yaml']) {
|
|
149
|
-
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
|
|
150
|
-
if (await this.#fileExists(packageFile)) {
|
|
151
|
-
foundPackageFile = true;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (foundPackageFile) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const parentDir = path_1.default.dirname(currentDir);
|
|
159
|
-
/* istanbul ignore if -- @preserve */
|
|
160
|
-
if (parentDir === currentDir) {
|
|
161
|
-
// we're probably at the root of the directory structure
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
currentDir = parentDir;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
case 'global': {
|
|
168
|
-
yield* this.getGlobalDirs(startDir);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
exports.Explorer = Explorer;
|
|
174
|
-
//# sourceMappingURL=Explorer.js.map
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExplorerBase = void 0;
|
|
7
|
-
exports.getExtensionDescription = getExtensionDescription;
|
|
8
|
-
const env_paths_1 = __importDefault(require("env-paths"));
|
|
9
|
-
const os_1 = __importDefault(require("os"));
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const util_js_1 = require("./util.js");
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
class ExplorerBase {
|
|
16
|
-
#loadingMetaConfig = false;
|
|
17
|
-
config;
|
|
18
|
-
loadCache;
|
|
19
|
-
searchCache;
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.config = options;
|
|
22
|
-
if (options.cache) {
|
|
23
|
-
this.loadCache = new Map();
|
|
24
|
-
this.searchCache = new Map();
|
|
25
|
-
}
|
|
26
|
-
this.#validateConfig();
|
|
27
|
-
}
|
|
28
|
-
set loadingMetaConfig(value) {
|
|
29
|
-
this.#loadingMetaConfig = value;
|
|
30
|
-
}
|
|
31
|
-
#validateConfig() {
|
|
32
|
-
const config = this.config;
|
|
33
|
-
for (const place of config.searchPlaces) {
|
|
34
|
-
const extension = path_1.default.extname(place);
|
|
35
|
-
const loader = this.config.loaders[extension || 'noExt'] ??
|
|
36
|
-
this.config.loaders['default'];
|
|
37
|
-
if (loader === undefined) {
|
|
38
|
-
throw new Error(`Missing loader for ${getExtensionDescription(place)}.`);
|
|
39
|
-
}
|
|
40
|
-
if (typeof loader !== 'function') {
|
|
41
|
-
throw new Error(`Loader for ${getExtensionDescription(place)} is not a function: Received ${typeof loader}.`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
clearLoadCache() {
|
|
46
|
-
if (this.loadCache) {
|
|
47
|
-
this.loadCache.clear();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
clearSearchCache() {
|
|
51
|
-
if (this.searchCache) {
|
|
52
|
-
this.searchCache.clear();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
clearCaches() {
|
|
56
|
-
this.clearLoadCache();
|
|
57
|
-
this.clearSearchCache();
|
|
58
|
-
}
|
|
59
|
-
toCosmiconfigResult(filepath, config) {
|
|
60
|
-
if (config === null) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
if (config === undefined) {
|
|
64
|
-
return { filepath, config: undefined, isEmpty: true };
|
|
65
|
-
}
|
|
66
|
-
if (this.config.applyPackagePropertyPathToConfiguration ||
|
|
67
|
-
this.#loadingMetaConfig) {
|
|
68
|
-
const packageProp = this.config.packageProp ?? this.config.moduleName;
|
|
69
|
-
config = (0, util_js_1.getPropertyByPath)(config, packageProp);
|
|
70
|
-
}
|
|
71
|
-
if (config === undefined) {
|
|
72
|
-
return { filepath, config: undefined, isEmpty: true };
|
|
73
|
-
}
|
|
74
|
-
return { config, filepath };
|
|
75
|
-
}
|
|
76
|
-
validateImports(containingFilePath, imports, importStack) {
|
|
77
|
-
const fileDirectory = path_1.default.dirname(containingFilePath);
|
|
78
|
-
for (const importPath of imports) {
|
|
79
|
-
if (typeof importPath !== 'string') {
|
|
80
|
-
throw new Error(`${containingFilePath}: Key $import must contain a string or a list of strings`);
|
|
81
|
-
}
|
|
82
|
-
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
83
|
-
if (fullPath === containingFilePath) {
|
|
84
|
-
throw new Error(`Self-import detected in ${containingFilePath}`);
|
|
85
|
-
}
|
|
86
|
-
const idx = importStack.indexOf(fullPath);
|
|
87
|
-
if (idx !== -1) {
|
|
88
|
-
throw new Error(`Circular import detected:
|
|
89
|
-
${[...importStack, fullPath]
|
|
90
|
-
.map((path, i) => `${i + 1}. ${path}`)
|
|
91
|
-
.join('\n')} (same as ${idx + 1}.)`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
getSearchPlacesForDir(dir, globalConfigPlaces) {
|
|
96
|
-
return (dir.isGlobalConfig ? globalConfigPlaces : this.config.searchPlaces).map((place) => path_1.default.join(dir.path, place));
|
|
97
|
-
}
|
|
98
|
-
getGlobalConfigDir() {
|
|
99
|
-
return (0, env_paths_1.default)(this.config.moduleName, { suffix: '' }).config;
|
|
100
|
-
}
|
|
101
|
-
*getGlobalDirs(startDir) {
|
|
102
|
-
const stopDir = path_1.default.resolve(this.config.stopDir ?? os_1.default.homedir());
|
|
103
|
-
yield { path: startDir, isGlobalConfig: false };
|
|
104
|
-
let currentDir = startDir;
|
|
105
|
-
while (currentDir !== stopDir) {
|
|
106
|
-
const parentDir = path_1.default.dirname(currentDir);
|
|
107
|
-
/* istanbul ignore if -- @preserve */
|
|
108
|
-
if (parentDir === currentDir) {
|
|
109
|
-
// we're probably at the root of the directory structure
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
yield { path: parentDir, isGlobalConfig: false };
|
|
113
|
-
currentDir = parentDir;
|
|
114
|
-
}
|
|
115
|
-
yield { path: this.getGlobalConfigDir(), isGlobalConfig: true };
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
exports.ExplorerBase = ExplorerBase;
|
|
119
|
-
/**
|
|
120
|
-
* @internal
|
|
121
|
-
*/
|
|
122
|
-
function getExtensionDescription(extension) {
|
|
123
|
-
/* istanbul ignore next -- @preserve */
|
|
124
|
-
return extension ? `extension "${extension}"` : 'files without extensions';
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=ExplorerBase.js.map
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExplorerSync = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const defaults_1 = require("./defaults");
|
|
10
|
-
const ExplorerBase_js_1 = require("./ExplorerBase.js");
|
|
11
|
-
const merge_1 = require("./merge");
|
|
12
|
-
const util_js_1 = require("./util.js");
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
class ExplorerSync extends ExplorerBase_js_1.ExplorerBase {
|
|
17
|
-
load(filepath) {
|
|
18
|
-
filepath = path_1.default.resolve(filepath);
|
|
19
|
-
const load = () => {
|
|
20
|
-
return this.config.transform(this.#readConfiguration(filepath));
|
|
21
|
-
};
|
|
22
|
-
if (this.loadCache) {
|
|
23
|
-
return (0, util_js_1.emplace)(this.loadCache, filepath, load);
|
|
24
|
-
}
|
|
25
|
-
return load();
|
|
26
|
-
}
|
|
27
|
-
search(from = '') {
|
|
28
|
-
if (this.config.metaConfigFilePath) {
|
|
29
|
-
this.loadingMetaConfig = true;
|
|
30
|
-
const config = this.load(this.config.metaConfigFilePath);
|
|
31
|
-
this.loadingMetaConfig = false;
|
|
32
|
-
if (config && !config.isEmpty) {
|
|
33
|
-
return config;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
from = path_1.default.resolve(from);
|
|
37
|
-
const dirs = this.#getDirs(from);
|
|
38
|
-
const firstDirIter = dirs.next();
|
|
39
|
-
/* istanbul ignore if -- @preserve */
|
|
40
|
-
if (firstDirIter.done) {
|
|
41
|
-
// this should never happen
|
|
42
|
-
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
|
|
43
|
-
}
|
|
44
|
-
let currentDir = firstDirIter.value;
|
|
45
|
-
const search = () => {
|
|
46
|
-
/* istanbul ignore if -- @preserve */
|
|
47
|
-
if ((0, util_js_1.isDirectorySync)(currentDir.path)) {
|
|
48
|
-
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlacesSync)) {
|
|
49
|
-
try {
|
|
50
|
-
const result = this.#readConfiguration(filepath);
|
|
51
|
-
if (result !== null &&
|
|
52
|
-
!(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
|
|
53
|
-
return this.config.transform(result);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
if (error.code === 'ENOENT' ||
|
|
58
|
-
error.code === 'EISDIR' ||
|
|
59
|
-
error.code === 'ENOTDIR' ||
|
|
60
|
-
error.code === 'EACCES') {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const nextDirIter = dirs.next();
|
|
68
|
-
if (!nextDirIter.done) {
|
|
69
|
-
currentDir = nextDirIter.value;
|
|
70
|
-
if (this.searchCache) {
|
|
71
|
-
return (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
|
|
72
|
-
}
|
|
73
|
-
return search();
|
|
74
|
-
}
|
|
75
|
-
return this.config.transform(null);
|
|
76
|
-
};
|
|
77
|
-
if (this.searchCache) {
|
|
78
|
-
return (0, util_js_1.emplace)(this.searchCache, from, search);
|
|
79
|
-
}
|
|
80
|
-
return search();
|
|
81
|
-
}
|
|
82
|
-
#readConfiguration(filepath, importStack = []) {
|
|
83
|
-
const contents = fs_1.default.readFileSync(filepath, 'utf8');
|
|
84
|
-
return this.toCosmiconfigResult(filepath, this.#loadConfigFileWithImports(filepath, contents, importStack));
|
|
85
|
-
}
|
|
86
|
-
#loadConfigFileWithImports(filepath, contents, importStack) {
|
|
87
|
-
const loadedContent = this.#loadConfiguration(filepath, contents);
|
|
88
|
-
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, '$import')) {
|
|
89
|
-
return loadedContent;
|
|
90
|
-
}
|
|
91
|
-
const fileDirectory = path_1.default.dirname(filepath);
|
|
92
|
-
const { $import: imports, ...ownContent } = loadedContent;
|
|
93
|
-
const importPaths = Array.isArray(imports) ? imports : [imports];
|
|
94
|
-
const newImportStack = [...importStack, filepath];
|
|
95
|
-
this.validateImports(filepath, importPaths, newImportStack);
|
|
96
|
-
const importedConfigs = importPaths.map((importPath) => {
|
|
97
|
-
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
98
|
-
const result = this.#readConfiguration(fullPath, newImportStack);
|
|
99
|
-
return result?.config;
|
|
100
|
-
});
|
|
101
|
-
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
|
|
102
|
-
mergeArrays: this.config.mergeImportArrays,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
#loadConfiguration(filepath, contents) {
|
|
106
|
-
if (contents.trim() === '') {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const extension = path_1.default.extname(filepath);
|
|
110
|
-
const loader = this.config.loaders[extension || 'noExt'] ??
|
|
111
|
-
this.config.loaders['default'];
|
|
112
|
-
if (!loader) {
|
|
113
|
-
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
const loadedContents = loader(filepath, contents);
|
|
117
|
-
if (path_1.default.basename(filepath, extension) !== 'package') {
|
|
118
|
-
return loadedContents;
|
|
119
|
-
}
|
|
120
|
-
return ((0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null);
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
error.filepath = filepath;
|
|
124
|
-
throw error;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
#fileExists(path) {
|
|
128
|
-
try {
|
|
129
|
-
fs_1.default.statSync(path);
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
*#getDirs(startDir) {
|
|
137
|
-
switch (this.config.searchStrategy) {
|
|
138
|
-
case 'none': {
|
|
139
|
-
// there is no next dir
|
|
140
|
-
yield { path: startDir, isGlobalConfig: false };
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
case 'project': {
|
|
144
|
-
let currentDir = startDir;
|
|
145
|
-
while (true) {
|
|
146
|
-
yield { path: currentDir, isGlobalConfig: false };
|
|
147
|
-
let foundPackageFile = false;
|
|
148
|
-
for (const ext of ['json', 'yaml']) {
|
|
149
|
-
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
|
|
150
|
-
if (this.#fileExists(packageFile)) {
|
|
151
|
-
foundPackageFile = true;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (foundPackageFile) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const parentDir = path_1.default.dirname(currentDir);
|
|
159
|
-
/* istanbul ignore if -- @preserve */
|
|
160
|
-
if (parentDir === currentDir) {
|
|
161
|
-
// we're probably at the root of the directory structure
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
currentDir = parentDir;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
case 'global': {
|
|
168
|
-
yield* this.getGlobalDirs(startDir);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* @deprecated Use {@link ExplorerSync.prototype.load}.
|
|
174
|
-
*/
|
|
175
|
-
/* istanbul ignore next */
|
|
176
|
-
loadSync(filepath) {
|
|
177
|
-
return this.load(filepath);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* @deprecated Use {@link ExplorerSync.prototype.search}.
|
|
181
|
-
*/
|
|
182
|
-
/* istanbul ignore next */
|
|
183
|
-
searchSync(from = '') {
|
|
184
|
-
return this.search(from);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
exports.ExplorerSync = ExplorerSync;
|
|
188
|
-
//# sourceMappingURL=ExplorerSync.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare function getDefaultSearchPlaces(moduleName: string): Array<string>;
|
|
2
|
-
export declare function getDefaultSearchPlacesSync(moduleName: string): Array<string>;
|
|
3
|
-
export declare const globalConfigSearchPlaces: string[];
|
|
4
|
-
export declare const globalConfigSearchPlacesSync: string[];
|
|
5
|
-
export declare const metaSearchPlaces: string[];
|
|
6
|
-
export declare const defaultLoaders: Readonly<{
|
|
7
|
-
readonly '.mjs': import("./types").Loader;
|
|
8
|
-
readonly '.cjs': import("./types").Loader;
|
|
9
|
-
readonly '.js': import("./types").Loader;
|
|
10
|
-
readonly '.ts': import("./types").Loader;
|
|
11
|
-
readonly '.json': import("./types").LoaderSync;
|
|
12
|
-
readonly '.yaml': import("./types").LoaderSync;
|
|
13
|
-
readonly '.yml': import("./types").LoaderSync;
|
|
14
|
-
readonly noExt: import("./types").LoaderSync;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const defaultLoadersSync: Readonly<{
|
|
17
|
-
readonly '.cjs': import("./types").LoaderSync;
|
|
18
|
-
readonly '.js': import("./types").LoaderSync;
|
|
19
|
-
readonly '.ts': import("./types").LoaderSync;
|
|
20
|
-
readonly '.json': import("./types").LoaderSync;
|
|
21
|
-
readonly '.yaml': import("./types").LoaderSync;
|
|
22
|
-
readonly '.yml': import("./types").LoaderSync;
|
|
23
|
-
readonly noExt: import("./types").LoaderSync;
|
|
24
|
-
}>;
|
|
25
|
-
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultLoadersSync = exports.defaultLoaders = exports.metaSearchPlaces = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = void 0;
|
|
4
|
-
exports.getDefaultSearchPlaces = getDefaultSearchPlaces;
|
|
5
|
-
exports.getDefaultSearchPlacesSync = getDefaultSearchPlacesSync;
|
|
6
|
-
const loaders_1 = require("./loaders");
|
|
7
|
-
function getDefaultSearchPlaces(moduleName) {
|
|
8
|
-
return [
|
|
9
|
-
'package.json',
|
|
10
|
-
`.${moduleName}rc`,
|
|
11
|
-
`.${moduleName}rc.json`,
|
|
12
|
-
`.${moduleName}rc.yaml`,
|
|
13
|
-
`.${moduleName}rc.yml`,
|
|
14
|
-
`.${moduleName}rc.js`,
|
|
15
|
-
`.${moduleName}rc.ts`,
|
|
16
|
-
`.${moduleName}rc.cjs`,
|
|
17
|
-
`.${moduleName}rc.mjs`,
|
|
18
|
-
`.config/${moduleName}rc`,
|
|
19
|
-
`.config/${moduleName}rc.json`,
|
|
20
|
-
`.config/${moduleName}rc.yaml`,
|
|
21
|
-
`.config/${moduleName}rc.yml`,
|
|
22
|
-
`.config/${moduleName}rc.js`,
|
|
23
|
-
`.config/${moduleName}rc.ts`,
|
|
24
|
-
`.config/${moduleName}rc.cjs`,
|
|
25
|
-
`.config/${moduleName}rc.mjs`,
|
|
26
|
-
`${moduleName}.config.js`,
|
|
27
|
-
`${moduleName}.config.ts`,
|
|
28
|
-
`${moduleName}.config.cjs`,
|
|
29
|
-
`${moduleName}.config.mjs`,
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
function getDefaultSearchPlacesSync(moduleName) {
|
|
33
|
-
return [
|
|
34
|
-
'package.json',
|
|
35
|
-
`.${moduleName}rc`,
|
|
36
|
-
`.${moduleName}rc.json`,
|
|
37
|
-
`.${moduleName}rc.yaml`,
|
|
38
|
-
`.${moduleName}rc.yml`,
|
|
39
|
-
`.${moduleName}rc.js`,
|
|
40
|
-
`.${moduleName}rc.ts`,
|
|
41
|
-
`.${moduleName}rc.cjs`,
|
|
42
|
-
`.config/${moduleName}rc`,
|
|
43
|
-
`.config/${moduleName}rc.json`,
|
|
44
|
-
`.config/${moduleName}rc.yaml`,
|
|
45
|
-
`.config/${moduleName}rc.yml`,
|
|
46
|
-
`.config/${moduleName}rc.js`,
|
|
47
|
-
`.config/${moduleName}rc.ts`,
|
|
48
|
-
`.config/${moduleName}rc.cjs`,
|
|
49
|
-
`${moduleName}.config.js`,
|
|
50
|
-
`${moduleName}.config.ts`,
|
|
51
|
-
`${moduleName}.config.cjs`,
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
exports.globalConfigSearchPlaces = [
|
|
55
|
-
'config',
|
|
56
|
-
'config.json',
|
|
57
|
-
'config.yaml',
|
|
58
|
-
'config.yml',
|
|
59
|
-
'config.js',
|
|
60
|
-
'config.ts',
|
|
61
|
-
'config.cjs',
|
|
62
|
-
'config.mjs',
|
|
63
|
-
];
|
|
64
|
-
exports.globalConfigSearchPlacesSync = [
|
|
65
|
-
'config',
|
|
66
|
-
'config.json',
|
|
67
|
-
'config.yaml',
|
|
68
|
-
'config.yml',
|
|
69
|
-
'config.js',
|
|
70
|
-
'config.ts',
|
|
71
|
-
'config.cjs',
|
|
72
|
-
];
|
|
73
|
-
// this needs to be hardcoded, as this is intended for end users, who can't supply options at this point
|
|
74
|
-
exports.metaSearchPlaces = [
|
|
75
|
-
'package.json',
|
|
76
|
-
'package.yaml',
|
|
77
|
-
'.config/config.json',
|
|
78
|
-
'.config/config.yaml',
|
|
79
|
-
'.config/config.yml',
|
|
80
|
-
'.config/config.js',
|
|
81
|
-
'.config/config.ts',
|
|
82
|
-
'.config/config.cjs',
|
|
83
|
-
'.config/config.mjs',
|
|
84
|
-
];
|
|
85
|
-
// do not allow mutation of default loaders. Make sure it is set inside options
|
|
86
|
-
exports.defaultLoaders = Object.freeze({
|
|
87
|
-
'.mjs': loaders_1.loadJs,
|
|
88
|
-
'.cjs': loaders_1.loadJs,
|
|
89
|
-
'.js': loaders_1.loadJs,
|
|
90
|
-
'.ts': loaders_1.loadTs,
|
|
91
|
-
'.json': loaders_1.loadJson,
|
|
92
|
-
'.yaml': loaders_1.loadYaml,
|
|
93
|
-
'.yml': loaders_1.loadYaml,
|
|
94
|
-
noExt: loaders_1.loadYaml,
|
|
95
|
-
});
|
|
96
|
-
exports.defaultLoadersSync = Object.freeze({
|
|
97
|
-
'.cjs': loaders_1.loadJsSync,
|
|
98
|
-
'.js': loaders_1.loadJsSync,
|
|
99
|
-
'.ts': loaders_1.loadTsSync,
|
|
100
|
-
'.json': loaders_1.loadJson,
|
|
101
|
-
'.yaml': loaders_1.loadYaml,
|
|
102
|
-
'.yml': loaders_1.loadYaml,
|
|
103
|
-
noExt: loaders_1.loadYaml,
|
|
104
|
-
});
|
|
105
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { defaultLoaders, defaultLoadersSync, getDefaultSearchPlaces, getDefaultSearchPlacesSync, globalConfigSearchPlaces, globalConfigSearchPlacesSync } from './defaults';
|
|
2
|
-
import { CommonOptions, Config, CosmiconfigResult, Loader, LoaderResult, Loaders, LoadersSync, LoaderSync, Options, OptionsSync, PublicExplorer, PublicExplorerBase, PublicExplorerSync, SearchStrategy, Transform, TransformSync } from './types.js';
|
|
3
|
-
export declare function cosmiconfig(moduleName: string, options?: Readonly<Partial<Options>>): PublicExplorer;
|
|
4
|
-
export declare function cosmiconfigSync(moduleName: string, options?: Readonly<Partial<OptionsSync>>): PublicExplorerSync;
|
|
5
|
-
export { Config, CosmiconfigResult, LoaderResult, Loader, Loaders, LoaderSync, LoadersSync, Transform, TransformSync, SearchStrategy, CommonOptions, Options, OptionsSync, PublicExplorerBase, PublicExplorer, PublicExplorerSync, getDefaultSearchPlaces, getDefaultSearchPlacesSync, globalConfigSearchPlaces, globalConfigSearchPlacesSync, defaultLoaders, defaultLoadersSync, };
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|