@adobe/helix-deploy 12.4.39 → 13.0.1

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
@@ -1,3 +1,25 @@
1
+ ## [13.0.1](https://github.com/adobe/helix-deploy/compare/v13.0.0...v13.0.1) (2025-05-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#810](https://github.com/adobe/helix-deploy/issues/810)) ([3b7a44f](https://github.com/adobe/helix-deploy/commit/3b7a44ff77386f6dd9c3c689d023a5713711bbdf))
7
+
8
+ # [13.0.0](https://github.com/adobe/helix-deploy/compare/v12.4.39...v13.0.0) (2025-05-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * move webpack bundler to plugin ([#809](https://github.com/adobe/helix-deploy/issues/809)) ([4c783a8](https://github.com/adobe/helix-deploy/commit/4c783a816767dd867af44b8bfbbdf3bf8aeebc9c))
14
+
15
+
16
+ ### BREAKING CHANGES
17
+
18
+ * bundles will be ESM built with esbuild
19
+
20
+ * fix: move webpack bundler to plugin
21
+ * fix: use simple-esm as template for deployment
22
+
1
23
  ## [12.4.39](https://github.com/adobe/helix-deploy/compare/v12.4.38...v12.4.39) (2025-05-13)
2
24
 
3
25
 
package/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  export { default as ActionBuilder } from './src/ActionBuilder.js';
13
- export { default as WebpackBundler } from './src/bundler/WebpackBundler.js';
13
+ export { default as BaseBundler } from './src/bundler/BaseBundler.js';
14
14
  export { default as BaseConfig } from './src/BaseConfig.js';
15
15
  export { default as BaseDeployer } from './src/deploy/BaseDeployer.js';
16
16
  export { default as CLI } from './src/cli.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "12.4.39",
3
+ "version": "13.0.1",
4
4
  "description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/adobe/helix-deploy#readme",
@@ -34,17 +34,17 @@
34
34
  "require": "test/setup-env.js"
35
35
  },
36
36
  "peerDependencies": {
37
- "@adobe/helix-universal": ">=4.1.1"
37
+ "@adobe/helix-universal": ">=5.2.1"
38
38
  },
39
39
  "dependencies": {
40
40
  "@adobe/fetch": "4.2.1",
41
41
  "@adobe/helix-shared-process-queue": "3.1.3",
42
- "@aws-sdk/client-apigatewayv2": "3.808.0",
43
- "@aws-sdk/client-lambda": "3.808.0",
44
- "@aws-sdk/client-s3": "3.808.0",
45
- "@aws-sdk/client-secrets-manager": "3.808.0",
46
- "@aws-sdk/client-ssm": "3.808.0",
47
- "@aws-sdk/client-sts": "3.808.0",
42
+ "@aws-sdk/client-apigatewayv2": "3.812.0",
43
+ "@aws-sdk/client-lambda": "3.812.0",
44
+ "@aws-sdk/client-s3": "3.812.0",
45
+ "@aws-sdk/client-secrets-manager": "3.812.0",
46
+ "@aws-sdk/client-ssm": "3.812.0",
47
+ "@aws-sdk/client-sts": "3.812.0",
48
48
  "@google-cloud/functions": "4.0.1",
49
49
  "@google-cloud/secret-manager": "6.0.1",
50
50
  "@google-cloud/storage": "7.16.0",
@@ -57,7 +57,6 @@
57
57
  "isomorphic-git": "1.30.1",
58
58
  "openwhisk": "3.21.8",
59
59
  "semver": "7.7.2",
60
- "webpack": "5.99.8",
61
60
  "yargs": "17.7.2"
62
61
  },
63
62
  "devDependencies": {
@@ -69,12 +68,12 @@
69
68
  "c8": "10.1.3",
70
69
  "eslint": "8.57.1",
71
70
  "husky": "9.1.7",
72
- "lint-staged": "15.5.2",
73
- "mocha": "11.2.2",
71
+ "lint-staged": "16.0.0",
72
+ "mocha": "11.4.0",
74
73
  "mocha-junit-reporter": "2.2.1",
75
74
  "mocha-multi-reporters": "1.5.1",
76
75
  "nock": "13.5.6",
77
- "semantic-release": "24.2.3",
76
+ "semantic-release": "24.2.4",
78
77
  "yauzl": "3.2.0"
79
78
  },
