@shibanet0/datamitsu-config 0.0.1-alpha-29 → 0.0.1-alpha-30
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/datamitsu.js +1 -1
- package/dist/datamitsu.d.ts +692 -0
- package/package.json +1 -1
- package/dist/array-func-M6KDQ7DN.js +0 -14
- package/dist/array-func-NPT6GB52.js +0 -14
- package/dist/arrayFunc-5N3GY2F7.js +0 -26
- package/dist/arrow-return-style-EWYINZUP.js +0 -10
- package/dist/arrow-return-style-OSKSFIYU.js +0 -12
- package/dist/binary/index.d.ts +0 -1
- package/dist/binary/main.d.ts +0 -1
- package/dist/binary/main.js +0 -0
- package/dist/boundaries-HC23RTYZ.js +0 -10
- package/dist/boundaries-YMO2BVMA.js +0 -12
- package/dist/chunk-7PGRJISO.js +0 -24
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-USDUPVZD.js +0 -51
- package/dist/clean-package/index.d.ts +0 -27
- package/dist/clsx-S7LTRDUJ.js +0 -8
- package/dist/command-DSHZBIFC.js +0 -10
- package/dist/commitlint/index.d.ts +0 -109
- package/dist/commitlint/main.d.ts +0 -4
- package/dist/commitlint/main.js +0 -10
- package/dist/compat-4UCY3ESX.js +0 -10
- package/dist/compat-5MOKCDXB.js +0 -12
- package/dist/cspell-TO7G3MKP.js +0 -10
- package/dist/datamitsu-config/apps.d.ts +0 -1
- package/dist/datamitsu-config/apps.js +0 -81
- package/dist/datamitsu-config/cmdInit.d.ts +0 -2
- package/dist/datamitsu-config/cmdInit.js +0 -850
- package/dist/datamitsu-config/constants.d.ts +0 -4
- package/dist/datamitsu-config/constants.js +0 -6
- package/dist/datamitsu-config/env.d.ts +0 -5
- package/dist/datamitsu-config/env.js +0 -6
- package/dist/datamitsu-config/githubApps.json +0 -1936
- package/dist/datamitsu-config/hooks.d.ts +0 -1
- package/dist/datamitsu-config/ignore.d.ts +0 -1
- package/dist/datamitsu-config/ignore.js +0 -121
- package/dist/datamitsu-config/main.d.ts +0 -1
- package/dist/datamitsu-config/main.js +0 -32
- package/dist/datamitsu-config/project.d.ts +0 -1
- package/dist/datamitsu-config/project.js +0 -31
- package/dist/datamitsu-config/tools.d.ts +0 -1
- package/dist/datamitsu-config/tools.js +0 -332
- package/dist/datamitsu-config/utils/cleanDependencies.d.ts +0 -2
- package/dist/datamitsu-config/utils/cleanDependencies.js +0 -25
- package/dist/deMorgan-DBQHOKTA.js +0 -20
- package/dist/depend-77SBD4XZ.js +0 -10
- package/dist/depend-LGOLSLHO.js +0 -12
- package/dist/depend-TTKNVDIS.js +0 -10
- package/dist/dist-6KLXAMO5.js +0 -145
- package/dist/dist-E66E7N4U.js +0 -145
- package/dist/dist-FLFZ46LX.js +0 -147
- package/dist/dist-HY4C5Z2A.js +0 -145
- package/dist/dist-SV6KNVWH.js +0 -145
- package/dist/escompat-4SQ3LROQ.js +0 -11
- package/dist/escompat-LOSSJ2E4.js +0 -11
- package/dist/escompat-TAO52CFN.js +0 -10
- package/dist/eslint/globs.d.ts +0 -16
- package/dist/eslint/globs.js +0 -71
- package/dist/eslint/index.d.ts +0 -3
- package/dist/eslint/main.d.ts +0 -2
- package/dist/eslint/main.js +0 -66
- package/dist/eslint/plugins/array-func.d.ts +0 -2
- package/dist/eslint/plugins/arrayFunc.d.ts +0 -2
- package/dist/eslint/plugins/arrayFunc.js +0 -20
- package/dist/eslint/plugins/arrow-return-style.d.ts +0 -2
- package/dist/eslint/plugins/arrow-return-style.js +0 -4
- package/dist/eslint/plugins/boundaries.d.ts +0 -2
- package/dist/eslint/plugins/boundaries.js +0 -15
- package/dist/eslint/plugins/clsx.d.ts +0 -2
- package/dist/eslint/plugins/clsx.js +0 -4
- package/dist/eslint/plugins/command.d.ts +0 -2
- package/dist/eslint/plugins/command.js +0 -4
- package/dist/eslint/plugins/compat.d.ts +0 -2
- package/dist/eslint/plugins/compat.js +0 -4
- package/dist/eslint/plugins/cspell.d.ts +0 -2
- package/dist/eslint/plugins/cspell.js +0 -4
- package/dist/eslint/plugins/deMorgan.d.ts +0 -2
- package/dist/eslint/plugins/deMorgan.js +0 -14
- package/dist/eslint/plugins/depend.d.ts +0 -2
- package/dist/eslint/plugins/depend.js +0 -4
- package/dist/eslint/plugins/escompat.d.ts +0 -2
- package/dist/eslint/plugins/escompat.js +0 -4
- package/dist/eslint/plugins/fsecond.d.ts +0 -2
- package/dist/eslint/plugins/fsecond.js +0 -12
- package/dist/eslint/plugins/html.d.ts +0 -2
- package/dist/eslint/plugins/html.js +0 -12
- package/dist/eslint/plugins/i18next.d.ts +0 -2
- package/dist/eslint/plugins/i18next.js +0 -4
- package/dist/eslint/plugins/import.d.ts +0 -2
- package/dist/eslint/plugins/import.js +0 -27
- package/dist/eslint/plugins/javascript.d.ts +0 -2
- package/dist/eslint/plugins/javascript.js +0 -32
- package/dist/eslint/plugins/jsdoc.d.ts +0 -2
- package/dist/eslint/plugins/jsdoc.js +0 -4
- package/dist/eslint/plugins/json-schema-validator.d.ts +0 -2
- package/dist/eslint/plugins/json-schema-validator.js +0 -15
- package/dist/eslint/plugins/json.d.ts +0 -2
- package/dist/eslint/plugins/json.js +0 -24
- package/dist/eslint/plugins/jsonc.d.ts +0 -2
- package/dist/eslint/plugins/jsonc.js +0 -7
- package/dist/eslint/plugins/jsx-a11y.d.ts +0 -2
- package/dist/eslint/plugins/jsx-a11y.js +0 -22
- package/dist/eslint/plugins/n.d.ts +0 -2
- package/dist/eslint/plugins/n.js +0 -15
- package/dist/eslint/plugins/no-unsanitized.d.ts +0 -2
- package/dist/eslint/plugins/no-unsanitized.js +0 -4
- package/dist/eslint/plugins/no-use-extend-native.d.ts +0 -2
- package/dist/eslint/plugins/no-use-extend-native.js +0 -15
- package/dist/eslint/plugins/oxlint.d.ts +0 -5
- package/dist/eslint/plugins/oxlint.js +0 -10
- package/dist/eslint/plugins/perfectionist copy.d.ts +0 -2
- package/dist/eslint/plugins/perfectionist.d.ts +0 -2
- package/dist/eslint/plugins/perfectionist.js +0 -95
- package/dist/eslint/plugins/playwright.d.ts +0 -2
- package/dist/eslint/plugins/playwright.js +0 -15
- package/dist/eslint/plugins/pnpm.d.ts +0 -2
- package/dist/eslint/plugins/pnpm.js +0 -11
- package/dist/eslint/plugins/prettier.d.ts +0 -2
- package/dist/eslint/plugins/prettier.js +0 -14
- package/dist/eslint/plugins/promise.d.ts +0 -2
- package/dist/eslint/plugins/promise.js +0 -21
- package/dist/eslint/plugins/react copy.d.ts +0 -2
- package/dist/eslint/plugins/react-hooks.d.ts +0 -2
- package/dist/eslint/plugins/react-hooks.js +0 -14
- package/dist/eslint/plugins/react-perf.d.ts +0 -2
- package/dist/eslint/plugins/react-perf.js +0 -14
- package/dist/eslint/plugins/react-prefer-function-component.d.ts +0 -2
- package/dist/eslint/plugins/react-prefer-function-component.js +0 -15
- package/dist/eslint/plugins/react-refresh.d.ts +0 -2
- package/dist/eslint/plugins/react-refresh.js +0 -14
- package/dist/eslint/plugins/react-you-might-not-need-an-effect.d.ts +0 -2
- package/dist/eslint/plugins/react-you-might-not-need-an-effect.js +0 -4
- package/dist/eslint/plugins/react.d.ts +0 -5
- package/dist/eslint/plugins/react.js +0 -49
- package/dist/eslint/plugins/regexp.d.ts +0 -2
- package/dist/eslint/plugins/regexp.js +0 -4
- package/dist/eslint/plugins/security.d.ts +0 -2
- package/dist/eslint/plugins/security.js +0 -20
- package/dist/eslint/plugins/sonarjs.d.ts +0 -2
- package/dist/eslint/plugins/sonarjs.js +0 -38
- package/dist/eslint/plugins/storybook.d.ts +0 -2
- package/dist/eslint/plugins/storybook.js +0 -15
- package/dist/eslint/plugins/stylistic.d.ts +0 -2
- package/dist/eslint/plugins/stylistic.js +0 -14
- package/dist/eslint/plugins/toml.d.ts +0 -2
- package/dist/eslint/plugins/toml.js +0 -15
- package/dist/eslint/plugins/turbo.d.ts +0 -2
- package/dist/eslint/plugins/turbo.js +0 -15
- package/dist/eslint/plugins/typescript.d.ts +0 -2
- package/dist/eslint/plugins/typescript.js +0 -34
- package/dist/eslint/plugins/unicorn copy.d.ts +0 -2
- package/dist/eslint/plugins/unicorn.d.ts +0 -2
- package/dist/eslint/plugins/unicorn.js +0 -69
- package/dist/eslint/plugins/unused-imports.d.ts +0 -2
- package/dist/eslint/plugins/unused-imports.js +0 -24
- package/dist/eslint/plugins/vanilla-extract.d.ts +0 -2
- package/dist/eslint/plugins/vanilla-extract.js +0 -17
- package/dist/eslint/plugins/vitest.d.ts +0 -2
- package/dist/eslint/plugins/vitest.js +0 -15
- package/dist/eslint/plugins/yaml.d.ts +0 -2
- package/dist/eslint/plugins/yml.d.ts +0 -2
- package/dist/eslint/plugins/yml.js +0 -21
- package/dist/eslint/types.d.ts +0 -179
- package/dist/eslint/types.js +0 -0
- package/dist/fsecond-3RU4GC2P.js +0 -8
- package/dist/fsecond-L3WD5A5A.js +0 -13
- package/dist/fsecond-T4KZEO22.js +0 -12
- package/dist/globs/globs.d.ts +0 -1
- package/dist/globs/globs.js +0 -1
- package/dist/i18next-QAQGS665.js +0 -10
- package/dist/import-5CHN52T3.js +0 -33
- package/dist/javascript-4XNVXG56.js +0 -38
- package/dist/jsdoc-BFCHD6BR.js +0 -12
- package/dist/jsdoc-ETFYVH7N.js +0 -10
- package/dist/json-JLHKHY5N.js +0 -30
- package/dist/json-LWTL4ZNK.js +0 -18
- package/dist/json-ZAIWY2QG.js +0 -18
- package/dist/json-schema-validator-G4FJBJG2.js +0 -21
- package/dist/jsonc-4Q5WZVF3.js +0 -12
- package/dist/jsonc-C4HCFU4B.js +0 -10
- package/dist/jsx-a11y-2Z3YLKS7.js +0 -28
- package/dist/jsx-a11y-DENBIOMT.js +0 -7
- package/dist/knip/index.d.ts +0 -3
- package/dist/knip/main.d.ts +0 -3
- package/dist/knip/main.js +0 -8
- package/dist/lib/datamitsu.d.ts +0 -11
- package/dist/lib/index.d.ts +0 -1
- package/dist/lint-staged/index.js +0 -0
- package/dist/n-LGSE6NHE.js +0 -21
- package/dist/no-unsanitized-BP3NWBNG.js +0 -12
- package/dist/no-unsanitized-JJCCLDDN.js +0 -10
- package/dist/no-use-extend-native-4252MLPH.js +0 -21
- package/dist/no-use-extend-native-WXT3EZT4.js +0 -7
- package/dist/no-use-extend-native-ZPCF5GPF.js +0 -7
- package/dist/oxlint/index.d.ts +0 -2
- package/dist/oxlint/index.js +0 -36
- package/dist/oxlint-5VSAV63M.js +0 -58
- package/dist/oxlint-BKH6LVUT.js +0 -63
- package/dist/oxlint-ESXR6S2H.js +0 -55
- package/dist/oxlint-OEHGIQKE.js +0 -56
- package/dist/oxlint-SQKVSEWV.js +0 -58
- package/dist/oxlint-UN6IGLH6.js +0 -55
- package/dist/oxlint-ZACPD2U7.js +0 -62
- package/dist/perfectionist-RY3SJXTU.js +0 -101
- package/dist/perfectionist-YHPWKMW3.js +0 -80
- package/dist/playwright-BGT6YZAD.js +0 -15
- package/dist/playwright-DWBJI3E2.js +0 -21
- package/dist/playwright-EQJ74ILC.js +0 -15
- package/dist/pnpm-KXXRNMOS.js +0 -10
- package/dist/prettier/index.d.ts +0 -3
- package/dist/prettier/main.d.ts +0 -2
- package/dist/prettier/main.js +0 -12
- package/dist/prettier-RATOIHME.js +0 -20
- package/dist/prettier-STALF5K5.js +0 -7
- package/dist/prettier-VWVEU6BH.js +0 -7
- package/dist/promise-4UOFB7NK.js +0 -7
- package/dist/promise-7HLQAS46.js +0 -27
- package/dist/promise-GMCQOXN6.js +0 -7
- package/dist/react-FQDLJSLF.js +0 -66
- package/dist/react-QIEZHZI3.js +0 -61
- package/dist/react-QYLHZO2Q.js +0 -66
- package/dist/react-SBV4CSZW.js +0 -10
- package/dist/react-YRMI55JC.js +0 -68
- package/dist/react-hooks-7SLMJ6QC.js +0 -20
- package/dist/react-hooks-KCD4FRWS.js +0 -7
- package/dist/react-hooks-R6UCTUUG.js +0 -7
- package/dist/react-perf-GVJEUZ43.js +0 -20
- package/dist/react-perf-I32W4SW7.js +0 -7
- package/dist/react-prefer-function-component-HK26GJUW.js +0 -21
- package/dist/react-prefer-function-component-ZCGU3TJA.js +0 -7
- package/dist/react-refresh-DXTW3QQE.js +0 -20
- package/dist/react-you-might-not-need-an-effect-5O54WHDE.js +0 -10
- package/dist/react-you-might-not-need-an-effect-NZS3IU4F.js +0 -12
- package/dist/regexp-352YQCWR.js +0 -12
- package/dist/regexp-JVKIJGCV.js +0 -10
- package/dist/s0/__tests__/helpers/mockCrypto.d.ts +0 -23
- package/dist/s0/__tests__/helpers/mockExeca.d.ts +0 -47
- package/dist/s0/__tests__/helpers/mockFs.d.ts +0 -44
- package/dist/s0/__tests__/helpers/mockGlob.d.ts +0 -21
- package/dist/s0/cmd/pulumi/__tests__/cleanupState.test.d.ts +0 -1
- package/dist/s0/cmd/pulumi/__tests__/constants.test.d.ts +0 -1
- package/dist/s0/cmd/pulumi/__tests__/decryptState.test.d.ts +0 -1
- package/dist/s0/cmd/pulumi/__tests__/encryptState.test.d.ts +0 -1
- package/dist/s0/cmd/pulumi/__tests__/index.test.d.ts +0 -1
- package/dist/s0/cmd/pulumi/cleanupState.d.ts +0 -1
- package/dist/s0/cmd/pulumi/constants.d.ts +0 -41
- package/dist/s0/cmd/pulumi/decryptState.d.ts +0 -1
- package/dist/s0/cmd/pulumi/encryptState.d.ts +0 -1
- package/dist/s0/cmd/pulumi/index.d.ts +0 -2
- package/dist/s0/datamitsu.d.ts +0 -3
- package/dist/s0/index.d.ts +0 -1
- package/dist/s0/pulumi-sops/091c1ddb-facd-4171-b791-1b386a32e4ff/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/0c33559a-d7ab-4978-a363-a7105dd51350/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/16bd8ff6-4193-4420-b1b2-9646088ede53/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/3e66133e-f7c0-4453-a2c9-e83b62e4af3c/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/40bbde68-2cb9-41aa-a556-d606ac9c84c4/editor.mjs +0 -116
- package/dist/s0/pulumi-sops/41cae216-86eb-46e3-8091-84956fd6316e/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/439e1c86-700c-401b-bd9a-2b12b013a3bc/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/4bb9d4a2-74c1-4e1a-9d78-4d871fc9bd48/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/4cc4d490-1c23-4f9e-9e70-8ef87cad02b5/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/6bd9118e-c679-4030-9000-4e4273eb0ce0/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/87bab9bf-c7c3-45fb-9acb-0a1350e97ad0/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/8f30068d-012c-4dc8-b655-ea74b3b8164b/editor.mjs +0 -116
- package/dist/s0/pulumi-sops/970bfc17-bd57-4a35-928b-f69958b56329/editor.mjs +0 -120
- package/dist/s0/pulumi-sops/9776aa01-2a97-4725-bdd4-b434de5e42f6/editor.mjs +0 -120
- package/dist/s0/pulumi-sops/c0e9b360-f4b4-46d7-a3d4-a30651e9409b/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/c329990d-d211-4e60-82d2-c66d424661b8/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/cbbb9669-c8a7-4f72-83a5-312a9bcab43b/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/cc0b68e9-2731-463d-bab2-c179b7b6c5fc/editor.mjs +0 -116
- package/dist/s0/pulumi-sops/cc0d81df-f72c-4b21-9f6e-9ac595b05380/editor.mjs +0 -116
- package/dist/s0/pulumi-sops/d1a660b7-1bbd-40f1-836e-7c2ea852d5a8/editor.mjs +0 -121
- package/dist/s0/pulumi-sops/d5ddd29b-6bfd-4b21-8bce-56440c90a526/editor.mjs +0 -116
- package/dist/s0/pulumi-sops/d9248914-c396-4c14-81b5-9ff9fcd0d3fb/editor.mjs +0 -122
- package/dist/s0/pulumi-sops/e985abca-2949-4ebe-87a0-55f67ac0904d/editor.mjs +0 -116
- package/dist/s0/pulumi-sops/f9514550-0f7e-4ee1-b96a-2d9cf02a10fd/editor.mjs +0 -115
- package/dist/s0/utils/__tests__/datamitsu.test.d.ts +0 -1
- package/dist/s0/utils/__tests__/encryption.test.d.ts +0 -1
- package/dist/s0/utils/__tests__/tty.test.d.ts +0 -1
- package/dist/s0/utils/datamitsu.d.ts +0 -3
- package/dist/s0/utils/encryption.d.ts +0 -28
- package/dist/s0/utils/tty.d.ts +0 -1
- package/dist/security-C5XVZJVE.js +0 -26
- package/dist/security-QVOYXU25.js +0 -7
- package/dist/sonarjs-7NEHWSQM.js +0 -44
- package/dist/sonarjs-L2LS4QXC.js +0 -16
- package/dist/storybook-HBDSOOCR.js +0 -7
- package/dist/storybook-HSR4AZ5R.js +0 -21
- package/dist/storybook-IETULN4Z.js +0 -8
- package/dist/storybook-IFYU76LT.js +0 -7
- package/dist/stylistic-XPSWOXE5.js +0 -18
- package/dist/syncpack/index.d.ts +0 -2
- package/dist/syncpack/index.js +0 -22
- package/dist/toml-O5VFIDLY.js +0 -21
- package/dist/toml-UYLTOG46.js +0 -7
- package/dist/toml-Y76F5J2F.js +0 -7
- package/dist/turbo-BF4PT2F4.js +0 -7
- package/dist/turbo-UMGZCDB6.js +0 -21
- package/dist/turbo-ZBSVFMOO.js +0 -23
- package/dist/type-fest/index.d.ts +0 -1
- package/dist/typescript-6S3HNHEQ.js +0 -42
- package/dist/typescript-O2GSPRJG.js +0 -43
- package/dist/unicorn-CIVFI3IM.js +0 -17
- package/dist/unicorn-LX3V6FPZ.js +0 -64
- package/dist/unused-imports-4KLZJTXK.js +0 -29
- package/dist/unused-imports-7PV5NHDW.js +0 -25
- package/dist/unused-imports-B24FSXNB.js +0 -29
- package/dist/unused-imports-ERXQSJLW.js +0 -29
- package/dist/unused-imports-GCXR6T7K.js +0 -31
- package/dist/unused-imports-JO2R752C.js +0 -31
- package/dist/unused-imports-PHM72DI2.js +0 -25
- package/dist/unused-imports-Q4RVNVNE.js +0 -29
- package/dist/vanilla-extract-52HEEDJV.js +0 -11
- package/dist/vanilla-extract-LH7JF5I5.js +0 -23
- package/dist/yaml-IR24BZAD.js +0 -9
- package/dist/yaml-LUJQGNLH.js +0 -7
- package/dist/yml-CJIIAGHQ.js +0 -27
package/datamitsu.js
CHANGED
|
@@ -1840,7 +1840,7 @@ var mapOfApps = {
|
|
|
1840
1840
|
|
|
1841
1841
|
// package.json
|
|
1842
1842
|
var name = "@shibanet0/datamitsu-config";
|
|
1843
|
-
var version = "0.0.1-alpha-
|
|
1843
|
+
var version = "0.0.1-alpha-30";
|
|
1844
1844
|
var dependencies = {
|
|
1845
1845
|
"@antebudimir/eslint-plugin-vanilla-extract": "1.16.0",
|
|
1846
1846
|
"@commander-js/extra-typings": "14.0.0",
|
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
// prettier-ignore
|
|
2
|
+
declare global {
|
|
3
|
+
function getConfig(config: config.Config): config.Config;
|
|
4
|
+
|
|
5
|
+
namespace SysList {
|
|
6
|
+
type ArchType = "aarch64" | "amd64" | "arm64";
|
|
7
|
+
|
|
8
|
+
type OsType = "darwin" | "freebsd" | "linux" | "openbsd" | "windows";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Tools namespace with utility functions
|
|
13
|
+
*/
|
|
14
|
+
namespace tools {
|
|
15
|
+
/**
|
|
16
|
+
* Path utilities for working with file paths
|
|
17
|
+
*/
|
|
18
|
+
namespace Path {
|
|
19
|
+
/**
|
|
20
|
+
* Get absolute path from relative path
|
|
21
|
+
* @param path - Path to convert to absolute
|
|
22
|
+
* @returns Absolute path
|
|
23
|
+
* @throws Error if path cannot be resolved
|
|
24
|
+
* @example
|
|
25
|
+
* const absPath = tools.Path.abs("./file.txt");
|
|
26
|
+
* // Returns: "/current/working/directory/file.txt"
|
|
27
|
+
*/
|
|
28
|
+
function abs(path: string): string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Join path segments together using the OS-specific separator
|
|
32
|
+
* @param paths - Path segments to join
|
|
33
|
+
* @returns Joined path
|
|
34
|
+
* @example
|
|
35
|
+
* const fullPath = tools.Path.join("/home", "user", "file.txt");
|
|
36
|
+
* // Returns: "/home/user/file.txt" on Unix, "\\home\\user\\file.txt" on Windows
|
|
37
|
+
*/
|
|
38
|
+
function join(...paths: string[]): string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get relative path from base to target
|
|
42
|
+
* @param targetPath - Target path
|
|
43
|
+
* @param basePath - Base path (defaults to current working directory from facts().cwd)
|
|
44
|
+
* @returns Relative path from base to target
|
|
45
|
+
* @throws Error if relative path cannot be computed
|
|
46
|
+
* @example
|
|
47
|
+
* // Relative to cwd
|
|
48
|
+
* const relPath = tools.Path.rel("/home/user/project/file.txt");
|
|
49
|
+
* // If cwd is "/home/user", returns: "project/file.txt"
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // Relative to custom base
|
|
53
|
+
* const relPath = tools.Path.rel("/home/user/project/file.txt", "/home");
|
|
54
|
+
* // Returns: "user/project/file.txt"
|
|
55
|
+
*/
|
|
56
|
+
function rel(targetPath: string, basePath?: string): string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* .gitignore parser and stringifier
|
|
61
|
+
*/
|
|
62
|
+
namespace Ignore {
|
|
63
|
+
type IgnoreMap<T extends string = string> = { [K in T]?: string[] };
|
|
64
|
+
|
|
65
|
+
interface ParseResult<T extends string = string> {
|
|
66
|
+
groupOrder: T[];
|
|
67
|
+
groups: IgnoreMap<T>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Parse .gitignore file to grouped structure with preserved order
|
|
72
|
+
* @param content - .gitignore file content
|
|
73
|
+
* @returns Object with groups and their original order
|
|
74
|
+
* @example
|
|
75
|
+
* const { groups, groupOrder } = tools.Ignore.parse(fileContent);
|
|
76
|
+
* // groups: { "Dependencies": ["node_modules/"], "Build": ["dist/"] }
|
|
77
|
+
* // groupOrder: ["Dependencies", "Build"]
|
|
78
|
+
*
|
|
79
|
+
* // Use the original order when saving back
|
|
80
|
+
* const updated = tools.Ignore.stringify(groups, groupOrder);
|
|
81
|
+
*/
|
|
82
|
+
function parse<T extends string = string>(content: string): ParseResult<T>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Convert grouped structure back to .gitignore format
|
|
86
|
+
* @param groups - Object with group names as keys and rule arrays as values
|
|
87
|
+
* @param groupOrder - Optional partial array specifying the priority order of groups.
|
|
88
|
+
* Groups in this array will appear first in the specified order.
|
|
89
|
+
* Remaining groups will follow in alphabetical order.
|
|
90
|
+
* @returns Formatted .gitignore content
|
|
91
|
+
* @example
|
|
92
|
+
* // All groups in alphabetical order
|
|
93
|
+
* const content1 = tools.Ignore.stringify({
|
|
94
|
+
* "Testing": ["coverage/"],
|
|
95
|
+
* "Build": ["dist/"],
|
|
96
|
+
* "Dependencies": ["node_modules/"]
|
|
97
|
+
* });
|
|
98
|
+
* // Result order: Build, Dependencies, Testing
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* // Priority groups first, then alphabetical
|
|
102
|
+
* const content2 = tools.Ignore.stringify(
|
|
103
|
+
* {
|
|
104
|
+
* "Testing": ["coverage/"],
|
|
105
|
+
* "Build": ["dist/"],
|
|
106
|
+
* "Dependencies": ["node_modules/"],
|
|
107
|
+
* "IDE": [".vscode/"]
|
|
108
|
+
* },
|
|
109
|
+
* ["Dependencies", "Build"]
|
|
110
|
+
* );
|
|
111
|
+
* // Result order: Dependencies, Build, IDE, Testing
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* // Preserve original order
|
|
115
|
+
* const { groups, groupOrder } = tools.Ignore.parse(original);
|
|
116
|
+
* groups["New Group"] = ["new/rule"];
|
|
117
|
+
* const updated = tools.Ignore.stringify(groups, groupOrder);
|
|
118
|
+
*/
|
|
119
|
+
function stringify<T extends string>(groups: IgnoreMap<T>, groupOrder?: T[]): string;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
namespace config {
|
|
124
|
+
// ========================================
|
|
125
|
+
// Project Type Detection
|
|
126
|
+
// ========================================
|
|
127
|
+
|
|
128
|
+
interface Config {
|
|
129
|
+
/**
|
|
130
|
+
* Binary/app definitions
|
|
131
|
+
*/
|
|
132
|
+
apps?: BinManager.MapOfApps;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Config file initialization
|
|
136
|
+
*/
|
|
137
|
+
init?: MapOfConfigInit;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Init commands to run after setup
|
|
141
|
+
*/
|
|
142
|
+
initCommands?: MapOfInitCommands;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Project type definitions
|
|
146
|
+
*/
|
|
147
|
+
projectTypes?: MapOfProjectTypes;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Tool definitions
|
|
151
|
+
*/
|
|
152
|
+
tools?: MapOfTools;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Context passed to config content generator
|
|
157
|
+
*/
|
|
158
|
+
interface ConfigContext {
|
|
159
|
+
/**
|
|
160
|
+
* Current working directory
|
|
161
|
+
*/
|
|
162
|
+
cwdPath: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Content of existing file (if it exists)
|
|
166
|
+
* This may be modified content from previous merge operations
|
|
167
|
+
*/
|
|
168
|
+
existingContent?: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Path to existing file (if it exists)
|
|
172
|
+
*/
|
|
173
|
+
existingPath?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Whether the current working directory is the git root
|
|
177
|
+
*/
|
|
178
|
+
isRoot: boolean;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Original content of the file as it exists on disk
|
|
182
|
+
* This is always the unmodified content, even when existingContent has been transformed
|
|
183
|
+
*/
|
|
184
|
+
originalContent?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Detected project types
|
|
188
|
+
*/
|
|
189
|
+
projectTypes: string[];
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Git root path
|
|
193
|
+
*/
|
|
194
|
+
rootPath: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// ========================================
|
|
198
|
+
// Tool Execution Configuration
|
|
199
|
+
// ========================================
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Configuration file initialization (enhanced from existing)
|
|
203
|
+
*/
|
|
204
|
+
interface ConfigInit {
|
|
205
|
+
/**
|
|
206
|
+
* Function that generates file content
|
|
207
|
+
* Receives context about the project including existing file content if present
|
|
208
|
+
* Optional when deleteOnly is true
|
|
209
|
+
*/
|
|
210
|
+
content?: (context: ConfigContext) => string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* If true, only delete files from otherFileNameList without creating any new file
|
|
214
|
+
* Content function is ignored when deleteOnly is true
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
217
|
+
deleteOnly?: boolean;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* All other known filenames for this config
|
|
221
|
+
* These will be DELETED during install to avoid conflicts
|
|
222
|
+
* @example [".eslintrc.js", ".eslintrc.json", ".eslintrc.yml", "eslint.config.js"]
|
|
223
|
+
*/
|
|
224
|
+
otherFileNameList?: string[];
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Which project type this config applies to
|
|
228
|
+
* If not specified, applies to all projects
|
|
229
|
+
*/
|
|
230
|
+
projectTypes?: string[];
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Only create in project root
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
236
|
+
rootOnly?: boolean;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Initialization command to run after clone/install
|
|
241
|
+
*/
|
|
242
|
+
interface InitCommand {
|
|
243
|
+
/**
|
|
244
|
+
* Arguments
|
|
245
|
+
*/
|
|
246
|
+
args: string[];
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Command to execute (app name from MapOfApps)
|
|
250
|
+
*/
|
|
251
|
+
command: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Description
|
|
255
|
+
*/
|
|
256
|
+
description?: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Which project types this applies to
|
|
260
|
+
* Empty = all project types
|
|
261
|
+
*/
|
|
262
|
+
projectTypes?: string[];
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Only run if this file/directory exists
|
|
266
|
+
*/
|
|
267
|
+
when?: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Map of configuration init with mainFilename as key
|
|
272
|
+
* @example
|
|
273
|
+
* {
|
|
274
|
+
* ".gitignore": { content: () => "..." },
|
|
275
|
+
* "lefthook.yaml": { content: () => "..." },
|
|
276
|
+
* ".vscode/settings.json": { content: () => "..." }
|
|
277
|
+
* }
|
|
278
|
+
*/
|
|
279
|
+
type MapOfConfigInit = Record<string, ConfigInit>;
|
|
280
|
+
|
|
281
|
+
// ========================================
|
|
282
|
+
// Init Commands
|
|
283
|
+
// ========================================
|
|
284
|
+
|
|
285
|
+
type MapOfInitCommands = Record<string, InitCommand>;
|
|
286
|
+
|
|
287
|
+
type MapOfProjectTypes = Record<string, ProjectType>;
|
|
288
|
+
|
|
289
|
+
// ========================================
|
|
290
|
+
// Config File Management (ENHANCED)
|
|
291
|
+
// ========================================
|
|
292
|
+
|
|
293
|
+
type MapOfTools = Record<string, Tool>;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Operation type
|
|
297
|
+
*/
|
|
298
|
+
type OperationType = "fix" | "lint";
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Project type detector - defines when this project type is detected
|
|
302
|
+
*/
|
|
303
|
+
interface ProjectType {
|
|
304
|
+
/**
|
|
305
|
+
* Human-readable description
|
|
306
|
+
*/
|
|
307
|
+
description?: string;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Marker files that indicate this project type
|
|
311
|
+
* If ANY of these files exist in the root, project type is detected
|
|
312
|
+
* Supports glob patterns in repo root
|
|
313
|
+
* @example ["package.json", "yarn.lock"]
|
|
314
|
+
* @example ["go.mod"]
|
|
315
|
+
* @example ["*.tf"]
|
|
316
|
+
*/
|
|
317
|
+
markers: string[];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// ========================================
|
|
321
|
+
// Git Hook Configuration
|
|
322
|
+
// ========================================
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Tool definition - what operations a tool supports
|
|
326
|
+
*/
|
|
327
|
+
interface Tool {
|
|
328
|
+
/**
|
|
329
|
+
* Tool name/description
|
|
330
|
+
*/
|
|
331
|
+
name: string;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Operations this tool supports
|
|
335
|
+
*/
|
|
336
|
+
operations: Partial<Record<OperationType, ToolOperation>>;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Which project types this tool applies to
|
|
340
|
+
* Empty array or undefined = applies to all project types
|
|
341
|
+
* @example ["npm-package", "typescript-project"]
|
|
342
|
+
*/
|
|
343
|
+
projectTypes?: string[];
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Tool operation configuration - how to run a tool for a specific operation
|
|
348
|
+
*/
|
|
349
|
+
interface ToolOperation {
|
|
350
|
+
/**
|
|
351
|
+
* Arguments to pass to the command
|
|
352
|
+
* Special placeholders:
|
|
353
|
+
* - {file} - replaced with file path (per-file scope)
|
|
354
|
+
* - {files} - replaced with space-separated file list (batch mode)
|
|
355
|
+
* - {root} - replaced with project root path
|
|
356
|
+
* @example ["--fix", "{file}"]
|
|
357
|
+
* @example ["--noEmit", "--project", "{root}"]
|
|
358
|
+
*/
|
|
359
|
+
args: string[];
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Batch mode - обрабатывать файлы группами или по одному
|
|
363
|
+
* Используется только для scope: "per-project" или "repository"
|
|
364
|
+
* @default true для "per-project" и "repository", false для "per-file"
|
|
365
|
+
*/
|
|
366
|
+
batch?: boolean;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Command to execute (app name from MapOfApps)
|
|
370
|
+
*/
|
|
371
|
+
command: string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* File glob patterns this tool operates on
|
|
375
|
+
* Uses gitignore-style patterns
|
|
376
|
+
* @example ["**\/*.ts", "**\/*.tsx"]
|
|
377
|
+
* @example ["**\/*.md"]
|
|
378
|
+
*/
|
|
379
|
+
globs: string[];
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Files that should invalidate the cache when changed
|
|
383
|
+
* Paths are relative to project root
|
|
384
|
+
* @example ["eslint.config.js", "tsconfig.json"]
|
|
385
|
+
* @example [".prettierrc", "package.json"]
|
|
386
|
+
*/
|
|
387
|
+
invalidateOn?: string[];
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Priority/order when tools have overlapping globs
|
|
391
|
+
* Lower number = runs first
|
|
392
|
+
* Tools with same priority and overlapping globs run sequentially in definition order
|
|
393
|
+
* Tools with different globs or no overlap run in parallel
|
|
394
|
+
* @default 0
|
|
395
|
+
*/
|
|
396
|
+
priority?: number;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Scope определяет область выполнения и working directory
|
|
400
|
+
* - "repository": запуск один раз из git root для всего репозитория
|
|
401
|
+
* - "per-project": запуск для каждого detected project в его директории
|
|
402
|
+
* - "per-file": запуск для каждого файла в его директории
|
|
403
|
+
* @default "per-project"
|
|
404
|
+
* @example
|
|
405
|
+
* // ESLint - запускается в каждом проекте
|
|
406
|
+
* {
|
|
407
|
+
* scope: "per-project",
|
|
408
|
+
* command: "eslint",
|
|
409
|
+
* args: ["--quiet", "{files}"],
|
|
410
|
+
* globs: ["**\/*.ts", "**\/*.js"]
|
|
411
|
+
* }
|
|
412
|
+
* @example
|
|
413
|
+
* // syncpack - запускается один раз для всего монорепо
|
|
414
|
+
* {
|
|
415
|
+
* scope: "repository",
|
|
416
|
+
* command: "syncpack",
|
|
417
|
+
* args: ["lint"],
|
|
418
|
+
* globs: ["**\/package.json"]
|
|
419
|
+
* }
|
|
420
|
+
* @example
|
|
421
|
+
* // shfmt - форматирует каждый shell файл отдельно
|
|
422
|
+
* {
|
|
423
|
+
* scope: "per-file",
|
|
424
|
+
* command: "shfmt",
|
|
425
|
+
* args: ["-w", "{file}"],
|
|
426
|
+
* globs: ["**\/*.sh"]
|
|
427
|
+
* }
|
|
428
|
+
*/
|
|
429
|
+
scope: ToolScope;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Scope определяет область выполнения инструмента и автоматически определяет working directory
|
|
434
|
+
*/
|
|
435
|
+
type ToolScope =
|
|
436
|
+
| "per-file" // Запуск для каждого файла в его директории
|
|
437
|
+
| "per-project" // Запуск для каждого detected project в его директории
|
|
438
|
+
| "repository"; // Запуск один раз из git root для всего репозитория
|
|
439
|
+
|
|
440
|
+
// ========================================
|
|
441
|
+
// Main Config (ENHANCED)
|
|
442
|
+
// ========================================
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
namespace BinManager {
|
|
446
|
+
interface App {
|
|
447
|
+
binary?: AppConfigBinary;
|
|
448
|
+
pnpm?: AppConfigPNPM;
|
|
449
|
+
required?: boolean;
|
|
450
|
+
shell?: AppConfigShell;
|
|
451
|
+
uvx?: AppConfigUVX;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
interface AppConfigBinary {
|
|
455
|
+
binaries: MapOfBinaries;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
interface AppConfigPNPM {
|
|
459
|
+
packageName: string;
|
|
460
|
+
version: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
interface AppConfigShell {
|
|
464
|
+
args?: string[];
|
|
465
|
+
env?: Record<string, string>;
|
|
466
|
+
name: string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
interface AppConfigUVX {
|
|
470
|
+
packageName: string;
|
|
471
|
+
version: string;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
interface BinaryOsArchInfo {
|
|
475
|
+
binaryPath?: string;
|
|
476
|
+
contentType: BinContentType;
|
|
477
|
+
|
|
478
|
+
hash: string;
|
|
479
|
+
/** @default sha256 */
|
|
480
|
+
hashType?: BinHashType;
|
|
481
|
+
url: string;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
type BinContentType =
|
|
485
|
+
| "binary"
|
|
486
|
+
| "bz2"
|
|
487
|
+
| "gz"
|
|
488
|
+
| "tar"
|
|
489
|
+
| "tar.bz2"
|
|
490
|
+
| "tar.gz"
|
|
491
|
+
| "tar.xz"
|
|
492
|
+
| "tar.zst"
|
|
493
|
+
| "xz"
|
|
494
|
+
| "zip"
|
|
495
|
+
| "zst";
|
|
496
|
+
|
|
497
|
+
type BinHashType = "blake2b" | "md5" | "sha1" | "sha256" | "sha384" | "sha512";
|
|
498
|
+
|
|
499
|
+
type MapOfApps = Record<string, App>;
|
|
500
|
+
|
|
501
|
+
type MapOfBinaries = Partial<
|
|
502
|
+
Record<SysList.OsType, Partial<Record<SysList.ArchType, BinaryOsArchInfo>>>
|
|
503
|
+
>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Facts about the project environment
|
|
508
|
+
* Collected automatically on engine initialization
|
|
509
|
+
*/
|
|
510
|
+
interface Facts {
|
|
511
|
+
/**
|
|
512
|
+
* CPU architecture (amd64, arm64, aarch64)
|
|
513
|
+
*/
|
|
514
|
+
arch: SysList.ArchType;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Command to run this binary (can be overridden via --binary-command flag or DATAMITSU_BINARY_COMMAND env var)
|
|
518
|
+
* Useful for npm package wrappers that need to call the actual binary
|
|
519
|
+
*/
|
|
520
|
+
binaryCommand: string;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Absolute path to the currently running binary
|
|
524
|
+
*/
|
|
525
|
+
binaryPath: string;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Current working directory where the tool was invoked
|
|
529
|
+
*/
|
|
530
|
+
cwd: string;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Environment variables with the package prefix (e.g., CHANGE_ME_*)
|
|
534
|
+
* Only includes variables that start with the prefix defined in ldflags.EnvPrefix
|
|
535
|
+
* @example { "CHANGE_ME_DEBUG": "true", "CHANGE_ME_LOG_LEVEL": "info" }
|
|
536
|
+
*/
|
|
537
|
+
env: Record<string, string>;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Root directory of the git repository (handles submodules)
|
|
541
|
+
* Empty string if not in a git repository
|
|
542
|
+
*/
|
|
543
|
+
gitRoot: string;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Whether we're inside a git repository
|
|
547
|
+
*/
|
|
548
|
+
isInGitRepo: boolean;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Whether we're in a subdirectory of git root (potential monorepo)
|
|
552
|
+
*/
|
|
553
|
+
isMonorepo: boolean;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Operating system (darwin, linux, windows, freebsd, openbsd)
|
|
557
|
+
*/
|
|
558
|
+
os: SysList.OsType;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Package name from ldflags
|
|
562
|
+
*/
|
|
563
|
+
packageName: string;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Project root (same as gitRoot or cwd if not in git)
|
|
567
|
+
*/
|
|
568
|
+
projectRoot: string;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Function that returns Facts object
|
|
573
|
+
* Facts are collected once during engine initialization
|
|
574
|
+
*/
|
|
575
|
+
const facts: () => Facts;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* YAML parser and stringifier
|
|
579
|
+
*/
|
|
580
|
+
namespace YAML {
|
|
581
|
+
/**
|
|
582
|
+
* Parse YAML string to JavaScript object
|
|
583
|
+
* @param text - YAML string to parse
|
|
584
|
+
* @returns Parsed object
|
|
585
|
+
* @throws Error if YAML is invalid
|
|
586
|
+
*/
|
|
587
|
+
function parse(text: string): any;
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Convert JavaScript object to YAML string
|
|
591
|
+
* @param value - Object to stringify
|
|
592
|
+
* @returns YAML string
|
|
593
|
+
* @throws Error if object cannot be serialized
|
|
594
|
+
*/
|
|
595
|
+
function stringify(value: any): string;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* TOML parser and stringifier
|
|
600
|
+
*/
|
|
601
|
+
namespace TOML {
|
|
602
|
+
/**
|
|
603
|
+
* Parse TOML string to JavaScript object
|
|
604
|
+
* @param text - TOML string to parse
|
|
605
|
+
* @returns Parsed object
|
|
606
|
+
* @throws Error if TOML is invalid
|
|
607
|
+
*/
|
|
608
|
+
function parse(text: string): any;
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Convert JavaScript object to TOML string
|
|
612
|
+
* @param value - Object to stringify
|
|
613
|
+
* @returns TOML string
|
|
614
|
+
* @throws Error if object cannot be serialized
|
|
615
|
+
*/
|
|
616
|
+
function stringify(value: any): string;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* INI parser and stringifier
|
|
621
|
+
*/
|
|
622
|
+
namespace INI {
|
|
623
|
+
/**
|
|
624
|
+
* INI section structure
|
|
625
|
+
*/
|
|
626
|
+
type Section = Record<string, string>;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* INI section entry with name and properties
|
|
630
|
+
*/
|
|
631
|
+
interface SectionEntry {
|
|
632
|
+
name: string;
|
|
633
|
+
properties: Section;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Parse INI string to array of sections
|
|
638
|
+
* @param text - INI string to parse
|
|
639
|
+
* @returns Array of sections (preserves order and allows duplicate section names)
|
|
640
|
+
* @throws Error if INI is invalid
|
|
641
|
+
* @example
|
|
642
|
+
* const ini = INI.parse(`
|
|
643
|
+
* [database]
|
|
644
|
+
* host = localhost
|
|
645
|
+
* port = 5432
|
|
646
|
+
* [*.py]
|
|
647
|
+
* indent_size = 4
|
|
648
|
+
* [*.py]
|
|
649
|
+
* indent_size = 2
|
|
650
|
+
* `);
|
|
651
|
+
* // Returns: [
|
|
652
|
+
* // { name: "database", properties: { host: "localhost", port: "5432" } },
|
|
653
|
+
* // { name: "*.py", properties: { indent_size: "4" } },
|
|
654
|
+
* // { name: "*.py", properties: { indent_size: "2" } }
|
|
655
|
+
* // ]
|
|
656
|
+
*/
|
|
657
|
+
function parse(text: string): Array<SectionEntry>;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Convert array of sections to INI string
|
|
661
|
+
* @param sections - Array of section entries
|
|
662
|
+
* @returns INI string
|
|
663
|
+
* @throws Error if object cannot be serialized
|
|
664
|
+
* @example
|
|
665
|
+
* const sections = [
|
|
666
|
+
* { name: "database", properties: { host: "localhost", port: "5432" } },
|
|
667
|
+
* { name: "*.py", properties: { indent_size: "2" } }
|
|
668
|
+
* ];
|
|
669
|
+
* console.log(INI.stringify(sections));
|
|
670
|
+
*/
|
|
671
|
+
function stringify(sections: Array<SectionEntry>): string;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Convert array of sections to a record, merging sections with the same name
|
|
675
|
+
* @param sections - Array of section entries from INI.parse
|
|
676
|
+
* @returns Record mapping section names to their merged properties
|
|
677
|
+
* @example
|
|
678
|
+
* const sections = INI.parse(`
|
|
679
|
+
* [*.py]
|
|
680
|
+
* indent_size = 4
|
|
681
|
+
* [*.py]
|
|
682
|
+
* indent_size = 2
|
|
683
|
+
* `);
|
|
684
|
+
* const record = INI.toRecord(sections);
|
|
685
|
+
* // Returns: { "*.py": { indent_size: "2" } }
|
|
686
|
+
* // Later values override earlier ones for the same section name
|
|
687
|
+
*/
|
|
688
|
+
function toRecord(sections: Array<SectionEntry>): Record<string, Section>;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
export {};
|