@atlassian/webresource-webpack-plugin 7.0.6 → 7.1.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/AppResources.d.ts +11 -6
  3. package/dist/AppResources.js +22 -22
  4. package/dist/AppResources.js.map +1 -1
  5. package/dist/WebpackHelpers.d.ts +8 -6
  6. package/dist/WebpackHelpers.js +70 -51
  7. package/dist/WebpackHelpers.js.map +1 -1
  8. package/dist/WebpackRuntimeHelpers.d.ts +0 -2
  9. package/dist/WebpackRuntimeHelpers.js +1 -12
  10. package/dist/WebpackRuntimeHelpers.js.map +1 -1
  11. package/dist/WrmPlugin.d.ts +18 -2
  12. package/dist/WrmPlugin.js +207 -58
  13. package/dist/WrmPlugin.js.map +1 -1
  14. package/dist/helpers/bundler-bridge.d.ts +8 -0
  15. package/dist/helpers/bundler-bridge.js +23 -0
  16. package/dist/helpers/bundler-bridge.js.map +1 -0
  17. package/dist/helpers/peer-dependency-checker.d.ts +1 -0
  18. package/dist/helpers/peer-dependency-checker.js +33 -0
  19. package/dist/helpers/peer-dependency-checker.js.map +1 -0
  20. package/dist/shims/empty-wrm-module.d.ts +1 -0
  21. package/dist/shims/empty-wrm-module.js +3 -0
  22. package/dist/shims/empty-wrm-module.js.map +1 -0
  23. package/dist/types/extracted-webpack-types.d.ts +2 -1
  24. package/dist/types/types.d.ts +2 -1
  25. package/jest.config.js +17 -3
  26. package/package.json +15 -10
  27. package/dist/webpack-modules/EmptyExportsModule.d.ts +0 -14
  28. package/dist/webpack-modules/EmptyExportsModule.js +0 -28
  29. package/dist/webpack-modules/EmptyExportsModule.js.map +0 -1
  30. package/dist/webpack-modules/ProvidedExternalDependencyModule.d.ts +0 -20
  31. package/dist/webpack-modules/ProvidedExternalDependencyModule.js +0 -36
  32. package/dist/webpack-modules/ProvidedExternalDependencyModule.js.map +0 -1
  33. package/dist/webpack-modules/WrmDependencyModule.d.ts +0 -6
  34. package/dist/webpack-modules/WrmDependencyModule.js +0 -17
  35. package/dist/webpack-modules/WrmDependencyModule.js.map +0 -1
  36. package/dist/webpack-modules/WrmResourceModule.d.ts +0 -10
  37. package/dist/webpack-modules/WrmResourceModule.js +0 -29
  38. package/dist/webpack-modules/WrmResourceModule.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian/webresource-webpack-plugin",
3
- "version": "7.0.6",
3
+ "version": "7.1.0",
4
4
  "description": "Auto-generates web-resource definitions from your webpacked code, for usage in an Atlassian product or plugin.",
5
5
  "main": "dist/WrmPlugin.js",
6
6
  "types": "dist/WrmPlugin.d.ts",
@@ -64,11 +64,10 @@
64
64
  "url-join": "4.0.1",
65
65
  "uuid": "8.3.2"
66
66
  },
67
- "peerDependencies": {
68
- "webpack": "^5",
69
- "webpack-sources": "^1 || ^2"
70
- },
71
67
  "devDependencies": {
68
+ "@atlassian/adg-server-iconfont": "^3.1.0",
69
+ "@atlassian/clientside-extensions-components": "5.1.3",
70
+ "@atlassian/clientside-extensions-webpack-plugin": "5.1.3",
72
71
  "@babel/core": "^7.28.3",
73
72
  "@babel/preset-env": "^7.28.3",
74
73
  "@babel/preset-react": "^7.27.1",
@@ -76,6 +75,7 @@
76
75
  "@compiled/babel-plugin-strip-runtime": "^0.38.0",
77
76
  "@compiled/react": "^0.18.6",
78
77
  "@compiled/webpack-loader": "^0.19.6",
78
+ "@rspack/core": "1.5.8",
79
79
  "@types/glob": "7.2.0",
80
80
  "@types/lodash": "4.14.202",
81
81
  "@types/node": "22.17.2",
@@ -86,12 +86,14 @@
86
86
  "@types/xml-parser": "1.2.33",
87
87
  "babel-loader": "^10.0.0",
88
88
  "css-loader": "5.2.7",
89
+ "css-minimizer-webpack-plugin": "^7.0.2",
89
90
  "del": "6.1.1",
90
91
  "esbuild": "0.25.9",
91
92
  "esbuild-register": "3.6.0",
93
+ "eslint-plugin-local-rules": "^3.0.2",
92
94
  "file-loader": "6.2.0",
93
95
  "glob": "7.2.3",
94
- "jest": "29.7.0",
96
+ "jest": "30.2.0",
95
97
  "jquery": "3.6.0",
96
98
  "mini-css-extract-plugin": "2.8.1",
97
99
  "react": "^18.3.1",
@@ -121,10 +123,13 @@
121
123
  ],
