@metamask/snaps-webpack-plugin 0.14.0 → 0.17.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.
package/dist/plugin.d.ts CHANGED
@@ -1,8 +1,22 @@
1
1
  import { PostProcessOptions } from '@metamask/snap-utils';
2
- import { Compiler, WebpackPluginInstance } from 'webpack';
2
+ import { Compiler } from 'webpack';
3
3
  export declare type Options = PostProcessOptions;
4
- export default class SnapsWebpackPlugin implements WebpackPluginInstance {
4
+ export default class SnapsWebpackPlugin {
5
5
  readonly options: Partial<Options>;
6
+ /**
7
+ * Construct an instance of the plugin.
8
+ *
9
+ * @param options - The post-process options.
10
+ * @param options.stripComments - Whether to strip comments. Defaults to `true`.
11
+ * @param options.transformHtmlComments - Whether to transform HTML comments.
12
+ * Defaults to `true`.
13
+ */
6
14
  constructor(options?: Partial<Options>);
15
+ /**
16
+ * Apply the plugin to the Webpack compiler. Hooks into the `processAssets`
17
+ * stage to process the bundle.
18
+ *
19
+ * @param compiler - The Webpack compiler.
20
+ */
7
21
  apply(compiler: Compiler): void;
8
22
  }
package/dist/plugin.js CHANGED
@@ -4,9 +4,23 @@ const snap_utils_1 = require("@metamask/snap-utils");
4
4
  const webpack_sources_1 = require("webpack-sources");
5
5
  const PLUGIN_NAME = 'SnapsWebpackPlugin';
6
6
  class SnapsWebpackPlugin {
7
+ /**
8
+ * Construct an instance of the plugin.
9
+ *
10
+ * @param options - The post-process options.
11
+ * @param options.stripComments - Whether to strip comments. Defaults to `true`.
12
+ * @param options.transformHtmlComments - Whether to transform HTML comments.
13
+ * Defaults to `true`.
14
+ */
7
15
  constructor(options = {}) {
8
16
  this.options = options;
9
17
  }
18
+ /**
19
+ * Apply the plugin to the Webpack compiler. Hooks into the `processAssets`
20
+ * stage to process the bundle.
21
+ *
22
+ * @param compiler - The Webpack compiler.
23
+ */
10
24
  apply(compiler) {
11
25
  compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
12
26
  compilation.hooks.processAssets.tap(PLUGIN_NAME, (assets) => {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;AAAA,qDAA6E;AAE7E,qDAA4C;AAE5C,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAIzC,MAAqB,kBAAkB;IAGrC,YAAY,UAA4B,EAAE;QACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,QAAkB;QACtB,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE;YAC1D,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE;gBAC1D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;oBACxC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;oBAChC,MAAM,SAAS,GAAG,IAAA,8BAAiB,EACjC,KAAK,CAAC,MAAM,EAAY,EACxB,IAAI,CAAC,OAAO,CACb,CAAC;oBAEF,IAAI,SAAS,EAAE;wBACb,+EAA+E;wBAC/E,qDAAqD;wBACrD,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,2BAAS,CAAC,SAAS,CAAQ,CAAC,CAAC;qBACrE;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1BD,qCA0BC"}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";;AAAA,qDAA6E;AAE7E,qDAA4C;AAE5C,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAIzC,MAAqB,kBAAkB;IAGrC;;;;;;;OAOG;IACH,YAAY,UAA4B,EAAE;QACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAkB;QACtB,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE;YAC1D,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE;gBAC1D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;oBACxC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;oBAChC,MAAM,SAAS,GAAG,IAAA,8BAAiB,EACjC,KAAK,CAAC,MAAM,EAAY,EACxB,IAAI,CAAC,OAAO,CACb,CAAC;oBAEF,IAAI,SAAS,EAAE;wBACb,+EAA+E;wBAC/E,qDAAqD;wBACrD,WAAW,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,2BAAS,CAAC,SAAS,CAAQ,CAAC,CAAC;qBACrE;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxCD,qCAwCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-webpack-plugin",
3
- "version": "0.14.0",
3
+ "version": "0.17.0",
4
4
  "keywords": [
5
5
  "webpack",
6
6
  "plugin"
@@ -14,7 +14,7 @@
14
14
  "dist/"
15
15
  ],
16
16
  "scripts": {
17
- "test": "jest",
17
+ "test": "jest && yarn posttest",
18
18
  "posttest": "jest-it-up",
19
19
  "test:ci": "yarn test",
20
20
  "lint:eslint": "eslint . --cache --ext js,ts",
@@ -24,29 +24,42 @@
24
24
  "lint:changelog": "yarn auto-changelog validate",
25
25
  "build:tsc": "tsc --project tsconfig.local.json",
26
26
  "build": "yarn build:tsc",
27
- "build:pre-tsc": "echo 'N/A'",
28
- "build:post-tsc": "echo 'N/A'",
29
27
  "build:clean": "yarn clean && yarn build",
30
- "clean": "rimraf *.tsbuildinfo dist/*",
31
- "publish": "../../scripts/publish-package.sh"
28
+ "clean": "rimraf '*.tsbuildinfo' 'dist/*'",
29
+ "publish:package": "../../scripts/publish-package.sh"
32
30
  },
33
31
  "dependencies": {
34
- "@metamask/snap-utils": "^0.14.0",
32
+ "@metamask/snap-utils": "^0.17.0",
35
33
  "webpack-sources": "^3.2.3"
36
34
  },
37
35
  "devDependencies": {
38
- "@types/jest": "^27.4.1",
39
- "@types/webpack": "^5.28.0",
36
+ "@lavamoat/allow-scripts": "^2.0.3",
37
+ "@metamask/auto-changelog": "^2.6.0",
38
+ "@metamask/eslint-config": "^9.0.0",
39
+ "@metamask/eslint-config-jest": "^9.0.0",
40
+ "@metamask/eslint-config-nodejs": "^9.0.0",
41
+ "@metamask/eslint-config-typescript": "^9.0.1",
42
+ "@types/jest": "^27.5.1",
40
43
  "@types/webpack-sources": "^3.2.0",
44
+ "eslint": "^7.30.0",
45
+ "eslint-config-prettier": "^8.3.0",
46
+ "eslint-plugin-import": "^2.23.4",
47
+ "eslint-plugin-jest": "^24.4.0",
48
+ "eslint-plugin-jsdoc": "^36.1.0",
49
+ "eslint-plugin-node": "^11.1.0",
50
+ "eslint-plugin-prettier": "^3.4.0",
41
51
  "jest": "^27.5.1",
42
52
  "jest-it-up": "^2.0.0",
43
53
  "memfs": "^3.4.1",
44
- "ts-jest": "^27.1.4",
54
+ "prettier": "^2.3.2",
55
+ "prettier-plugin-packagejson": "^2.2.11",
56
+ "rimraf": "^3.0.2",
57
+ "ts-jest": "^27.1.5",
45
58
  "typescript": "^4.4.0",
46
- "webpack": "^5.72.0"
59
+ "webpack": "^5.72.1"
47
60
  },
48
61
  "engines": {
49
- "node": ">=14.0.0"
62
+ "node": ">=16.0.0"
50
63
  },
51
64
  "publishConfig": {
52
65
  "access": "public",
package/CHANGELOG.md DELETED
@@ -1,25 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- ## [Unreleased]
8
-
9
- ## [0.14.0]
10
- ### Fixed
11
- - Actually publish package contents ([#449](https://github.com/MetaMask/snaps-skunkworks/pull/449))
12
- - Package contents were omitted from the previous version due to a build failure.
13
-
14
- ## [0.13.0]
15
- ### Changed
16
- - No changes this release.
17
-
18
- ## [0.12.0]
19
- ### Added
20
- - Initial release ([#420](https://github.com/MetaMask/snaps-skunkworks/pull/420))
21
-
22
- [Unreleased]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.14.0...HEAD
23
- [0.14.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.13.0...v0.14.0
24
- [0.13.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.12.0...v0.13.0
25
- [0.12.0]: https://github.com/MetaMask/snaps-skunkworks/releases/tag/v0.12.0