@dotcom-tool-kit/typescript 3.2.6 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { Task, TaskRunContext } from '@dotcom-tool-kit/base';
|
|
2
|
-
import
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
declare const TypeScriptSchema: z.ZodObject<{
|
|
4
|
+
configPath: z.ZodOptional<z.ZodString>;
|
|
5
|
+
build: z.ZodOptional<z.ZodLiteral<true>>;
|
|
6
|
+
watch: z.ZodOptional<z.ZodLiteral<true>>;
|
|
7
|
+
noEmit: z.ZodOptional<z.ZodLiteral<true>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
configPath?: string | undefined;
|
|
10
|
+
build?: true | undefined;
|
|
11
|
+
watch?: true | undefined;
|
|
12
|
+
noEmit?: true | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
configPath?: string | undefined;
|
|
15
|
+
build?: true | undefined;
|
|
16
|
+
watch?: true | undefined;
|
|
17
|
+
noEmit?: true | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export { TypeScriptSchema as schema };
|
|
3
20
|
export default class TypeScript extends Task<{
|
|
4
21
|
task: typeof TypeScriptSchema;
|
|
5
22
|
}> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/tasks/typescript.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/tasks/typescript.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;EAsBiB,CAAA;AACvC,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,gBAAgB,CAAA;CAAE,CAAC;IACvE,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+BlD"}
|
package/lib/tasks/typescript.js
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
3
5
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
4
6
|
const base_1 = require("@dotcom-tool-kit/base");
|
|
5
7
|
const child_process_1 = require("child_process");
|
|
8
|
+
const z = tslib_1.__importStar(require("zod"));
|
|
6
9
|
const tscPath = require.resolve('typescript/bin/tsc');
|
|
10
|
+
const TypeScriptSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
configPath: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("to the [TypeScript config file](https://www.typescriptlang.org/tsconfig). Uses TypeScript's own [tsconfig.json resolution](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#using-tsconfigjson-or-jsconfigjson) by default"),
|
|
16
|
+
build: z
|
|
17
|
+
.literal(true)
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Run Typescript in [build mode](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript).'),
|
|
20
|
+
watch: z.literal(true).optional().describe('Run Typescript in watch mode.'),
|
|
21
|
+
noEmit: z
|
|
22
|
+
.literal(true)
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Run Typescript with `--noEmit`, for checking your types without outputting compiled Javascript.')
|
|
25
|
+
})
|
|
26
|
+
.describe('Compile code with `tsc`.');
|
|
27
|
+
exports.schema = TypeScriptSchema;
|
|
7
28
|
class TypeScript extends base_1.Task {
|
|
8
29
|
async run({ cwd }) {
|
|
9
30
|
const args = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/typescript",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"typescript": "3.x || 4.x || 5.x"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@dotcom-tool-kit/base": "^1.1.
|
|
29
|
-
"@dotcom-tool-kit/logger": "^4.1.1"
|
|
28
|
+
"@dotcom-tool-kit/base": "^1.1.10",
|
|
29
|
+
"@dotcom-tool-kit/logger": "^4.1.1",
|
|
30
|
+
"zod": "^3.24.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@dotcom-tool-kit/schemas": "^1.8.0",
|
|
33
33
|
"@jest/globals": "^29.3.1",
|
|
34
34
|
"typescript": "^4.9.4",
|
|
35
35
|
"winston": "^3.8.2"
|