@atlassian/webresource-webpack-plugin 7.0.3 → 7.0.4-efd4a11

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 +12 -0
  2. package/README.md +6 -3
  3. package/dist/AppResources.d.ts +8 -4
  4. package/dist/AppResources.js +17 -9
  5. package/dist/AppResources.js.map +1 -1
  6. package/dist/AppResourcesFactory.d.ts +1 -1
  7. package/dist/WebpackHelpers.d.ts +5 -5
  8. package/dist/WebpackHelpers.js +36 -54
  9. package/dist/WebpackHelpers.js.map +1 -1
  10. package/dist/WebpackRuntimeHelpers.d.ts +0 -2
  11. package/dist/WebpackRuntimeHelpers.js +1 -12
  12. package/dist/WebpackRuntimeHelpers.js.map +1 -1
  13. package/dist/WrmManifestPlugin.js.map +1 -1
  14. package/dist/WrmPlugin.d.ts +9 -3
  15. package/dist/WrmPlugin.js +133 -55
  16. package/dist/WrmPlugin.js.map +1 -1
  17. package/dist/deps/base-dependencies.js.map +1 -1
  18. package/dist/helpers/file-system.js +1 -2
  19. package/dist/helpers/file-system.js.map +1 -1
  20. package/dist/helpers/isRspackCompiler.d.ts +3 -0
  21. package/dist/helpers/isRspackCompiler.js +9 -0
  22. package/dist/helpers/isRspackCompiler.js.map +1 -0
  23. package/dist/helpers/options-parser.js +4 -1
  24. package/dist/helpers/options-parser.js.map +1 -1
  25. package/dist/helpers/renderCondition.js.map +1 -1
  26. package/dist/helpers/renderTransformations.d.ts +1 -1
  27. package/dist/helpers/renderTransformations.js.map +1 -1
  28. package/dist/helpers/web-resource-entrypoints.js.map +1 -1
  29. package/dist/helpers/web-resource-generator.js.map +1 -1
  30. package/dist/helpers/web-resource-parser.js.map +1 -1
  31. package/dist/helpers/xml.d.ts +2 -2
  32. package/dist/helpers/xml.js.map +1 -1
  33. package/dist/logger.js.map +1 -1
  34. package/dist/types/extracted-webpack-types.d.ts +9 -9
  35. package/dist/types/types.d.ts +27 -27
  36. package/dist/webpack-modules/WrmResourceModule.js.map +1 -1
  37. package/jest.config.js +16 -1
  38. package/package.json +20 -17
