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

[WTF-1799]: move external dependencies to devDependencies #84

Closed
Closed
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
8 changes: 8 additions & 0 deletions packages/pluggable-widgets-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- We moved Pluggable Widgets Tools dependencies marked as external in rollup configuration files to devDependencies in the package.json.

- We synced the version of @types/react package.

- We synced the versions of resolution and override packages.

## [10.7.1] - 2024-02-15

### Fixed
Expand Down
69 changes: 33 additions & 36 deletions packages/pluggable-widgets-tools/configs/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,35 @@ const assetsDirName = "assets";
const absoluteOutAssetsDir = join(absoluteOutPackageDir, assetsDirName);
const outAssetsDir = join(outWidgetDir, assetsDirName);

const imagesAndFonts = [
"**/*.svg",
"**/*.png",
"**/*.jp(e)?g",
"**/*.gif",
"**/*.webp",
"**/*.ttf",
"**/*.woff(2)?",
"**/*.eot"
];

const extensions = [".js", ".jsx", ".tsx", ".ts"];

const commonExternalLibs = [
// "mendix" and internals under "mendix/"
/^mendix($|\/)/,

// "react"
/^react$/,

// "react/jsx-runtime"
/^react\/jsx-runtime$/,

// "react-dom"
/^react-dom$/
];

const webExternal = [...commonExternalLibs, /^big.js$/];

legio-vi-ferrata marked this conversation as resolved.
Show resolved Hide resolved
/**
* This function is used by postcss-url.
* Its main purpose to "adjust" asset path so that
Expand Down Expand Up @@ -115,7 +144,7 @@ export default async args => {
file: join(outDir, `${widgetName}.editorPreview.js`),
sourcemap: !production ? "inline" : false
},
external: editorPreviewExternal,
external: commonExternalLibs,
plugins: [
postcss({
extensions: [".css", ".sass", ".scss"],
Expand All @@ -131,7 +160,7 @@ export default async args => {
extensions,
transpile: production,
babelConfig: { presets: [["@babel/preset-env", { targets: { safari: "12" } }]] },
external: editorPreviewExternal
external: commonExternalLibs
})
],
onwarn
Expand All @@ -147,7 +176,7 @@ export default async args => {
file: join(outDir, `${widgetName}.editorConfig.js`),
sourcemap: false
},
external: editorConfigExternal,
external: commonExternalLibs,
treeshake: { moduleSideEffects: false },
plugins: [
url({ include: ["**/*.svg"], limit: 143360 }), // SVG file size limit of 140 kB
Expand All @@ -156,7 +185,7 @@ export default async args => {
extensions,
transpile: true,
babelConfig: { presets: [["@babel/preset-env", { targets: { ie: "11" } }]] },
external: editorConfigExternal
external: commonExternalLibs
})
],
onwarn
Expand Down Expand Up @@ -306,38 +335,6 @@ export default async args => {
}
};

const extensions = [".js", ".jsx", ".tsx", ".ts"];
const imagesAndFonts = [
"**/*.svg",
"**/*.png",
"**/*.jp(e)?g",
"**/*.gif",
"**/*.webp",
"**/*.ttf",
"**/*.woff(2)?",
"**/*.eot"
];

const commonExternalLibs = [
// "mendix" and internals under "mendix/"
/^mendix($|\/)/,

// "react"
/^react$/,

// "react/jsx-runtime"
/^react\/jsx-runtime$/,

// "react-dom"
/^react-dom$/
];

const webExternal = commonExternalLibs.concat(/^big.js$/);

const editorPreviewExternal = commonExternalLibs;

const editorConfigExternal = commonExternalLibs;

export function postCssPlugin(outputFormat, production, postcssPlugins = []) {
return postcss({
extensions: [".css", ".sass", ".scss"],
Expand Down
60 changes: 30 additions & 30 deletions packages/pluggable-widgets-tools/configs/rollup.config.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ const outWidgetFile = join(widgetPackage.replace(/\./g, "/"), widgetName.toLower
const mpkDir = join(sourcePath, "dist", widgetVersion);
const mpkFile = join(mpkDir, process.env.MPKOUTPUT ? process.env.MPKOUTPUT : `${widgetPackage}.${widgetName}.mpk`);

const extensions = [".js", ".jsx", ".tsx", ".ts"];

const editorConfigExternal = [
// "mendix" and internals under "mendix/"
/^mendix($|\/)/,

// "react"
/^react$/,

// "react/jsx-runtime"
/^react\/jsx-runtime$/,

// "react-dom"
/^react-dom$/
];

const nativeExternal = [
/^mendix($|\/)/,
/^react-native($|\/)/,
/^big.js$/,
/^react($|\/)/,
/^react-native-gesture-handler($|\/)/,
/^react-native-reanimated($|\/)/,
/^react-native-fast-image($|\/)/,
/^react-native-svg($|\/)/,
/^react-native-vector-icons($|\/)/,
/^react-navigation($|\/)/,
/^react-native-safe-area-context($|\/)/
];

legio-vi-ferrata marked this conversation as resolved.
Show resolved Hide resolved
export default async args => {
const production = Boolean(args.configProduction);

Expand Down Expand Up @@ -250,33 +280,3 @@ export default async args => {
}
}
};

const extensions = [".js", ".jsx", ".tsx", ".ts"];

const editorConfigExternal = [
// "mendix" and internals under "mendix/"
/^mendix($|\/)/,

// "react"
/^react$/,

// "react/jsx-runtime"
/^react\/jsx-runtime$/,

// "react-dom"
/^react-dom$/
];

const nativeExternal = [
/^mendix($|\/)/,
/^react-native($|\/)/,
/^big.js$/,
/^react($|\/)/,
/^react-native-gesture-handler($|\/)/,
/^react-native-reanimated($|\/)/,
/^react-native-fast-image($|\/)/,
/^react-native-svg($|\/)/,
/^react-native-vector-icons($|\/)/,
/^react-navigation($|\/)/,
/^react-native-safe-area-context($|\/)/
];
Loading
Loading