122
124
  "scripts": {
123
125
  "prepublishOnly": "npm run build",
124
- "build": "tsc -p tsconfig.json",
125
- "verify": "tsc -p tsconfig.json --noEmit",
126
+ "build": "tsc -p tsconfig.build.json",
127
+ "verify": "tsc -p tsconfig.build.json --noEmit",
126
128
  "test": "jest",
127
- "test:watch": "jest --watch"
129
+ "test:webpack": "jest --selectProjects=webpack",
130
+ "test:rspack": "jest --selectProjects=rspack",
131
+ "test:watch": "jest --watch",
132
+ "test:ci": "jest --ci --silent --runInBand"
128
133
  },
129
- "gitHead": "30f30b861b05d0160f06e7b9b57494a6a502b30f"
134
+ "gitHead": "ccdd91c5c93634876283628212ac8687a09c87c0"
130
135
  }
@@ -1,14 +0,0 @@
1
- import type { sources } from 'webpack';
2
- import DllModule from 'webpack/lib/DllModule';
3
- /**
4
- * This module type allows inclusion of special dependencies in the webpack compilation process
5
- * that ultimately output nothing in the compiled bundles.
6
- *
7
- * This is of use when including certain file types with no associated loader in the compilation process,
8
- * as is the case with things like Atlassian Soy templates.
9
- */
10
- export default class EmptyExportsModule extends DllModule {
11
- constructor(dependency: string, type: string);
12
- chunkCondition(): boolean;
13
- source(): sources.RawSource;
14
- }
@@ -1,28 +0,0 @@
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
- const DllModule_1 = __importDefault(require("webpack/lib/DllModule"));
7
- const webpack_sources_1 = require("webpack-sources");
8
- /**
9
- * This module type allows inclusion of special dependencies in the webpack compilation process
10
- * that ultimately output nothing in the compiled bundles.
11
- *
12
- * This is of use when including certain file types with no associated loader in the compilation process,
13
- * as is the case with things like Atlassian Soy templates.
14
- */
15
- class EmptyExportsModule extends DllModule_1.default {
16
- constructor(dependency, type) {
17
- super(null, [], dependency, type);
18
- }
19
- chunkCondition() {
20
- return true;
21
- }
22
- source() {
23
- // eslint-disable-next-line prettier/prettier
24
- return new webpack_sources_1.RawSource('module.exports = undefined;');
25
- }
26
- }
27
- exports.default = EmptyExportsModule;
28
- //# sourceMappingURL=EmptyExportsModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmptyExportsModule.js","sourceRoot":"","sources":["../../src/webpack-modules/EmptyExportsModule.ts"],"names":[],"mappings":";;;;;AACA,sEAA8C;AAC9C,qDAA4C;AAE5C;;;;;;GAMG;AACH,MAAqB,kBAAmB,SAAQ,mBAAS;IACvD,YAAY,UAAkB,EAAE,IAAY;QAC1C,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,6CAA6C;QAC7C,OAAO,IAAI,2BAAS,CAAC,6BAA6B,CAAiC,CAAC;IACtF,CAAC;CACF;AAbD,qCAaC"}
@@ -1,20 +0,0 @@
1
- import ExternalModule from 'webpack/lib/ExternalModule';
2
- import type { ProvidedDependency } from '../types/types';
3
- /**
4
- * ProvidedExternalModule ensures that the `chunkCondition` is true to allow proper asyncChunk context handling
5
- * ExternalModules can be defined in different ways. Some of them require the external module to be loaded in the entry point.
6
- * This is generally not bad as it doesnt cost anything. However the WRM Plugin relies on ExternalModules to specify provided dependencies.
7
- * These provided dependencies are then added to the context of the chunk in which they occur. Async chunks should therefore
8
- * have their own dependencies to make the entrypoint as small as possible.
9
- * ProvidedExternalModule ensures that.
10
- */
11
- export default class ProvidedExternalDependencyModule extends ExternalModule {
12
- private _wrmDependency;
13
- private _request;
14
- private _target;
15
- constructor(request: ProvidedDependency['import'], dependency: string, target: 'var' | 'amd');
16
- libIdent(): string;
17
- chunkCondition(): boolean;
18
- getDependency(): string;
19
- getConcatenationBailoutReason(): string;
20
- }
@@ -1,36 +0,0 @@
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
- const ExternalModule_1 = __importDefault(require("webpack/lib/ExternalModule"));
7
- /**
8
- * ProvidedExternalModule ensures that the `chunkCondition` is true to allow proper asyncChunk context handling
9
- * ExternalModules can be defined in different ways. Some of them require the external module to be loaded in the entry point.
10
- * This is generally not bad as it doesnt cost anything. However the WRM Plugin relies on ExternalModules to specify provided dependencies.
11
- * These provided dependencies are then added to the context of the chunk in which they occur. Async chunks should therefore
12
- * have their own dependencies to make the entrypoint as small as possible.
13
- * ProvidedExternalModule ensures that.
14
- */
15
- class ProvidedExternalDependencyModule extends ExternalModule_1.default {
16
- constructor(request, dependency, target) {
17
- super(request, target);
18
- this._request = request;
19
- this._wrmDependency = dependency;
20
- this._target = target;
21
- }
22
- libIdent() {
23
- return `${this._wrmDependency}/${typeof this._request === 'string' ? this._request : this._request[this._target]}`;
24
- }
25
- chunkCondition() {
26
- return true;
27
- }
28
- getDependency() {
29
- return this._wrmDependency;
30
- }
31
- getConcatenationBailoutReason() {
32
- return `Provided external dependencies can't be concatenated`;
33
- }
34
- }
35
- exports.default = ProvidedExternalDependencyModule;
36
- //# sourceMappingURL=ProvidedExternalDependencyModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProvidedExternalDependencyModule.js","sourceRoot":"","sources":["../../src/webpack-modules/ProvidedExternalDependencyModule.ts"],"names":[],"mappings":";;;;;AAAA,gFAAwD;AAIxD;;;;;;;GAOG;AACH,MAAqB,gCAAiC,SAAQ,wBAAc;IAK1E,YAAY,OAAqC,EAAE,UAAkB,EAAE,MAAqB;QAC1F,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,cAAc,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACrH,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,6BAA6B;QAC3B,OAAO,sDAAsD,CAAC;IAChE,CAAC;CACF;AA3BD,mDA2BC"}
@@ -1,6 +0,0 @@
1
- import EmptyExportsModule from './EmptyExportsModule';
2
- export default class WrmDependencyModule extends EmptyExportsModule {
3
- private _wrmDependency;
4
- constructor(dependency: string, type: string, pluginKey: string);
5
- getDependency(): string;
6
- }
@@ -1,17 +0,0 @@
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
- const EmptyExportsModule_1 = __importDefault(require("./EmptyExportsModule"));
7
- class WrmDependencyModule extends EmptyExportsModule_1.default {
8
- constructor(dependency, type, pluginKey) {
9
- super(dependency, type);
10
- this._wrmDependency = dependency.includes(':') ? dependency : `${pluginKey}:${dependency}`;
11
- }
12
- getDependency() {
13
- return this._wrmDependency;
14
- }
15
- }
16
- exports.default = WrmDependencyModule;
17
- //# sourceMappingURL=WrmDependencyModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WrmDependencyModule.js","sourceRoot":"","sources":["../../src/webpack-modules/WrmDependencyModule.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AAEtD,MAAqB,mBAAoB,SAAQ,4BAAkB;IAGjE,YAAY,UAAkB,EAAE,IAAY,EAAE,SAAiB;QAC7D,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,UAAU,EAAE,CAAC;IAC7F,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AAXD,sCAWC"}
@@ -1,10 +0,0 @@
1
- import EmptyExportsModule from './EmptyExportsModule';
2
- export default class WrmResourceModule extends EmptyExportsModule {
3
- private _resource;
4
- constructor(resourceNameAndLocationPair: string, target: string, requestContext: string, rootContext: string);
5
- getResourcePair(): [string, string];
6
- getResource(): {
7
- name: string;
8
- location: string;
9
- };
10
- }
@@ -1,29 +0,0 @@
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
- const path_1 = __importDefault(require("path"));
7
- const EmptyExportsModule_1 = __importDefault(require("./EmptyExportsModule"));
8
- class WrmResourceModule extends EmptyExportsModule_1.default {
9
- constructor(resourceNameAndLocationPair, target, requestContext, rootContext) {
10
- super(resourceNameAndLocationPair, target);
11
- const resourcePair = resourceNameAndLocationPair.split('!');
12
- let resPath = resourcePair[1];
13
- // enable relative resource-paths. Still requires that this resource is correctly copied to the right location in target.
14
- if (resPath.startsWith('./') || resPath.startsWith('../')) {
15
- const fullResourcePath = path_1.default.join(requestContext, resPath);
16
- resPath = path_1.default.relative(rootContext, fullResourcePath);
17
- }
18
- this._resource = [resourcePair[0], resPath];
19
- }
20
- getResourcePair() {
21
- return this._resource;
22
- }
23
- getResource() {
24
- const [name, location] = this._resource;
25
- return { name, location };
26
- }
27
- }
28
- exports.default = WrmResourceModule;
29
- //# sourceMappingURL=WrmResourceModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WrmResourceModule.js","sourceRoot":"","sources":["../../src/webpack-modules/WrmResourceModule.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,8EAAsD;AAEtD,MAAqB,iBAAkB,SAAQ,4BAAkB;IAG/D,YAAY,2BAAmC,EAAE,MAAc,EAAE,cAAsB,EAAE,WAAmB;QAC1G,KAAK,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;QAC3C,MAAM,YAAY,GAAG,2BAA2B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAE9B,yHAAyH;QACzH,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1D,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAC5D,OAAO,GAAG,cAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,WAAW;QACT,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QACxC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;CACF;AAzBD,oCAyBC"}