@dotcom-tool-kit/webpack 4.2.6 → 4.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,19 @@
1
- import { type WebpackSchema } from '@dotcom-tool-kit/schemas/lib/tasks/webpack';
2
1
  import { Task, TaskRunContext } from '@dotcom-tool-kit/base';
2
+ import * as z from 'zod';
3
+ declare const WebpackSchema: z.ZodObject<{
4
+ configPath: z.ZodOptional<z.ZodString>;
5
+ envName: z.ZodUnion<[z.ZodLiteral<"production">, z.ZodLiteral<"development">]>;
6
+ watch: z.ZodOptional<z.ZodBoolean>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ envName: "production" | "development";
9
+ configPath?: string | undefined;
10
+ watch?: boolean | undefined;
11
+ }, {
12
+ envName: "production" | "development";
13
+ configPath?: string | undefined;
14
+ watch?: boolean | undefined;
15
+ }>;
16
+ export { WebpackSchema as schema };
3
17
  export default class Webpack extends Task<{
4
18
  task: typeof WebpackSchema;
5
19
  }> {
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/tasks/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,4CAA4C,CAAA;AAC/E,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAM5D,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,aAAa,CAAA;CAAE,CAAC;IACjE,GAAG,CAAC,EAAC,GAAG,EAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAuBhD"}
1
+ {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/tasks/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG5D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAIxB,QAAA,MAAM,aAAa;;;;;;;;;;;;EAWuB,CAAA;AAC1C,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,CAAA;AAElC,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,aAAa,CAAA;CAAE,CAAC;IACjE,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAuBlD"}
@@ -1,9 +1,25 @@
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 base_1 = require("@dotcom-tool-kit/base");
4
6
  const logger_1 = require("@dotcom-tool-kit/logger");
5
7
  const child_process_1 = require("child_process");
8
+ const z = tslib_1.__importStar(require("zod"));
6
9
  const webpackCLIPath = require.resolve('webpack-cli/bin/cli');
10
+ const WebpackSchema = z
11
+ .object({
12
+ configPath: z
13
+ .string()
14
+ .optional()
15
+ .describe('path to a Webpack config file. Webpack will default to `webpack.config.js`.'),
16
+ envName: z
17
+ .union([z.literal('production'), z.literal('development')])
18
+ .describe("set Webpack's [mode](https://webpack.js.org/configuration/mode/)."),
19
+ watch: z.boolean().optional().describe('run Webpack in watch mode')
20
+ })
21
+ .describe('Bundle code with `webpack`.');
22
+ exports.schema = WebpackSchema;
7
23
  class Webpack extends base_1.Task {
8
24
  async run({ cwd }) {
9
25
  this.logger.info('starting Webpack...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcom-tool-kit/webpack",
3
- "version": "4.2.6",
3
+ "version": "4.3.0",
4
4
  "main": "lib",
5
5
  "description": "",
6
6
  "author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
@@ -17,18 +17,18 @@
17
17
  "test": "cd ../../ ; npx jest --silent --projects plugins/webpack"
18
18
  },
19
19
  "dependencies": {
20
- "@dotcom-tool-kit/base": "^1.1.8",
20
+ "@dotcom-tool-kit/base": "^1.1.10",
21
21
  "@dotcom-tool-kit/error": "^4.1.0",
22
22
  "@dotcom-tool-kit/logger": "^4.1.1",
23
+ "tslib": "^2.3.1",
23
24
  "webpack-cli": "^4.6.0",
24
- "tslib": "^2.3.1"
25
+ "zod": "^3.24.1"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "dotcom-tool-kit": "4.x",
28
29
  "webpack": "4.x.x || 5.x.x"
29
30
  },
30
31
  "devDependencies": {
31
- "@dotcom-tool-kit/schemas": "^1.8.0",
32
32
  "@jest/globals": "^27.4.6",
33
33
  "ts-node": "^10.0.0",
34
34
  "webpack": "^4.42.1",