Skip to content

[WC-2723]: Add rollup config for i18n locales (Combobox) #1456

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/pluggableWidgets/combobox-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@
"githubUrl": "https://github.com/mendix/testProjects",
"branchName": "combobox-web"
},
"scripts": {

Check failure on line 32 in packages/pluggableWidgets/combobox-web/package.json

View workflow job for this annotation

GitHub Actions / Run code quality check

Package scripts are not alphabetized
"start": "pluggable-widgets-tools start:server",

Check failure on line 33 in packages/pluggableWidgets/combobox-web/package.json

View workflow job for this annotation

GitHub Actions / Run code quality check

Delete `start":·"pluggable-widgets-tools·start:server",⏎········"dev":·"pluggable-widgets-tools·start:web",⏎········"`
"dev": "pluggable-widgets-tools start:web",
"prebuild": "rui-create-translation",
"build": "pluggable-widgets-tools build:web",
"create-gh-release": "rui-create-gh-release",
"create-translation": "rui-create-translation",
"dev": "pluggable-widgets-tools start:web",
"e2e": "run-e2e ci",

Check failure on line 39 in packages/pluggableWidgets/combobox-web/package.json

View workflow job for this annotation

GitHub Actions / Run code quality check

Insert `dev":·"pluggable-widgets-tools·start:web",⏎········"`
"e2edev": "run-e2e dev --with-preps",
"format": "pluggable-widgets-tools format",
"lint": "eslint src/ package.json",
"publish-marketplace": "rui-publish-marketplace",
"release": "pluggable-widgets-tools release:web",

Check failure on line 44 in packages/pluggableWidgets/combobox-web/package.json

View workflow job for this annotation

GitHub Actions / Run code quality check

Insert `",⏎········"start":·"pluggable-widgets-tools·start:server`
"start": "pluggable-widgets-tools start:server",
"test": "jest --projects jest.config.js",
"update-changelog": "rui-update-changelog-widget",
"verify": "rui-verify-package-format"
Expand All @@ -63,4 +64,4 @@
"@mendix/widget-plugin-test-utils": "workspace:*",
"cross-env": "^7.0.3"
}
}
}

Check failure on line 67 in packages/pluggableWidgets/combobox-web/package.json

View workflow job for this annotation

GitHub Actions / Run code quality check

Insert `⏎`
20 changes: 20 additions & 0 deletions packages/pluggableWidgets/combobox-web/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { join } = require("path");
const { cp, mkdir, rm } = require("shelljs");

const sourcePath = process.cwd();
const outDir = join(sourcePath, "/dist/tmp/widgets/");

module.exports = args => {
const result = args.configDefaultConfig;

const localesDir = join(outDir, "locales/");
mkdir("-p", localesDir);

const translationFiles = join(sourcePath, "dist/locales/**/*");
// copy everything under dist/locales to dist/tmp/widgets/locales for the widget mpk
cp("-r", translationFiles, localesDir);
// remove root level *.json locales files (duplicate with language specific files (e.g. en-US/*.json))
rm("-f", join(outDir, "locales/*.json"), localesDir);

return result;
};
Loading