@dotcom-tool-kit/typescript 3.2.7 → 3.3.1

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 type { TypeScriptSchema } from '@dotcom-tool-kit/schemas/lib/tasks/typescript';
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;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAA;AAKrF,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,gBAAgB,CAAA;CAAE,CAAC;IACvE,GAAG,CAAC,EAAC,GAAG,EAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA+BhD"}
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;AAExB,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;CAgClD"}
@@ -1,11 +1,32 @@
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");
6
- const tscPath = require.resolve('typescript/bin/tsc');
8
+ const z = tslib_1.__importStar(require("zod"));
9
+ const TypeScriptSchema = z
10
+ .object({
11
+ configPath: z
12
+ .string()
13
+ .optional()
14
+ .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"),
15
+ build: z
16
+ .literal(true)
17
+ .optional()
18
+ .describe('Run Typescript in [build mode](https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript).'),
19
+ watch: z.literal(true).optional().describe('Run Typescript in watch mode.'),
20
+ noEmit: z
21
+ .literal(true)
22
+ .optional()
23
+ .describe('Run Typescript with `--noEmit`, for checking your types without outputting compiled Javascript.')
24
+ })
25
+ .describe('Compile code with `tsc`.');
26
+ exports.schema = TypeScriptSchema;
7
27
  class TypeScript extends base_1.Task {
8
28
  async run({ cwd }) {
29
+ const tscPath = require.resolve('typescript/bin/tsc', { paths: [cwd] });
9
30
  const args = [];
10
31
  // TODO:KB:20240408 refactor this
11
32
  if (this.options.build) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcom-tool-kit/typescript",
3
- "version": "3.2.7",
3
+ "version": "3.3.1",
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.9",
29
- "@dotcom-tool-kit/logger": "^4.1.1"
28
+ "@dotcom-tool-kit/base": "^1.2.0",
29
+ "@dotcom-tool-kit/logger": "^4.1.1",
30
+ "zod": "^3.24.1"
30
31
  },
31
32
  "devDependencies": {
32
- "@dotcom-tool-kit/schemas": "^1.9.0",
33
33
  "@jest/globals": "^29.3.1",
34
34
  "typescript": "^4.9.4",
35
35
  "winston": "^3.8.2"