80
79
  "engines": {
package/src/BaseConfig.js CHANGED
@@ -90,9 +90,9 @@ export default class BaseConfig {
90
90
  updatedBy: null,
91
91
  targets: [],
92
92
  functionURL: '',
93
- esm: false,
93
+ esm: true,
94
94
  archs: ['node', 'edge'],
95
- bundler: 'webpack',
95
+ bundler: 'esbuild',
96
96
  format: {
97
97
  aws: DEFAULT_ACTION_FORMAT,
98
98
  },
@@ -658,7 +658,7 @@ export default class BaseConfig {
658
658
  .option('esm', {
659
659
  description: 'Produce EcmaScript Module (experimental, disables edge arch)',
660
660
  type: 'boolean',
661
- default: false,
661
+ default: true,
662
662
  })
663
663
  .option('modules', {
664
664
  alias: 'm',
@@ -176,7 +176,6 @@ export default class BaseBundler {
176
176
 
177
177
  archive.append(JSON.stringify(packageJson, null, ' '), { name: 'package.json' });
178
178
 
179
- // this allows to use a cjs loader for the esm modules. but it still doesn't work on AWS
180
179
  if (cfg.esm) {
181
180
  archive.directory('esm-adapter');
182
181
  archive.append('{}', { name: 'esm-adapter/package.json' });
@@ -23,7 +23,7 @@ import BaseBundler from './BaseBundler.js';
23
23
  const __dirname = path.resolve(fileURLToPath(import.meta.url), '..');
24
24
 
25
25
  /**
26
- * Webpack based bundler
26
+ * ESBuild based bundler
27
27
  */
28
28
  export default class ESBuildBundler extends BaseBundler {
29
29
  /**
package/src/cli.js CHANGED
@@ -21,14 +21,12 @@ import OpenWhiskDeployer from './deploy/OpenWhiskDeployer.js';
21
21
  import AWSDeployer from './deploy/AWSDeployer.js';
22
22
  import GoogleDeployer from './deploy/GoogleDeployer.js';
23
23
  import ActionBuilder from './ActionBuilder.js';
24
- import WebpackBundler from './bundler/WebpackBundler.js';
25
24
  import ESBuildBundler from './bundler/ESBuildBundler.js';
26
25
 
27
26
  const PLUGINS = [
28
27
  OpenWhiskDeployer,
29
28
  AWSDeployer,
30
29
  GoogleDeployer,
31
- WebpackBundler,
32
30
  ESBuildBundler,
33
31
  ];
34
32
 
@@ -1,241 +0,0 @@
1
- /*
2
- * Copyright 2019 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
- import { fileURLToPath } from 'url';
13
- import path from 'path';
14
- import fse from 'fs-extra';
15
- import webpack from 'webpack';
16
- import chalk from 'chalk-template';
17
- import BaseBundler from './BaseBundler.js';
18
-
19
- // eslint-disable-next-line no-underscore-dangle
20
- const __dirname = path.resolve(fileURLToPath(import.meta.url), '..');
21
-
22
- /**
23
- * Webpack based bundler
24
- */
25
- export default class WebpackBundler extends BaseBundler {
26
- constructor(cfg) {
27
- super(cfg);
28
- this.arch = 'node';
29
- this.type = 'webpack';
30
- }
31
-
32
- async init() {
33
- if (this.cfg.esm) {
34
- throw new Error('Webpack bundler does not support ESM builds.');
35
- }
36
- }
37
-
38
- async getWebpackConfig() {
39
- const { cfg } = this;
40
- const opts = {
41
- target: 'node',
42
- mode: 'production',
43
- // the universal adapter is the entry point
44
- entry: cfg.adapterFile || path.resolve(__dirname, '..', 'template', 'node-index.js'),
45
- context: cfg.cwd,
46
- output: {
47
- path: cfg.cwd,
48
- filename: path.relative(cfg.cwd, cfg.bundle),
49
- library: 'main',
50
- libraryTarget: 'umd',
51
- globalObject: 'globalThis',
52
- asyncChunks: false,
53
- },
54
- devtool: false,
55
- externals: [
56
- /^@aws-sdk\/.*$/,
57
- [
58
- ...cfg.externals,
59
- ...cfg.serverlessExternals,
60
- // the following are imported by the universal adapter and are assumed to be available
61
- './params.json',
62
- 'aws-sdk',
63
- '@google-cloud/secret-manager',
64
- '@google-cloud/storage',
65
- ].reduce((obj, ext) => {
66
- // this makes webpack to ignore the module and just leave it as normal require.
67
- // eslint-disable-next-line no-param-reassign
68
- obj[ext] = `commonjs2 ${ext}`;
69
- return obj;
70
- }, {}),
71
- ],
72
- module: {
73
- rules: [{
74
- test: /\.js$/,
75
- type: 'javascript/auto',
76
- }, {
77
- test: /\.mjs$/,
78
- type: 'javascript/esm',
79
- }],
80
- },
81
- resolve: {
82
- mainFields: ['main', 'module'],
83
- extensions: ['.wasm', '.js', '.mjs', '.json'],
84
- alias: {
85
- // the main.js is imported in the universal adapter and is _the_ action entry point
86
- './main.js': cfg.file,
87
- },
88
- },
89
- optimization: {
90
- // we enable production mode in order to get the correct imports (eg micromark has special
91
- // export condition for 'development'). but we disable minimize and keep named modules
92
- // in order to easier match log errors to the bundle
93
- minimize: false,
94
- concatenateModules: false,
95
- mangleExports: false,
96
- moduleIds: 'named',
97
- },
98
- node: {
99
- __dirname: true,
100
- __filename: false,
101
- },
102
- plugins: [],
103
- };
104
- if (cfg.minify) {
105
- opts.optimization = {
106
- minimize: cfg.minify,
107
- };
108
- }
109
- if (cfg.modulePaths && cfg.modulePaths.length > 0) {
110
- opts.resolve.modules = cfg.modulePaths;
111
- }
112
-
113
- if (cfg.progressHandler) {
114
- this.initProgressHandler(opts, cfg);
115
- }
116
-
117
- const customizePath = path.join(cfg.cwd, 'hlx.webpack.customize.js');
118
- if (await fse.pathExists(customizePath)) {
119
- cfg.log.info(`--: Using custom webpack config from ${customizePath}`);
120
- const customize = await import(customizePath);
121
- if (customize.extraPlugins && typeof customize.extraPlugins === 'function') {
122
- opts.plugins.push(...customize.extraPlugins(cfg, opts));
123
- }
124
- }
125
- return opts;
126
- }
127
-
128
- // eslint-disable-next-line class-methods-use-this
129
- initProgressHandler(opts, cfg) {
130
- opts.plugins.push(new webpack.ProgressPlugin(cfg.progressHandler));
131
- }
132
-
133
- async createWebpackBundle(arch) {
134
- const { cfg } = this;
135
- if (!cfg.depFile) {
136
- throw Error('dependencies info path is undefined');
137
- }
138
- const m = cfg.minify ? 'minified ' : '';
139
- if (!cfg.progressHandler) {
140
- cfg.log.info(`--: creating ${arch} ${m}bundle using webpack ...`);
141
- }
142
- const config = await this.getWebpackConfig();
143
- const compiler = webpack(config);
144
- const stats = await new Promise((resolve, reject) => {
145
- compiler.run((err, s) => {
146
- if (err) {
147
- reject(err);
148
- } else {
149
- resolve(s);
150
- }
151
- });
152
- });
153
- cfg.log.debug(stats.toString({
154
- chunks: false,
155
- colors: true,
156
- }));
157
-
158
- await this.resolveDependencyInfos(stats);
159
- // write dependencies info file
160
- await fse.writeJson(cfg.depFile, cfg.dependencies, { spaces: 2 });
161
- if (!cfg.progressHandler) {
162
- cfg.log.info(chalk`{green ok:} created ${arch} bundle {yellow ${config.output.filename}}`);
163
- }
164
- return stats;
165
- }
166
-
167
- async createBundle() {
168
- if (!this.cfg.bundle) {
169
- throw Error('bundle path is undefined');
170
- }
171
- return this.createWebpackBundle('node');
172
- }
173
-
174
- /**
175
- * Resolves the dependencies by chunk. eg:
176
- *
177
- * {
178
- * 'src/idx_json.bundle.js': [{
179
- * id: '@adobe/helix-epsagon:1.2.0',
180
- * name: '@adobe/helix-epsagon',
181
- * version: '1.2.0' },
182
- * ],
183
- * ...
184
- * }
185
- */
186
- async resolveDependencyInfos(stats) {
187
- const { cfg } = this;
188
-
189
- // get list of dependencies
190
- const depsByFile = {};
191
- const resolved = {};
192
-
193
- const jsonStats = stats.toJson({
194
- chunks: true,
195
- chunkModules: true,
196
- });
197
-
198
- await Promise.all(jsonStats.chunks
199
- .map(async (chunk) => {
200
- const chunkName = chunk.names[0];
201
- const deps = {};
202
- depsByFile[chunkName] = deps;
203
-
204
- await Promise.all(chunk.modules.map(async (mod) => {
205
- const segs = mod.identifier.split('/');
206
- let idx = segs.lastIndexOf('node_modules');
207
- if (idx >= 0) {
208
- idx += 1;
209
- if (segs[idx].charAt(0) === '@') {
210
- idx += 1;
211
- }
212
- segs.splice(idx + 1);
213
- const dir = path.resolve('/', ...segs);
214
-
215
- try {
216
- if (!resolved[dir]) {
217
- const pkgJson = await fse.readJson(path.resolve(dir, 'package.json'));
218
- const id = `${pkgJson.name}:${pkgJson.version}`;
219
- resolved[dir] = {
220
- id,
221
- name: pkgJson.name,
222
- version: pkgJson.version,
223
- };
224
- }
225
- const dep = resolved[dir];
226
- deps[dep.id] = dep;
227
- } catch (e) {
228
- // ignore
229
- }
230
- }
231
- }));
232
- }));
233
-
234
- // sort the deps
235
- Object.entries(depsByFile)
236
- .forEach(([scriptFile, deps]) => {
237
- cfg.dependencies[scriptFile] = Object.values(deps)
238
- .sort((d0, d1) => d0.name.localeCompare(d1.name));
239
- });
240
- }
241
- }