@strapi/typescript-utils 0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282 → 0.0.0-experimental.63624e21eb5b0713345a0cf2f68f1c40eab427bc
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/dist/compile.d.ts +5 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +12 -0
- package/dist/compile.js.map +1 -0
- package/dist/compile.mjs +10 -0
- package/dist/compile.mjs.map +1 -0
- package/dist/compilers/basic.d.ts +11 -0
- package/dist/compilers/basic.d.ts.map +1 -0
- package/dist/compilers/basic.js +58 -0
- package/dist/compilers/basic.js.map +1 -0
- package/dist/compilers/basic.mjs +36 -0
- package/dist/compilers/basic.mjs.map +1 -0
- package/dist/compilers/index.d.ts +3 -0
- package/dist/compilers/index.d.ts.map +1 -0
- package/dist/compilers/index.js +8 -0
- package/dist/compilers/index.js.map +1 -0
- package/dist/compilers/index.mjs +3 -0
- package/dist/compilers/index.mjs.map +1 -0
- package/dist/generators/common/compare.d.ts +14 -0
- package/dist/generators/common/compare.d.ts.map +1 -0
- package/dist/generators/common/compare.js +25 -0
- package/dist/generators/common/compare.js.map +1 -0
- package/dist/generators/common/compare.mjs +22 -0
- package/dist/generators/common/compare.mjs.map +1 -0
- package/dist/generators/common/imports.d.ts +5 -0
- package/dist/generators/common/imports.d.ts.map +1 -0
- package/dist/generators/common/imports.js +42 -0
- package/dist/generators/common/imports.js.map +1 -0
- package/dist/generators/common/imports.mjs +19 -0
- package/dist/generators/common/imports.mjs.map +1 -0
- package/dist/generators/common/index.d.ts +4 -0
- package/dist/generators/common/index.d.ts.map +1 -0
- package/dist/generators/common/interface-names.d.ts +16 -0
- package/dist/generators/common/interface-names.d.ts.map +1 -0
- package/dist/generators/common/interface-names.js +54 -0
- package/dist/generators/common/interface-names.js.map +1 -0
- package/dist/generators/common/interface-names.mjs +52 -0
- package/dist/generators/common/interface-names.mjs.map +1 -0
- package/dist/generators/common/models/attributes.d.ts +38 -0
- package/dist/generators/common/models/attributes.d.ts.map +1 -0
- package/dist/generators/common/models/attributes.js +205 -0
- package/dist/generators/common/models/attributes.js.map +1 -0
- package/dist/generators/common/models/attributes.mjs +176 -0
- package/dist/generators/common/models/attributes.mjs.map +1 -0
- package/dist/generators/common/models/index.d.ts +7 -0
- package/dist/generators/common/models/index.d.ts.map +1 -0
- package/dist/generators/common/models/mappers.d.ts +9 -0
- package/dist/generators/common/models/mappers.d.ts.map +1 -0
- package/dist/generators/common/models/mappers.js +227 -0
- package/dist/generators/common/models/mappers.js.map +1 -0
- package/dist/generators/common/models/mappers.mjs +202 -0
- package/dist/generators/common/models/mappers.mjs.map +1 -0
- package/dist/generators/common/models/schema.d.ts +8 -0
- package/dist/generators/common/models/schema.d.ts.map +1 -0
- package/dist/generators/common/models/schema.js +78 -0
- package/dist/generators/common/models/schema.js.map +1 -0
- package/dist/generators/common/models/schema.mjs +56 -0
- package/dist/generators/common/models/schema.mjs.map +1 -0
- package/dist/generators/common/models/utils.d.ts +57 -0
- package/dist/generators/common/models/utils.d.ts.map +1 -0
- package/dist/generators/common/models/utils.js +110 -0
- package/dist/generators/common/models/utils.js.map +1 -0
- package/dist/generators/common/models/utils.mjs +82 -0
- package/dist/generators/common/models/utils.mjs.map +1 -0
- package/dist/generators/common/sources.d.ts +133 -0
- package/dist/generators/common/sources.d.ts.map +1 -0
- package/dist/generators/common/sources.js +354 -0
- package/dist/generators/common/sources.js.map +1 -0
- package/dist/generators/common/sources.mjs +318 -0
- package/dist/generators/common/sources.mjs.map +1 -0
- package/dist/generators/components/index.d.ts +9 -0
- package/dist/generators/components/index.d.ts.map +1 -0
- package/dist/generators/components/index.js +84 -0
- package/dist/generators/components/index.js.map +1 -0
- package/dist/generators/components/index.mjs +62 -0
- package/dist/generators/components/index.mjs.map +1 -0
- package/dist/generators/constants.d.ts +3 -0
- package/dist/generators/constants.d.ts.map +1 -0
- package/dist/generators/constants.js +8 -0
- package/dist/generators/constants.js.map +1 -0
- package/dist/generators/constants.mjs +5 -0
- package/dist/generators/constants.mjs.map +1 -0
- package/dist/generators/content-types/index.d.ts +9 -0
- package/dist/generators/content-types/index.d.ts.map +1 -0
- package/dist/generators/content-types/index.js +84 -0
- package/dist/generators/content-types/index.js.map +1 -0
- package/dist/generators/content-types/index.mjs +62 -0
- package/dist/generators/content-types/index.mjs.map +1 -0
- package/dist/generators/controllers/index.d.ts +35 -0
- package/dist/generators/controllers/index.d.ts.map +1 -0
- package/dist/generators/controllers/index.js +88 -0
- package/dist/generators/controllers/index.js.map +1 -0
- package/dist/generators/controllers/index.mjs +86 -0
- package/dist/generators/controllers/index.mjs.map +1 -0
- package/dist/generators/index.d.ts +31 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +150 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/index.mjs +142 -0
- package/dist/generators/index.mjs.map +1 -0
- package/dist/generators/middlewares/index.d.ts +30 -0
- package/dist/generators/middlewares/index.d.ts.map +1 -0
- package/dist/generators/middlewares/index.js +163 -0
- package/dist/generators/middlewares/index.js.map +1 -0
- package/dist/generators/middlewares/index.mjs +141 -0
- package/dist/generators/middlewares/index.mjs.map +1 -0
- package/dist/generators/plugins/index.d.ts +9 -0
- package/dist/generators/plugins/index.d.ts.map +1 -0
- package/dist/generators/plugins/index.js +225 -0
- package/dist/generators/plugins/index.js.map +1 -0
- package/dist/generators/plugins/index.mjs +200 -0
- package/dist/generators/plugins/index.mjs.map +1 -0
- package/dist/generators/policies/index.d.ts +29 -0
- package/dist/generators/policies/index.d.ts.map +1 -0
- package/dist/generators/policies/index.js +135 -0
- package/dist/generators/policies/index.js.map +1 -0
- package/dist/generators/policies/index.mjs +113 -0
- package/dist/generators/policies/index.mjs.map +1 -0
- package/dist/generators/services/index.d.ts +35 -0
- package/dist/generators/services/index.d.ts.map +1 -0
- package/dist/generators/services/index.js +87 -0
- package/dist/generators/services/index.js.map +1 -0
- package/dist/generators/services/index.mjs +85 -0
- package/dist/generators/services/index.mjs.map +1 -0
- package/dist/generators/strict/index.d.ts +13 -0
- package/dist/generators/strict/index.d.ts.map +1 -0
- package/dist/generators/strict/index.js +24 -0
- package/dist/generators/strict/index.js.map +1 -0
- package/dist/generators/strict/index.mjs +22 -0
- package/dist/generators/strict/index.mjs.map +1 -0
- package/dist/generators/utils.d.ts +68 -0
- package/dist/generators/utils.d.ts.map +1 -0
- package/dist/generators/utils.js +201 -0
- package/dist/generators/utils.js.map +1 -0
- package/dist/generators/utils.mjs +166 -0
- package/dist/generators/utils.mjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils/format-host.d.ts +3 -0
- package/dist/utils/format-host.d.ts.map +1 -0
- package/dist/utils/format-host.js +33 -0
- package/dist/utils/format-host.js.map +1 -0
- package/dist/utils/format-host.mjs +11 -0
- package/dist/utils/format-host.mjs.map +1 -0
- package/dist/utils/get-config-path.d.ts +10 -0
- package/dist/utils/get-config-path.d.ts.map +1 -0
- package/dist/utils/get-config-path.js +43 -0
- package/dist/utils/get-config-path.js.map +1 -0
- package/dist/utils/get-config-path.mjs +18 -0
- package/dist/utils/get-config-path.mjs.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/is-using-typescript-sync.d.ts +5 -0
- package/dist/utils/is-using-typescript-sync.d.ts.map +1 -0
- package/dist/utils/is-using-typescript-sync.js +20 -0
- package/dist/utils/is-using-typescript-sync.js.map +1 -0
- package/dist/utils/is-using-typescript-sync.mjs +14 -0
- package/dist/utils/is-using-typescript-sync.mjs.map +1 -0
- package/dist/utils/is-using-typescript.d.ts +5 -0
- package/dist/utils/is-using-typescript.d.ts.map +1 -0
- package/dist/utils/is-using-typescript.js +20 -0
- package/dist/utils/is-using-typescript.js.map +1 -0
- package/dist/utils/is-using-typescript.mjs +14 -0
- package/dist/utils/is-using-typescript.mjs.map +1 -0
- package/dist/utils/report-diagnostics.d.ts +6 -0
- package/dist/utils/report-diagnostics.d.ts.map +1 -0
- package/dist/utils/report-diagnostics.js +37 -0
- package/dist/utils/report-diagnostics.js.map +1 -0
- package/dist/utils/report-diagnostics.mjs +15 -0
- package/dist/utils/report-diagnostics.mjs.map +1 -0
- package/dist/utils/resolve-config-options.d.ts +12 -0
- package/dist/utils/resolve-config-options.d.ts.map +1 -0
- package/dist/utils/resolve-config-options.js +39 -0
- package/dist/utils/resolve-config-options.js.map +1 -0
- package/dist/utils/resolve-config-options.mjs +17 -0
- package/dist/utils/resolve-config-options.mjs.map +1 -0
- package/dist/utils/resolve-outdir-sync.d.ts +5 -0
- package/dist/utils/resolve-outdir-sync.d.ts.map +1 -0
- package/dist/utils/resolve-outdir-sync.js +19 -0
- package/dist/utils/resolve-outdir-sync.js.map +1 -0
- package/dist/utils/resolve-outdir-sync.mjs +13 -0
- package/dist/utils/resolve-outdir-sync.mjs.map +1 -0
- package/dist/utils/resolve-outdir.d.ts +5 -0
- package/dist/utils/resolve-outdir.d.ts.map +1 -0
- package/dist/utils/resolve-outdir.js +19 -0
- package/dist/utils/resolve-outdir.js.map +1 -0
- package/dist/utils/resolve-outdir.mjs +13 -0
- package/dist/utils/resolve-outdir.mjs.map +1 -0
- package/package.json +27 -12
- package/.eslintrc.cjs +0 -16
- package/index.d.ts +0 -5
- package/jest.config.js +0 -6
- package/lib/__tests__/generators/schemas/attributes.test.js +0 -903
- package/lib/__tests__/generators/schemas/imports.test.js +0 -56
- package/lib/__tests__/generators/schemas/utils.test.js +0 -314
- package/lib/compile.js +0 -10
- package/lib/compilers/basic.js +0 -50
- package/lib/compilers/index.js +0 -7
- package/lib/generators/common/imports.js +0 -34
- package/lib/generators/common/index.js +0 -9
- package/lib/generators/common/models/attributes.js +0 -198
- package/lib/generators/common/models/index.js +0 -15
- package/lib/generators/common/models/mappers.js +0 -144
- package/lib/generators/common/models/schema.js +0 -93
- package/lib/generators/common/models/utils.js +0 -178
- package/lib/generators/components/index.js +0 -74
- package/lib/generators/constants.js +0 -6
- package/lib/generators/content-types/index.js +0 -74
- package/lib/generators/index.js +0 -122
- package/lib/generators/utils.js +0 -216
- package/lib/index.js +0 -13
- package/lib/utils/format-host.js +0 -15
- package/lib/utils/get-config-path.js +0 -29
- package/lib/utils/index.js +0 -21
- package/lib/utils/is-using-typescript-sync.js +0 -19
- package/lib/utils/is-using-typescript.js +0 -17
- package/lib/utils/report-diagnostics.js +0 -19
- package/lib/utils/resolve-config-options.js +0 -23
- package/lib/utils/resolve-outdir-sync.js +0 -18
- package/lib/utils/resolve-outdir.js +0 -18
- package/lint-staged.config.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-config-path.d.ts","sourceRoot":"","sources":["../../src/utils/get-config-path.ts"],"names":[],"mappings":"AAKA,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,MAAM,EACX,gCAAoE,oBAAyB,KAC5F,MAAM,GAAG,SAWX,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var ts = require('typescript');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
27
|
+
var ts__namespace = /*#__PURE__*/_interopNamespace(ts);
|
|
28
|
+
|
|
29
|
+
const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
30
|
+
/**
|
|
31
|
+
* Get the path of the typescript config file for a given directory
|
|
32
|
+
*/ const getConfigPath = (dir, { filename = DEFAULT_TS_CONFIG_FILENAME, ancestorsLookup = false } = {})=>{
|
|
33
|
+
const dirAbsolutePath = path__default.default.resolve(dir);
|
|
34
|
+
let configFilePath = ts__namespace.findConfigFile(dirAbsolutePath, ts__namespace.sys.fileExists, filename);
|
|
35
|
+
if (configFilePath) configFilePath = path__default.default.resolve(configFilePath);
|
|
36
|
+
if (!configFilePath || ancestorsLookup) {
|
|
37
|
+
return configFilePath;
|
|
38
|
+
}
|
|
39
|
+
return configFilePath.startsWith(dirAbsolutePath) ? configFilePath : undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.getConfigPath = getConfigPath;
|
|
43
|
+
//# sourceMappingURL=get-config-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-config-path.js","sources":["../../src/utils/get-config-path.ts"],"sourcesContent":["import path from 'node:path';\nimport * as ts from 'typescript';\n\nconst DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';\n\ninterface GetConfigPathOptions {\n filename?: string;\n ancestorsLookup?: boolean;\n}\n\n/**\n * Get the path of the typescript config file for a given directory\n */\nexport const getConfigPath = (\n dir: string,\n { filename = DEFAULT_TS_CONFIG_FILENAME, ancestorsLookup = false }: GetConfigPathOptions = {}\n): string | undefined => {\n const dirAbsolutePath = path.resolve(dir);\n let configFilePath = ts.findConfigFile(dirAbsolutePath, ts.sys.fileExists, filename);\n\n if (configFilePath) configFilePath = path.resolve(configFilePath);\n\n if (!configFilePath || ancestorsLookup) {\n return configFilePath;\n }\n\n return configFilePath.startsWith(dirAbsolutePath) ? configFilePath : undefined;\n};\n"],"names":["DEFAULT_TS_CONFIG_FILENAME","getConfigPath","dir","filename","ancestorsLookup","dirAbsolutePath","path","resolve","configFilePath","ts","findConfigFile","sys","fileExists","startsWith","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMA,0BAAAA,GAA6B,eAAA;AAOnC;;AAEC,IACM,MAAMC,aAAAA,GAAgB,CAC3BC,KACA,EAAEC,QAAAA,GAAWH,0BAA0B,EAAEI,eAAAA,GAAkB,KAAK,EAAwB,GAAG,EAAE,GAAA;IAE7F,MAAMC,eAAAA,GAAkBC,qBAAAA,CAAKC,OAAO,CAACL,GAAAA,CAAAA;IACrC,IAAIM,cAAAA,GAAiBC,cAAGC,cAAc,CAACL,iBAAiBI,aAAAA,CAAGE,GAAG,CAACC,UAAU,EAAET,QAAAA,CAAAA;AAE3E,IAAA,IAAIK,cAAAA,EAAgBA,cAAAA,GAAiBF,qBAAAA,CAAKC,OAAO,CAACC,cAAAA,CAAAA;IAElD,IAAI,CAACA,kBAAkBJ,eAAAA,EAAiB;QACtC,OAAOI,cAAAA;AACT,IAAA;AAEA,IAAA,OAAOA,cAAAA,CAAeK,UAAU,CAACR,eAAAA,CAAAA,GAAmBG,cAAAA,GAAiBM,SAAAA;AACvE;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import * as ts from 'typescript';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
5
|
+
/**
|
|
6
|
+
* Get the path of the typescript config file for a given directory
|
|
7
|
+
*/ const getConfigPath = (dir, { filename = DEFAULT_TS_CONFIG_FILENAME, ancestorsLookup = false } = {})=>{
|
|
8
|
+
const dirAbsolutePath = path.resolve(dir);
|
|
9
|
+
let configFilePath = ts.findConfigFile(dirAbsolutePath, ts.sys.fileExists, filename);
|
|
10
|
+
if (configFilePath) configFilePath = path.resolve(configFilePath);
|
|
11
|
+
if (!configFilePath || ancestorsLookup) {
|
|
12
|
+
return configFilePath;
|
|
13
|
+
}
|
|
14
|
+
return configFilePath.startsWith(dirAbsolutePath) ? configFilePath : undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { getConfigPath };
|
|
18
|
+
//# sourceMappingURL=get-config-path.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-config-path.mjs","sources":["../../src/utils/get-config-path.ts"],"sourcesContent":["import path from 'node:path';\nimport * as ts from 'typescript';\n\nconst DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';\n\ninterface GetConfigPathOptions {\n filename?: string;\n ancestorsLookup?: boolean;\n}\n\n/**\n * Get the path of the typescript config file for a given directory\n */\nexport const getConfigPath = (\n dir: string,\n { filename = DEFAULT_TS_CONFIG_FILENAME, ancestorsLookup = false }: GetConfigPathOptions = {}\n): string | undefined => {\n const dirAbsolutePath = path.resolve(dir);\n let configFilePath = ts.findConfigFile(dirAbsolutePath, ts.sys.fileExists, filename);\n\n if (configFilePath) configFilePath = path.resolve(configFilePath);\n\n if (!configFilePath || ancestorsLookup) {\n return configFilePath;\n }\n\n return configFilePath.startsWith(dirAbsolutePath) ? configFilePath : undefined;\n};\n"],"names":["DEFAULT_TS_CONFIG_FILENAME","getConfigPath","dir","filename","ancestorsLookup","dirAbsolutePath","path","resolve","configFilePath","ts","findConfigFile","sys","fileExists","startsWith","undefined"],"mappings":";;;AAGA,MAAMA,0BAAAA,GAA6B,eAAA;AAOnC;;AAEC,IACM,MAAMC,aAAAA,GAAgB,CAC3BC,KACA,EAAEC,QAAAA,GAAWH,0BAA0B,EAAEI,eAAAA,GAAkB,KAAK,EAAwB,GAAG,EAAE,GAAA;IAE7F,MAAMC,eAAAA,GAAkBC,IAAAA,CAAKC,OAAO,CAACL,GAAAA,CAAAA;IACrC,IAAIM,cAAAA,GAAiBC,GAAGC,cAAc,CAACL,iBAAiBI,EAAAA,CAAGE,GAAG,CAACC,UAAU,EAAET,QAAAA,CAAAA;AAE3E,IAAA,IAAIK,cAAAA,EAAgBA,cAAAA,GAAiBF,IAAAA,CAAKC,OAAO,CAACC,cAAAA,CAAAA;IAElD,IAAI,CAACA,kBAAkBJ,eAAAA,EAAiB;QACtC,OAAOI,cAAAA;AACT,IAAA;AAEA,IAAA,OAAOA,cAAAA,CAAeK,UAAU,CAACR,eAAAA,CAAAA,GAAmBG,cAAAA,GAAiBM,SAAAA;AACvE;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { isUsingTypeScript } from './is-using-typescript';
|
|
2
|
+
export { isUsingTypeScriptSync } from './is-using-typescript-sync';
|
|
3
|
+
export { getConfigPath } from './get-config-path';
|
|
4
|
+
export { reportDiagnostics } from './report-diagnostics';
|
|
5
|
+
export { resolveConfigOptions } from './resolve-config-options';
|
|
6
|
+
export { formatHost } from './format-host';
|
|
7
|
+
export { resolveOutDir } from './resolve-outdir';
|
|
8
|
+
export { resolveOutDirSync } from './resolve-outdir-sync';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-using-typescript-sync.d.ts","sourceRoot":"","sources":["../../src/utils/is-using-typescript-sync.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,EACX,WAAU,MAAM,GAAG,SAAqB,KACvC,OAIF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fse = require('fs-extra');
|
|
4
|
+
var getConfigPath = require('./get-config-path.js');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var fse__default = /*#__PURE__*/_interopDefault(fse);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)
|
|
12
|
+
*/ const isUsingTypeScriptSync = (dir, filename = undefined)=>{
|
|
13
|
+
const filePath = getConfigPath.getConfigPath(dir, {
|
|
14
|
+
filename
|
|
15
|
+
});
|
|
16
|
+
return filePath ? fse__default.default.pathExistsSync(filePath) : false;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.isUsingTypeScriptSync = isUsingTypeScriptSync;
|
|
20
|
+
//# sourceMappingURL=is-using-typescript-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-using-typescript-sync.js","sources":["../../src/utils/is-using-typescript-sync.ts"],"sourcesContent":["import fse from 'fs-extra';\n\nimport { getConfigPath } from './get-config-path';\n\n/**\n * Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)\n */\nexport const isUsingTypeScriptSync = (\n dir: string,\n filename: string | undefined = undefined\n): boolean => {\n const filePath = getConfigPath(dir, { filename });\n\n return filePath ? fse.pathExistsSync(filePath) : false;\n};\n"],"names":["isUsingTypeScriptSync","dir","filename","undefined","filePath","getConfigPath","fse","pathExistsSync"],"mappings":";;;;;;;;;AAIA;;AAEC,IACM,MAAMA,qBAAAA,GAAwB,CACnCC,GAAAA,EACAC,WAA+BC,SAAS,GAAA;IAExC,MAAMC,QAAAA,GAAWC,4BAAcJ,GAAAA,EAAK;AAAEC,QAAAA;AAAS,KAAA,CAAA;AAE/C,IAAA,OAAOE,QAAAA,GAAWE,oBAAAA,CAAIC,cAAc,CAACH,QAAAA,CAAAA,GAAY,KAAA;AACnD;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import fse from 'fs-extra';
|
|
2
|
+
import { getConfigPath } from './get-config-path.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)
|
|
6
|
+
*/ const isUsingTypeScriptSync = (dir, filename = undefined)=>{
|
|
7
|
+
const filePath = getConfigPath(dir, {
|
|
8
|
+
filename
|
|
9
|
+
});
|
|
10
|
+
return filePath ? fse.pathExistsSync(filePath) : false;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { isUsingTypeScriptSync };
|
|
14
|
+
//# sourceMappingURL=is-using-typescript-sync.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-using-typescript-sync.mjs","sources":["../../src/utils/is-using-typescript-sync.ts"],"sourcesContent":["import fse from 'fs-extra';\n\nimport { getConfigPath } from './get-config-path';\n\n/**\n * Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)\n */\nexport const isUsingTypeScriptSync = (\n dir: string,\n filename: string | undefined = undefined\n): boolean => {\n const filePath = getConfigPath(dir, { filename });\n\n return filePath ? fse.pathExistsSync(filePath) : false;\n};\n"],"names":["isUsingTypeScriptSync","dir","filename","undefined","filePath","getConfigPath","fse","pathExistsSync"],"mappings":";;;AAIA;;AAEC,IACM,MAAMA,qBAAAA,GAAwB,CACnCC,GAAAA,EACAC,WAA+BC,SAAS,GAAA;IAExC,MAAMC,QAAAA,GAAWC,cAAcJ,GAAAA,EAAK;AAAEC,QAAAA;AAAS,KAAA,CAAA;AAE/C,IAAA,OAAOE,QAAAA,GAAWE,GAAAA,CAAIC,cAAc,CAACH,QAAAA,CAAAA,GAAY,KAAA;AACnD;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-using-typescript.d.ts","sourceRoot":"","sources":["../../src/utils/is-using-typescript.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EACX,WAAU,MAAM,GAAG,SAAqB,KACvC,OAAO,CAAC,OAAO,CAIjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fse = require('fs-extra');
|
|
4
|
+
var getConfigPath = require('./get-config-path.js');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var fse__default = /*#__PURE__*/_interopDefault(fse);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)
|
|
12
|
+
*/ const isUsingTypeScript = (dir, filename = undefined)=>{
|
|
13
|
+
const filePath = getConfigPath.getConfigPath(dir, {
|
|
14
|
+
filename
|
|
15
|
+
});
|
|
16
|
+
return fse__default.default.pathExists(filePath);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.isUsingTypeScript = isUsingTypeScript;
|
|
20
|
+
//# sourceMappingURL=is-using-typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-using-typescript.js","sources":["../../src/utils/is-using-typescript.ts"],"sourcesContent":["import fse from 'fs-extra';\n\nimport { getConfigPath } from './get-config-path';\n\n/**\n * Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)\n */\nexport const isUsingTypeScript = (\n dir: string,\n filename: string | undefined = undefined\n): Promise<boolean> => {\n const filePath = getConfigPath(dir, { filename });\n\n return fse.pathExists(filePath as string);\n};\n"],"names":["isUsingTypeScript","dir","filename","undefined","filePath","getConfigPath","fse","pathExists"],"mappings":";;;;;;;;;AAIA;;AAEC,IACM,MAAMA,iBAAAA,GAAoB,CAC/BC,GAAAA,EACAC,WAA+BC,SAAS,GAAA;IAExC,MAAMC,QAAAA,GAAWC,4BAAcJ,GAAAA,EAAK;AAAEC,QAAAA;AAAS,KAAA,CAAA;IAE/C,OAAOI,oBAAAA,CAAIC,UAAU,CAACH,QAAAA,CAAAA;AACxB;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import fse from 'fs-extra';
|
|
2
|
+
import { getConfigPath } from './get-config-path.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)
|
|
6
|
+
*/ const isUsingTypeScript = (dir, filename = undefined)=>{
|
|
7
|
+
const filePath = getConfigPath(dir, {
|
|
8
|
+
filename
|
|
9
|
+
});
|
|
10
|
+
return fse.pathExists(filePath);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { isUsingTypeScript };
|
|
14
|
+
//# sourceMappingURL=is-using-typescript.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-using-typescript.mjs","sources":["../../src/utils/is-using-typescript.ts"],"sourcesContent":["import fse from 'fs-extra';\n\nimport { getConfigPath } from './get-config-path';\n\n/**\n * Checks if `dir` is a using TypeScript (whether there is a tsconfig file or not)\n */\nexport const isUsingTypeScript = (\n dir: string,\n filename: string | undefined = undefined\n): Promise<boolean> => {\n const filePath = getConfigPath(dir, { filename });\n\n return fse.pathExists(filePath as string);\n};\n"],"names":["isUsingTypeScript","dir","filename","undefined","filePath","getConfigPath","fse","pathExists"],"mappings":";;;AAIA;;AAEC,IACM,MAAMA,iBAAAA,GAAoB,CAC/BC,GAAAA,EACAC,WAA+BC,SAAS,GAAA;IAExC,MAAMC,QAAAA,GAAWC,cAAcJ,GAAAA,EAAK;AAAEC,QAAAA;AAAS,KAAA,CAAA;IAE/C,OAAOI,GAAAA,CAAIC,UAAU,CAACH,QAAAA,CAAAA;AACxB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-diagnostics.d.ts","sourceRoot":"","sources":["../../src/utils/report-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,SAAS,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,KAAG,IAQzF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ts = require('typescript');
|
|
4
|
+
var formatHost = require('./format-host.js');
|
|
5
|
+
|
|
6
|
+
function _interopNamespace(e) {
|
|
7
|
+
if (e && e.__esModule) return e;
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var ts__namespace = /*#__PURE__*/_interopNamespace(ts);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Report one or several diagnostic to the console
|
|
28
|
+
*/ const reportDiagnostics = (diagnostics)=>{
|
|
29
|
+
const formattedDiagnostics = ts__namespace.formatDiagnosticsWithColorAndContext(Array.isArray(diagnostics) ? diagnostics : [
|
|
30
|
+
diagnostics
|
|
31
|
+
], formatHost.formatHost);
|
|
32
|
+
console.error(formattedDiagnostics);
|
|
33
|
+
console.info(`Found ${diagnostics.length} error(s).${ts__namespace.sys.newLine}`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.reportDiagnostics = reportDiagnostics;
|
|
37
|
+
//# sourceMappingURL=report-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-diagnostics.js","sources":["../../src/utils/report-diagnostics.ts"],"sourcesContent":["import * as ts from 'typescript';\n\nimport { formatHost } from './format-host';\n\n/**\n * Report one or several diagnostic to the console\n */\nexport const reportDiagnostics = (diagnostics: readonly ts.Diagnostic[] | ts.Diagnostic): void => {\n const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(\n Array.isArray(diagnostics) ? diagnostics : [diagnostics],\n formatHost\n );\n\n console.error(formattedDiagnostics);\n console.info(`Found ${(diagnostics as ts.Diagnostic[]).length} error(s).${ts.sys.newLine}`);\n};\n"],"names":["reportDiagnostics","diagnostics","formattedDiagnostics","ts","formatDiagnosticsWithColorAndContext","Array","isArray","formatHost","console","error","info","length","sys","newLine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,WAAAA,GAAAA;IAChC,MAAMC,oBAAAA,GAAuBC,cAAGC,oCAAoC,CAClEC,MAAMC,OAAO,CAACL,eAAeA,WAAAA,GAAc;AAACA,QAAAA;KAAY,EACxDM,qBAAAA,CAAAA;AAGFC,IAAAA,OAAAA,CAAQC,KAAK,CAACP,oBAAAA,CAAAA;AACdM,IAAAA,OAAAA,CAAQE,IAAI,CAAC,CAAC,MAAM,EAAE,WAACT,CAAgCU,MAAM,CAAC,UAAU,EAAER,aAAAA,CAAGS,GAAG,CAACC,OAAO,CAAA,CAAE,CAAA;AAC5F;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
import { formatHost } from './format-host.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Report one or several diagnostic to the console
|
|
6
|
+
*/ const reportDiagnostics = (diagnostics)=>{
|
|
7
|
+
const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(Array.isArray(diagnostics) ? diagnostics : [
|
|
8
|
+
diagnostics
|
|
9
|
+
], formatHost);
|
|
10
|
+
console.error(formattedDiagnostics);
|
|
11
|
+
console.info(`Found ${diagnostics.length} error(s).${ts.sys.newLine}`);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { reportDiagnostics };
|
|
15
|
+
//# sourceMappingURL=report-diagnostics.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-diagnostics.mjs","sources":["../../src/utils/report-diagnostics.ts"],"sourcesContent":["import * as ts from 'typescript';\n\nimport { formatHost } from './format-host';\n\n/**\n * Report one or several diagnostic to the console\n */\nexport const reportDiagnostics = (diagnostics: readonly ts.Diagnostic[] | ts.Diagnostic): void => {\n const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(\n Array.isArray(diagnostics) ? diagnostics : [diagnostics],\n formatHost\n );\n\n console.error(formattedDiagnostics);\n console.info(`Found ${(diagnostics as ts.Diagnostic[]).length} error(s).${ts.sys.newLine}`);\n};\n"],"names":["reportDiagnostics","diagnostics","formattedDiagnostics","ts","formatDiagnosticsWithColorAndContext","Array","isArray","formatHost","console","error","info","length","sys","newLine"],"mappings":";;;AAIA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,WAAAA,GAAAA;IAChC,MAAMC,oBAAAA,GAAuBC,GAAGC,oCAAoC,CAClEC,MAAMC,OAAO,CAACL,eAAeA,WAAAA,GAAc;AAACA,QAAAA;KAAY,EACxDM,UAAAA,CAAAA;AAGFC,IAAAA,OAAAA,CAAQC,KAAK,CAACP,oBAAAA,CAAAA;AACdM,IAAAA,OAAAA,CAAQE,IAAI,CAAC,CAAC,MAAM,EAAE,WAACT,CAAgCU,MAAM,CAAC,UAAU,EAAER,EAAAA,CAAGS,GAAG,CAACC,OAAO,CAAA,CAAE,CAAA;AAC5F;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
export declare const resolveConfigOptions: (configPath: string) => {
|
|
3
|
+
options: ts.CompilerOptions;
|
|
4
|
+
typeAcquisition?: ts.TypeAcquisition;
|
|
5
|
+
fileNames: string[];
|
|
6
|
+
projectReferences?: readonly ts.ProjectReference[];
|
|
7
|
+
watchOptions?: ts.WatchOptions;
|
|
8
|
+
raw?: any;
|
|
9
|
+
wildcardDirectories?: ts.MapLike<ts.WatchDirectoryFlags>;
|
|
10
|
+
compileOnSave?: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=resolve-config-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-config-options.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-config-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,eAAO,MAAM,oBAAoB,GAAI,YAAY,MAAM;;;;;;;;;CAgBtD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ts = require('typescript');
|
|
4
|
+
var reportDiagnostics = require('./report-diagnostics.js');
|
|
5
|
+
|
|
6
|
+
function _interopNamespace(e) {
|
|
7
|
+
if (e && e.__esModule) return e;
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var ts__namespace = /*#__PURE__*/_interopNamespace(ts);
|
|
25
|
+
|
|
26
|
+
const resolveConfigOptions = (configPath)=>{
|
|
27
|
+
// Parse the tsconfig.json file and resolve every file name & compiler options
|
|
28
|
+
const { errors, ...configOptions } = ts__namespace.getParsedCommandLineOfConfigFile(configPath, undefined, ts__namespace.sys);
|
|
29
|
+
// If there are errors in the tsconfig.json
|
|
30
|
+
// file, report them and exit early
|
|
31
|
+
if (errors.length > 0) {
|
|
32
|
+
reportDiagnostics.reportDiagnostics(errors);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
return configOptions;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.resolveConfigOptions = resolveConfigOptions;
|
|
39
|
+
//# sourceMappingURL=resolve-config-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-config-options.js","sources":["../../src/utils/resolve-config-options.ts"],"sourcesContent":["import * as ts from 'typescript';\n\nimport { reportDiagnostics } from './report-diagnostics';\n\nexport const resolveConfigOptions = (configPath: string) => {\n // Parse the tsconfig.json file and resolve every file name & compiler options\n const { errors, ...configOptions } = ts.getParsedCommandLineOfConfigFile(\n configPath,\n undefined,\n ts.sys as unknown as ts.ParseConfigFileHost\n )!;\n\n // If there are errors in the tsconfig.json\n // file, report them and exit early\n if (errors.length > 0) {\n reportDiagnostics(errors);\n process.exit(1);\n }\n\n return configOptions;\n};\n"],"names":["resolveConfigOptions","configPath","errors","configOptions","ts","getParsedCommandLineOfConfigFile","undefined","sys","length","reportDiagnostics","process","exit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAMA,uBAAuB,CAACC,UAAAA,GAAAA;;AAEnC,IAAA,MAAM,EAAEC,MAAM,EAAE,GAAGC,aAAAA,EAAe,GAAGC,aAAAA,CAAGC,gCAAgC,CACtEJ,UAAAA,EACAK,SAAAA,EACAF,aAAAA,CAAGG,GAAG,CAAA;;;IAKR,IAAIL,MAAAA,CAAOM,MAAM,GAAG,CAAA,EAAG;QACrBC,mCAAAA,CAAkBP,MAAAA,CAAAA;AAClBQ,QAAAA,OAAAA,CAAQC,IAAI,CAAC,CAAA,CAAA;AACf,IAAA;IAEA,OAAOR,aAAAA;AACT;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
import { reportDiagnostics } from './report-diagnostics.mjs';
|
|
3
|
+
|
|
4
|
+
const resolveConfigOptions = (configPath)=>{
|
|
5
|
+
// Parse the tsconfig.json file and resolve every file name & compiler options
|
|
6
|
+
const { errors, ...configOptions } = ts.getParsedCommandLineOfConfigFile(configPath, undefined, ts.sys);
|
|
7
|
+
// If there are errors in the tsconfig.json
|
|
8
|
+
// file, report them and exit early
|
|
9
|
+
if (errors.length > 0) {
|
|
10
|
+
reportDiagnostics(errors);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
return configOptions;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { resolveConfigOptions };
|
|
17
|
+
//# sourceMappingURL=resolve-config-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-config-options.mjs","sources":["../../src/utils/resolve-config-options.ts"],"sourcesContent":["import * as ts from 'typescript';\n\nimport { reportDiagnostics } from './report-diagnostics';\n\nexport const resolveConfigOptions = (configPath: string) => {\n // Parse the tsconfig.json file and resolve every file name & compiler options\n const { errors, ...configOptions } = ts.getParsedCommandLineOfConfigFile(\n configPath,\n undefined,\n ts.sys as unknown as ts.ParseConfigFileHost\n )!;\n\n // If there are errors in the tsconfig.json\n // file, report them and exit early\n if (errors.length > 0) {\n reportDiagnostics(errors);\n process.exit(1);\n }\n\n return configOptions;\n};\n"],"names":["resolveConfigOptions","configPath","errors","configOptions","ts","getParsedCommandLineOfConfigFile","undefined","sys","length","reportDiagnostics","process","exit"],"mappings":";;;AAIO,MAAMA,uBAAuB,CAACC,UAAAA,GAAAA;;AAEnC,IAAA,MAAM,EAAEC,MAAM,EAAE,GAAGC,aAAAA,EAAe,GAAGC,EAAAA,CAAGC,gCAAgC,CACtEJ,UAAAA,EACAK,SAAAA,EACAF,EAAAA,CAAGG,GAAG,CAAA;;;IAKR,IAAIL,MAAAA,CAAOM,MAAM,GAAG,CAAA,EAAG;QACrBC,iBAAAA,CAAkBP,MAAAA,CAAAA;AAClBQ,QAAAA,OAAAA,CAAQC,IAAI,CAAC,CAAA,CAAA;AACf,IAAA;IAEA,OAAOR,aAAAA;AACT;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-outdir-sync.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-outdir-sync.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EACX,iBAAgB,MAAmC,KAClD,MAAM,GAAG,SAIX,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var resolveConfigOptions = require('./resolve-config-options.js');
|
|
5
|
+
var isUsingTypescriptSync = require('./is-using-typescript-sync.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
10
|
+
|
|
11
|
+
const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
12
|
+
/**
|
|
13
|
+
* Gets the outDir value from config file (tsconfig)
|
|
14
|
+
*/ const resolveOutDirSync = (dir, configFilename = DEFAULT_TS_CONFIG_FILENAME)=>{
|
|
15
|
+
return isUsingTypescriptSync.isUsingTypeScriptSync(dir) ? resolveConfigOptions.resolveConfigOptions(path__default.default.join(dir, configFilename)).options.outDir : undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.resolveOutDirSync = resolveOutDirSync;
|
|
19
|
+
//# sourceMappingURL=resolve-outdir-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-outdir-sync.js","sources":["../../src/utils/resolve-outdir-sync.ts"],"sourcesContent":["import path from 'node:path';\nimport { resolveConfigOptions } from './resolve-config-options';\nimport { isUsingTypeScriptSync } from './is-using-typescript-sync';\n\nconst DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';\n/**\n * Gets the outDir value from config file (tsconfig)\n */\nexport const resolveOutDirSync = (\n dir: string,\n configFilename: string = DEFAULT_TS_CONFIG_FILENAME\n): string | undefined => {\n return isUsingTypeScriptSync(dir)\n ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir\n : undefined;\n};\n"],"names":["DEFAULT_TS_CONFIG_FILENAME","resolveOutDirSync","dir","configFilename","isUsingTypeScriptSync","resolveConfigOptions","path","join","options","outDir","undefined"],"mappings":";;;;;;;;;;AAIA,MAAMA,0BAAAA,GAA6B,eAAA;AACnC;;AAEC,IACM,MAAMC,iBAAAA,GAAoB,CAC/BC,GAAAA,EACAC,iBAAyBH,0BAA0B,GAAA;IAEnD,OAAOI,2CAAAA,CAAsBF,GAAAA,CAAAA,GACzBG,yCAAAA,CAAqBC,qBAAAA,CAAKC,IAAI,CAACL,GAAAA,EAAKC,cAAAA,CAAAA,CAAAA,CAAiBK,OAAO,CAACC,MAAM,GACnEC,SAAAA;AACN;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { resolveConfigOptions } from './resolve-config-options.mjs';
|
|
3
|
+
import { isUsingTypeScriptSync } from './is-using-typescript-sync.mjs';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
6
|
+
/**
|
|
7
|
+
* Gets the outDir value from config file (tsconfig)
|
|
8
|
+
*/ const resolveOutDirSync = (dir, configFilename = DEFAULT_TS_CONFIG_FILENAME)=>{
|
|
9
|
+
return isUsingTypeScriptSync(dir) ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir : undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { resolveOutDirSync };
|
|
13
|
+
//# sourceMappingURL=resolve-outdir-sync.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-outdir-sync.mjs","sources":["../../src/utils/resolve-outdir-sync.ts"],"sourcesContent":["import path from 'node:path';\nimport { resolveConfigOptions } from './resolve-config-options';\nimport { isUsingTypeScriptSync } from './is-using-typescript-sync';\n\nconst DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';\n/**\n * Gets the outDir value from config file (tsconfig)\n */\nexport const resolveOutDirSync = (\n dir: string,\n configFilename: string = DEFAULT_TS_CONFIG_FILENAME\n): string | undefined => {\n return isUsingTypeScriptSync(dir)\n ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir\n : undefined;\n};\n"],"names":["DEFAULT_TS_CONFIG_FILENAME","resolveOutDirSync","dir","configFilename","isUsingTypeScriptSync","resolveConfigOptions","path","join","options","outDir","undefined"],"mappings":";;;;AAIA,MAAMA,0BAAAA,GAA6B,eAAA;AACnC;;AAEC,IACM,MAAMC,iBAAAA,GAAoB,CAC/BC,GAAAA,EACAC,iBAAyBH,0BAA0B,GAAA;IAEnD,OAAOI,qBAAAA,CAAsBF,GAAAA,CAAAA,GACzBG,oBAAAA,CAAqBC,IAAAA,CAAKC,IAAI,CAACL,GAAAA,EAAKC,cAAAA,CAAAA,CAAAA,CAAiBK,OAAO,CAACC,MAAM,GACnEC,SAAAA;AACN;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-outdir.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-outdir.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,MAAM,EACX,iBAAgB,MAAmC,KAClD,OAAO,CAAC,MAAM,GAAG,SAAS,CAI5B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var resolveConfigOptions = require('./resolve-config-options.js');
|
|
5
|
+
var isUsingTypescript = require('./is-using-typescript.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
10
|
+
|
|
11
|
+
const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
12
|
+
/**
|
|
13
|
+
* Gets the outDir value from config file (tsconfig)
|
|
14
|
+
*/ const resolveOutDir = async (dir, configFilename = DEFAULT_TS_CONFIG_FILENAME)=>{
|
|
15
|
+
return await isUsingTypescript.isUsingTypeScript(dir) ? resolveConfigOptions.resolveConfigOptions(path__default.default.join(dir, configFilename)).options.outDir : undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.resolveOutDir = resolveOutDir;
|
|
19
|
+
//# sourceMappingURL=resolve-outdir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-outdir.js","sources":["../../src/utils/resolve-outdir.ts"],"sourcesContent":["import path from 'node:path';\nimport { resolveConfigOptions } from './resolve-config-options';\nimport { isUsingTypeScript } from './is-using-typescript';\n\nconst DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';\n/**\n * Gets the outDir value from config file (tsconfig)\n */\nexport const resolveOutDir = async (\n dir: string,\n configFilename: string = DEFAULT_TS_CONFIG_FILENAME\n): Promise<string | undefined> => {\n return (await isUsingTypeScript(dir))\n ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir\n : undefined;\n};\n"],"names":["DEFAULT_TS_CONFIG_FILENAME","resolveOutDir","dir","configFilename","isUsingTypeScript","resolveConfigOptions","path","join","options","outDir","undefined"],"mappings":";;;;;;;;;;AAIA,MAAMA,0BAAAA,GAA6B,eAAA;AACnC;;AAEC,IACM,MAAMC,aAAAA,GAAgB,OAC3BC,GAAAA,EACAC,iBAAyBH,0BAA0B,GAAA;AAEnD,IAAA,OAAO,MAAOI,mCAAAA,CAAkBF,GAAAA,CAAAA,GAC5BG,yCAAAA,CAAqBC,qBAAAA,CAAKC,IAAI,CAACL,GAAAA,EAAKC,cAAAA,CAAAA,CAAAA,CAAiBK,OAAO,CAACC,MAAM,GACnEC,SAAAA;AACN;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { resolveConfigOptions } from './resolve-config-options.mjs';
|
|
3
|
+
import { isUsingTypeScript } from './is-using-typescript.mjs';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';
|
|
6
|
+
/**
|
|
7
|
+
* Gets the outDir value from config file (tsconfig)
|
|
8
|
+
*/ const resolveOutDir = async (dir, configFilename = DEFAULT_TS_CONFIG_FILENAME)=>{
|
|
9
|
+
return await isUsingTypeScript(dir) ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir : undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { resolveOutDir };
|
|
13
|
+
//# sourceMappingURL=resolve-outdir.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-outdir.mjs","sources":["../../src/utils/resolve-outdir.ts"],"sourcesContent":["import path from 'node:path';\nimport { resolveConfigOptions } from './resolve-config-options';\nimport { isUsingTypeScript } from './is-using-typescript';\n\nconst DEFAULT_TS_CONFIG_FILENAME = 'tsconfig.json';\n/**\n * Gets the outDir value from config file (tsconfig)\n */\nexport const resolveOutDir = async (\n dir: string,\n configFilename: string = DEFAULT_TS_CONFIG_FILENAME\n): Promise<string | undefined> => {\n return (await isUsingTypeScript(dir))\n ? resolveConfigOptions(path.join(dir, configFilename)).options.outDir\n : undefined;\n};\n"],"names":["DEFAULT_TS_CONFIG_FILENAME","resolveOutDir","dir","configFilename","isUsingTypeScript","resolveConfigOptions","path","join","options","outDir","undefined"],"mappings":";;;;AAIA,MAAMA,0BAAAA,GAA6B,eAAA;AACnC;;AAEC,IACM,MAAMC,aAAAA,GAAgB,OAC3BC,GAAAA,EACAC,iBAAyBH,0BAA0B,GAAA;AAEnD,IAAA,OAAO,MAAOI,iBAAAA,CAAkBF,GAAAA,CAAAA,GAC5BG,oBAAAA,CAAqBC,IAAAA,CAAKC,IAAI,CAACL,GAAAA,EAAKC,cAAAA,CAAAA,CAAAA,CAAiBK,OAAO,CAACC,MAAM,GACnEC,SAAAA;AACN;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/typescript-utils",
|
|
3
|
-
"version": "0.0.0-experimental.
|
|
3
|
+
"version": "0.0.0-experimental.63624e21eb5b0713345a0cf2f68f1c40eab427bc",
|
|
4
4
|
"description": "Typescript support for Strapi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -28,29 +28,44 @@
|
|
|
28
28
|
"url": "https://strapi.io"
|
|
29
29
|
}
|
|
30
30
|
],
|
|
31
|
-
"main": "./
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"module": "./dist/index.mjs",
|
|
33
|
+
"source": "./src/index.ts",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/",
|
|
37
|
+
"tsconfigs/"
|
|
38
|
+
],
|
|
36
39
|
"scripts": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
+
"build": "run -T npm-run-all clean --parallel build:code build:types",
|
|
41
|
+
"build:code": "run -T rollup -c",
|
|
42
|
+
"build:types": "run -T tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
43
|
+
"clean": "run -T rimraf dist",
|
|
44
|
+
"lint": "run -T eslint . --max-warnings=0",
|
|
45
|
+
"test:ts": "run -T tsc --noEmit",
|
|
46
|
+
"test:unit": "run -T jest",
|
|
47
|
+
"test:unit:watch": "run -T jest --watch",
|
|
48
|
+
"watch": "run -T rollup -c -w"
|
|
40
49
|
},
|
|
41
50
|
"dependencies": {
|
|
42
51
|
"chalk": "4.1.2",
|
|
43
52
|
"cli-table3": "0.6.5",
|
|
44
53
|
"fs-extra": "11.3.4",
|
|
45
54
|
"lodash": "4.18.1",
|
|
46
|
-
"prettier": "3.
|
|
55
|
+
"prettier": "3.9.9",
|
|
47
56
|
"typescript": "5.9.3"
|
|
48
57
|
},
|
|
49
58
|
"devDependencies": {
|
|
50
|
-
"@types/fs-extra": "11.0.4"
|
|
59
|
+
"@types/fs-extra": "11.0.4",
|
|
60
|
+
"@types/jest": "29.5.2",
|
|
61
|
+
"@types/lodash": "^4.14.191",
|
|
62
|
+
"@types/node": "20.19.41",
|
|
63
|
+
"eslint-config-custom": "0.0.0-experimental.63624e21eb5b0713345a0cf2f68f1c40eab427bc",
|
|
64
|
+
"jest": "29.6.0",
|
|
65
|
+
"tsconfig": "0.0.0-experimental.63624e21eb5b0713345a0cf2f68f1c40eab427bc"
|
|
51
66
|
},
|
|
52
67
|
"engines": {
|
|
53
|
-
"node": ">=20.
|
|
68
|
+
"node": ">=20.0.0 <=26.x.x",
|
|
54
69
|
"npm": ">=6.0.0"
|
|
55
70
|
}
|
|
56
71
|
}
|
package/.eslintrc.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
/** @type {import('eslint').Linter.Config} */
|
|
4
|
-
const config = {
|
|
5
|
-
root: true,
|
|
6
|
-
extends: ['eslint-config-custom/back'],
|
|
7
|
-
ignorePatterns: [
|
|
8
|
-
'node_modules/',
|
|
9
|
-
'.eslintrc.cjs',
|
|
10
|
-
'index.d.ts',
|
|
11
|
-
'coverage/',
|
|
12
|
-
'lint-staged.config.mjs',
|
|
13
|
-
],
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
module.exports = config;
|
package/index.d.ts
DELETED