Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix image addon build #4862

Merged
merged 8 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/addon-image/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const addon = {
}
]
},
resolve: {
modules: ['./node_modules'],
extensions: [ '.js' ],
alias: {
common: path.resolve('../../out/common'),
browser: path.resolve('../../out/browser')
}
},
output: {
filename: mainFile,
path: path.resolve('./lib'),
Expand Down
14 changes: 12 additions & 2 deletions bin/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const addonPackageDirs = [
path.resolve(__dirname, '../addons/addon-attach'),
path.resolve(__dirname, '../addons/addon-canvas'),
path.resolve(__dirname, '../addons/addon-fit'),
// path.resolve(__dirname, '../addons/addon-image'),
path.resolve(__dirname, '../addons/addon-image'),
path.resolve(__dirname, '../addons/addon-ligatures'),
path.resolve(__dirname, '../addons/addon-search'),
path.resolve(__dirname, '../addons/addon-serialize'),
Expand Down Expand Up @@ -127,7 +127,17 @@ function getPublishedVersions(packageJson, version, tag) {
}
throw new Error('Could not get published versions\n' + err);
}
const versionsJson = asArray(JSON.parse(versionsProcess.stdout));
const output = JSON.parse(versionsProcess.stdout);
if (typeof output === 'object' && !Array.isArray(output)) {
if (output.error?.code === 'E404') {
return [];
}
throw new Error('Could not get published versions\n' + output);
}
if (!output || Array.isArray(output) && output.length === 0) {
return [];
}
const versionsJson = asArray(output);
if (tag) {
return versionsJson.filter(v => !v.search(new RegExp(`${version}-${tag}.[0-9]+`)));
}
Expand Down