@metamask/snaps-webpack-plugin 0.13.0 → 0.14.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/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
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
+
9
14
  ## [0.13.0]
10
15
  ### Changed
11
16
  - No changes this release.
@@ -14,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
19
  ### Added
15
20
  - Initial release ([#420](https://github.com/MetaMask/snaps-skunkworks/pull/420))
16
21
 
17
- [Unreleased]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.13.0...HEAD
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
18
24
  [0.13.0]: https://github.com/MetaMask/snaps-skunkworks/compare/v0.12.0...v0.13.0
19
25
  [0.12.0]: https://github.com/MetaMask/snaps-skunkworks/releases/tag/v0.12.0
@@ -0,0 +1,2 @@
1
+ export { default } from './plugin';
2
+ export type { Options } from './plugin';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var plugin_1 = require("./plugin");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(plugin_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAmC;AAA1B,kHAAA,OAAO,OAAA"}
@@ -0,0 +1,8 @@
1
+ import { PostProcessOptions } from '@metamask/snap-utils';
2
+ import { Compiler, WebpackPluginInstance } from 'webpack';
3
+ export declare type Options = PostProcessOptions;
4
+ export default class SnapsWebpackPlugin implements WebpackPluginInstance {
5
+ readonly options: Partial<Options>;
6
+ constructor(options?: Partial<Options>);
7
+ apply(compiler: Compiler): void;
8
+ }
package/dist/plugin.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const snap_utils_1 = require("@metamask/snap-utils");
4
+ const webpack_sources_1 = require("webpack-sources");
5
+ const PLUGIN_NAME = 'SnapsWebpackPlugin';
6
+ class SnapsWebpackPlugin {
7
+ constructor(options = {}) {
8
+ this.options = options;
9
+ }
10
+ apply(compiler) {
11
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
12
+ compilation.hooks.processAssets.tap(PLUGIN_NAME, (assets) => {
13
+ Object.keys(assets).forEach((assetName) => {
14
+ const asset = assets[assetName];
15
+ const processed = (0, snap_utils_1.postProcessBundle)(asset.source(), this.options);
16
+ if (processed) {
17
+ // For some reason the type of `RawSource` is not compatible with Webpack's own
18
+ // `Source`, but works fine when casting it to `any`.
19
+ compilation.updateAsset(assetName, new webpack_sources_1.RawSource(processed));
20
+ }
21
+ });
22
+ });
23
+ });
24
+ }
25
+ }
26
+ exports.default = SnapsWebpackPlugin;
27
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-webpack-plugin",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "keywords": [
5
5
  "webpack",
6
6
  "plugin"
@@ -22,16 +22,16 @@
22
22
  "lint": "yarn lint:eslint && yarn lint:misc --check",
23
23
  "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
24
24
  "lint:changelog": "yarn auto-changelog validate",
25
- "build:tsc": "tsc --project tsconfig.build.json",
25
+ "build:tsc": "tsc --project tsconfig.local.json",
26
26
  "build": "yarn build:tsc",
27
27
  "build:pre-tsc": "echo 'N/A'",
28
28
  "build:post-tsc": "echo 'N/A'",
29
29
  "build:clean": "yarn clean && yarn build",
30
- "clean": "rimraf dist/*",
30
+ "clean": "rimraf *.tsbuildinfo dist/*",
31
31
  "publish": "../../scripts/publish-package.sh"
32
32
  },
33
33
  "dependencies": {
34
- "@metamask/snap-utils": "^0.13.0",
34
+ "@metamask/snap-utils": "^0.14.0",
35
35
  "webpack-sources": "^3.2.3"
36
36
  },
37
37
  "devDependencies": {