@strapi/typescript-utils 5.50.1 → 5.50.2
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/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/models/attributes.d.ts +17 -0
- package/dist/generators/common/models/attributes.d.ts.map +1 -0
- package/dist/generators/common/models/attributes.js +152 -0
- package/dist/generators/common/models/attributes.js.map +1 -0
- package/dist/generators/common/models/attributes.mjs +124 -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 +7 -0
- package/dist/generators/common/models/schema.d.ts.map +1 -0
- package/dist/generators/common/models/schema.js +79 -0
- package/dist/generators/common/models/schema.js.map +1 -0
- package/dist/generators/common/models/schema.mjs +57 -0
- package/dist/generators/common/models/schema.mjs.map +1 -0
- package/dist/generators/common/models/utils.d.ts +54 -0
- package/dist/generators/common/models/utils.d.ts.map +1 -0
- package/dist/generators/common/models/utils.js +109 -0
- package/dist/generators/common/models/utils.js.map +1 -0
- package/dist/generators/common/models/utils.mjs +81 -0
- package/dist/generators/common/models/utils.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 +76 -0
- package/dist/generators/components/index.js.map +1 -0
- package/dist/generators/components/index.mjs +54 -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 +76 -0
- package/dist/generators/content-types/index.js.map +1 -0
- package/dist/generators/content-types/index.mjs +54 -0
- package/dist/generators/content-types/index.mjs.map +1 -0
- package/dist/generators/index.d.ts +23 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +81 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/index.mjs +74 -0
- package/dist/generators/index.mjs.map +1 -0
- package/dist/generators/utils.d.ts +52 -0
- package/dist/generators/utils.d.ts.map +1 -0
- package/dist/generators/utils.js +164 -0
- package/dist/generators/utils.js.map +1 -0
- package/dist/generators/utils.mjs +131 -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 +25 -10
- 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/__tests__/generators/utils.test.js +0 -43
- 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 -217
- 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,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": "5.50.
|
|
3
|
+
"version": "5.50.2",
|
|
4
4
|
"description": "Typescript support for Strapi",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -28,15 +28,24 @@
|
|
|
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",
|
|
@@ -47,7 +56,13 @@
|
|
|
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": "5.50.2",
|
|
64
|
+
"jest": "29.6.0",
|
|
65
|
+
"tsconfig": "5.50.2"
|
|
51
66
|
},
|
|
52
67
|
"engines": {
|
|
53
68
|
"node": ">=20.0.0 <=26.x.x",
|
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