@@ -1,61 +1,61 @@
1
- export declare type ArrayBaseType<T> = T extends Array<infer U> ? U : never;
2
- export declare type Callable = (...args: any[]) => any;
3
- export declare type ObjectOrMap = Record<string, unknown> | Map<string, unknown>;
4
- export declare type ConditionParam = {
1
+ export type ArrayBaseType<T> = T extends Array<infer U> ? U : never;
2
+ export type Callable = (...args: any[]) => any;
3
+ export type ObjectOrMap = Record<string, unknown> | Map<string, unknown>;
4
+ export type ConditionParam = {
5
5
  attributes?: {
6
6
  [key: string]: string;
7
7
  };
8
8
  value?: string;
9
9
  };
10
- export declare type ConditionClass = {
10
+ export type ConditionClass = {
11
11
  class: string;
12
12
  invert?: boolean;
13
13
  params?: ConditionParam[];
14
14
  };
15
- export declare type Conditions = {
15
+ export type Conditions = {
16
16
  type: string;
17
17
  conditions: Array<Conditions | ConditionClass>;
18
18
  };
19
- export declare type Condition = Conditions | ConditionClass | Array<Conditions | Condition>;
20
- export declare type DeprecationInfo = {
19
+ export type Condition = Conditions | ConditionClass | Array<Conditions | Condition>;
20
+ export type DeprecationInfo = {
21
21
  sinceVersion?: string;
22
22
  removeInVersion?: string;
23
23
  alternative?: string;
24
24
  extraInfo?: string;
25
25
  } | true;
26
- export declare type ProvidedDependency = {
26
+ export type ProvidedDependency = {
27
27
  dependency: string;
28
28
  import: {
29
29
  var: string;
30
30
  amd?: string;
31
31
  } | string;
32
32
  };
33
- export declare type DataProvider = {
33
+ export type DataProvider = {
34
34
  key: string;
35
35
  class: string;
36
36
  };
37
- export declare type ResourceParam = {
37
+ export type ResourceParam = {
38
38
  name: string;
39
39
  value: string;
40
40
  };
41
- export declare type WebresourceObject = {
41
+ export type WebresourceObject = {
42
42
  key?: string;
43
43
  name?: string;
44
44
  state?: string | boolean;
45
45
  };
46
- export declare type WebresourceType = string | WebresourceObject;
47
- declare type MapOrObject<T> = Map<string, T> | {
46
+ export type WebresourceType = string | WebresourceObject;
47
+ type MapOrObject<T> = Map<string, T> | {
48
48
  [key: string]: T;
49
49
  };
50
- export declare type ContextMap = Map<string, string[]>;
51
- export declare type TransformationMap = Map<string, string[]>;
52
- export declare type ProvidedDependenciesMap = Map<string, ProvidedDependency>;
53
- export declare type ConditionsMap = Map<string, Condition>;
54
- export declare type DataProvidersMap = Map<string, DataProvider[]>;
55
- export declare type DeprecationMap = Map<string, DeprecationInfo>;
56
- export declare type ResourceParamMap = Map<string, ResourceParam[]>;
57
- export declare type WebresourceMap = Map<string, WebresourceType>;
58
- export declare type Options = {
50
+ export type ContextMap = Map<string, string[]>;
51
+ export type TransformationMap = Map<string, string[]>;
52
+ export type ProvidedDependenciesMap = Map<string, ProvidedDependency>;
53
+ export type ConditionsMap = Map<string, Condition>;
54
+ export type DataProvidersMap = Map<string, DataProvider[]>;
55
+ export type DeprecationMap = Map<string, DeprecationInfo>;
56
+ export type ResourceParamMap = Map<string, ResourceParam[]>;
57
+ export type WebresourceMap = Map<string, WebresourceType>;
58
+ export type Options = {
59
59
  /** @property pluginKey - The fully qualified plugin key. e.g.: com.atlassian.jira.plugins.my-jira-plugin */
60
60
  pluginKey: string;
61
61
  /** @property xmlDescriptors - Path to the directory where this plugin stores the descriptors about this plugin, used by the WRM to load your frontend code. */
@@ -101,7 +101,7 @@ export declare type Options = {
101
101
  /** @property watchPrepare - In conjunction with watch mode - indicates that only "redirects" to a webserver should be build in this run. */
102
102
  watchPrepare?: boolean;
103
103
  };
104
- export declare type ConsolidatedOptions = Options & Required<Omit<Options, 'wrmManifestPath' | 'singleRuntimeWebResourceKey' | 'packageName'>> & {
104
+ export type ConsolidatedOptions = Options & Required<Omit<Options, 'wrmManifestPath' | 'singleRuntimeWebResourceKey' | 'packageName'>> & {
105
105
  conditionMap: ConditionsMap;
106
106
  contextMap: ContextMap;
107
107
  dataProvidersMap: DataProvidersMap;
@@ -111,11 +111,11 @@ export declare type ConsolidatedOptions = Options & Required<Omit<Options, 'wrmM
111
111
  transformationMap: TransformationMap;
112
112
  webresourceKeyMap: WebresourceMap;
113
113
  };
114
- export declare type WrmResource = {
114
+ export type WrmResource = {
115
115
  name: string;
116
116
  location: string;
117
117
  };
118
- export declare type ChunkResourceDescriptor = {
118
+ export type ChunkResourceDescriptor = {
119
119
  attributes: {
120
120
  key: string;
121
121
  moduleId?: string;
@@ -128,5 +128,5 @@ export declare type ChunkResourceDescriptor = {
128
128
  dataProviders?: DataProvider[];
129
129
  externalResources?: WrmResource[];
130
130
  };
131
- export declare type AssetNames = Map<string, string>;
131
+ export type AssetNames = Map<string, string>;
132
132
  export {};
@@ -1 +1 @@
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;YACzD,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAC5D,OAAO,GAAG,cAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;SACxD;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"}
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"}
package/jest.config.js CHANGED
@@ -1,8 +1,23 @@
1
1
  const pkg = require('./package.json');
2
2
  const baseConfig = require('../../jest.config.js');
3
3
 
4
+ /**
5
+ * @type {import('jest').Config}
6
+ */
4
7
  module.exports = {
5
8
  ...baseConfig,
6
- projects: ['.'],
9
+ projects: [
10
+ {
11
+ preset: 'ts-jest',
12
+ displayName: 'webpack',
13
+ transform: baseConfig.transform,
14
+ },
15
+ {
16
+ preset: 'ts-jest',
17
+ displayName: 'rspack',
18
+ transform: baseConfig.transform,
19
+ setupFilesAfterEnv: ['./test/util/setup-rspack.ts'],
20
+ },
21
+ ],
7
22
  displayName: pkg.name,
8
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian/webresource-webpack-plugin",
3
- "version": "7.0.3",
3
+ "version": "7.0.4-efd4a11",
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",
@@ -60,7 +60,7 @@
60
60
  "dependencies": {
61
61
  "lodash": "4.17.21",
62
62
  "pretty-data": "0.40.0",
63
- "tapable": "2.2.1",
63
+ "tapable": "2.2.2",
64
64
  "url-join": "4.0.1",
65
65
  "uuid": "8.3.2"
66
66
  },
@@ -69,29 +69,30 @@
69
69
  "webpack-sources": "^1 || ^2"
70
70
  },
71
71
  "devDependencies": {
72
+ "@rspack/core": "^1.4.11",
72
73
  "@types/glob": "7.2.0",
73
- "@types/lodash": "4.14.177",
74
- "@types/node": "16.11.11",
74
+ "@types/lodash": "4.14.202",
75
+ "@types/node": "22.17.2",
75
76
  "@types/pretty-data": "0.40.3",
76
- "@types/url-join": "4.0.1",
77
- "@types/uuid": "8.3.3",
78
- "@types/webpack-sources": "3.2.0",
79
- "@types/xml-parser": "1.2.30",
77
+ "@types/url-join": "4.0.3",
78
+ "@types/uuid": "8.3.4",
79
+ "@types/webpack-sources": "3.2.3",
80
+ "@types/xml-parser": "1.2.33",
80
81
  "css-loader": "5.2.7",
81
- "del": "6.0.0",
82
- "esbuild": "0.14.1",
83
- "esbuild-register": "3.2.0",
82
+ "del": "6.1.1",
83
+ "esbuild": "0.25.9",
84
+ "esbuild-register": "3.6.0",
84
85
  "file-loader": "6.2.0",
85
- "glob": "7.2.0",
86
- "jest": "27.4.3",
86
+ "glob": "7.2.3",
87
+ "jest": "29.7.0",
87
88
  "jquery": "3.6.0",
88
89
  "mini-css-extract-plugin": "2.8.1",
89
90
  "style-loader": "2.0.0",
90
91
  "ts-node": "10.4.0",
91
- "typescript": "4.5.2",
92
- "underscore": "1.13.1",
92
+ "typescript": "5.9.2",
93
+ "underscore": "1.13.7",
93
94
  "webpack": "5.90.3",
94
- "webpack-cli": "4.9.1",
95
+ "webpack-cli": "4.9.2",
95
96
  "webpack-sources": "2.3.1",
96
97
  "xml-parser": "1.2.1"
97
98
  },
@@ -114,7 +115,9 @@
114
115
  "build": "tsc -p tsconfig.json",
115
116
  "verify": "tsc -p tsconfig.json --noEmit",
116
117
  "test": "jest",
118
+ "test:webpack": "jest --selectProjects=webpack",
119
+ "test:rspack": "jest --selectProjects=rspack",
117
120
  "test:watch": "jest --watch"
118
121
  },
119
- "gitHead": "97de29c8ee207d7c11d0a48b457a7b83202cdf43"
122
+ "gitHead": "fa43ff58de567f17ff53662043552e231a773c6d"
120
123
  }