Skip to content

Commit

Permalink
[WIP] refactor build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Apr 11, 2024
1 parent c88a7d5 commit 2fdad6c
Show file tree
Hide file tree
Showing 22 changed files with 703 additions and 803 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**/config/**
**/build/**
**/npm/**
!scripts/npm/**
**/*.js.flow
**/*.d.ts
**/playwright*/**
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module.exports = {
// node scripts should be console logging so don't lint against that
files: ['scripts/**/*.js'],
rules: {
// https://github.com/Stuk/eslint-plugin-header/issues/39
'header/header': OFF,
'no-console': OFF,
},
},
Expand Down
25 changes: 8 additions & 17 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,15 @@ const fs = require('fs-extra');
* Currently this alias map points at the cjs version of the build product,
* as that is what was measured previously in #3600.
*/
const packagesManager = require('./scripts/shared/packagesManager');
const alias = Object.fromEntries(
glob('./packages/*/package.json', {sync: true}).flatMap((fn) => {
const pkg = fs.readJsonSync(fn);
if (!pkg.private) {
return Object.entries(pkg.exports).flatMap(([k, v]) => {
if (k.endsWith('.js')) {
return [];
}
return [
[
`${pkg.name}${k.replace(/^\.(\/$)?/, '')}`,
path.resolve(path.dirname(fn), 'dist', v.require.default),
],
];
});
}
return [];
}),
packagesManager
.getPublicPackages()
.flatMap((pkg) =>
pkg
.getNormalizedNpmModuleExportEntries()
.map(([k, v]) => [k, pkg.resolve('dist', v.require.default)]),
),
);

const extendConfig = {resolve: {alias}};
Expand Down
8 changes: 4 additions & 4 deletions examples/react-rich/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^5.1.4",
"@vitejs/plugin-react": "^4.2.1",
"@types/react": "^18.2.59",
"@types/react-dom": "^18.2.19"
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"typescript": "^5.2.2",
"vite": "^5.1.4"
}
}
124 changes: 23 additions & 101 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions packages/lexical-devtools-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"utils"
],
"license": "MIT",
"version": "0.14.2",
"version": "0.14.3",
"main": "LexicalDevtoolsCore.js",
"types": "index.d.ts",
"dependencies": {
"lexical": "0.14.2",
"@lexical/utils": "0.14.2",
"@lexical/table": "0.14.2",
"@lexical/html": "0.14.2",
"@lexical/mark": "0.14.2",
"@lexical/link": "0.14.2"
"@lexical/html": "0.14.3",
"@lexical/link": "0.14.3",
"@lexical/mark": "0.14.3",
"@lexical/table": "0.14.3",
"@lexical/utils": "0.14.3",
"lexical": "0.14.3"
},
"peerDependencies": {
"react": ">=17.x",
Expand All @@ -34,11 +34,15 @@
".": {
"import": {
"types": "./index.d.ts",
"development": "./LexicalDevtoolsCore.dev.mjs",
"production": "./LexicalDevtoolsCore.prod.mjs",
"node": "./LexicalDevtoolsCore.node.mjs",
"default": "./LexicalDevtoolsCore.mjs"
},
"require": {
"types": "./index.d.ts",
"development": "./LexicalDevtoolsCore.dev.js",
"production": "./LexicalDevtoolsCore.prod.js",
"default": "./LexicalDevtoolsCore.js"
}
}
Expand Down
16 changes: 8 additions & 8 deletions packages/lexical-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@lexical/devtools",
"description": "Lexical DevTools browser extension",
"private": true,
"version": "0.0.0",
"version": "0.14.3",
"type": "module",
"scripts": {
"dev": "wxt",
Expand All @@ -15,21 +15,21 @@
"postinstall": "wxt prepare"
},
"dependencies": {
"@eduardoac-skimlinks/webext-redux": "3.0.1-release-candidate",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@eduardoac-skimlinks/webext-redux": "3.0.1-release-candidate",
"zustand": "^4.5.1",
"webext-bridge": "~6.0.1"
"webext-bridge": "~6.0.1",
"zustand": "^4.5.1"
},
"devDependencies": {
"@lexical/devtools-core": "0.14.3",
"@rollup/plugin-babel": "^6.0.4",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"lexical": "0.14.3",
"typescript": "^5.3.3",
"lexical": "0.14.2",
"@lexical/devtools-core": "0.14.2",
"wxt": "^0.17.0",
"vite": "^5.2.2",
"@rollup/plugin-babel": "^6.0.4"
"wxt": "^0.17.0"
}
}
2 changes: 1 addition & 1 deletion packages/lexical-website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lexical/website",
"version": "0.0.0",
"version": "0.14.3",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
Loading

0 comments on commit 2fdad6c

Please sign in to comment.