@strapi/typescript-utils 0.0.0-next.f5107c72369ee86a8ec1b6782f2e890925033ca3 → 0.0.0-next.f6dca5adf05ef6bed9605a1535999ab0bbbf063e
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/LICENSE +18 -3
- package/lib/__tests__/generators/schemas/attributes.test.js +268 -118
- package/lib/__tests__/generators/schemas/utils.test.js +3 -3
- package/lib/compile.js +2 -6
- package/lib/compilers/basic.js +12 -4
- package/lib/compilers/index.js +0 -2
- package/lib/generators/common/imports.js +3 -3
- package/lib/generators/common/models/attributes.js +35 -10
- package/lib/generators/common/models/mappers.js +35 -22
- package/lib/generators/common/models/schema.js +7 -5
- package/lib/generators/common/models/utils.js +7 -7
- package/lib/generators/components/index.js +21 -5
- package/lib/generators/content-types/index.js +21 -5
- package/lib/generators/index.js +1 -1
- package/lib/generators/utils.js +8 -3
- package/lib/index.js +0 -3
- package/package.json +15 -7
- package/tsconfigs/admin.json +18 -19
- package/tsconfigs/server.json +18 -16
- package/lib/admin/create-tsconfig-file.js +0 -37
- package/lib/admin/index.js +0 -5
- package/lib/compilers/watch.js +0 -37
package/lib/compilers/watch.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const ts = require('typescript');
|
|
4
|
-
|
|
5
|
-
const reportDiagnostics = require('../utils/report-diagnostics');
|
|
6
|
-
const formatHost = require('../utils/format-host');
|
|
7
|
-
const resolveConfigOptions = require('../utils/resolve-config-options');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Prints a diagnostic every time the watch status changes.
|
|
11
|
-
* This is mainly for messages like "Starting compilation" or "Compilation completed".
|
|
12
|
-
*/
|
|
13
|
-
const reportWatchStatusChanged = (diagnostic) => {
|
|
14
|
-
console.info(ts.formatDiagnostic(diagnostic, formatHost));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
run(configPath) {
|
|
19
|
-
const createProgram = ts.createSemanticDiagnosticsBuilderProgram;
|
|
20
|
-
|
|
21
|
-
const { fileNames, options, projectReferences, watchOptions } =
|
|
22
|
-
resolveConfigOptions(configPath);
|
|
23
|
-
|
|
24
|
-
const host = ts.createWatchCompilerHost(
|
|
25
|
-
fileNames,
|
|
26
|
-
options,
|
|
27
|
-
ts.sys,
|
|
28
|
-
createProgram,
|
|
29
|
-
reportDiagnostics,
|
|
30
|
-
reportWatchStatusChanged,
|
|
31
|
-
projectReferences,
|
|
32
|
-
watchOptions
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
ts.createWatchProgram(host);
|
|
36
|
-
},
|
|
37
|
-
};
|