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

refactor: use consistent build process across packages #3456

Merged
merged 30 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7bb8d01
fix: use consistent build process across packages
nolanlawson Apr 11, 2023
e0c903c
fix: newlines
nolanlawson Apr 11, 2023
393f07c
fix: pkg.json i did not mean to change
nolanlawson Apr 11, 2023
77c50d8
fix: add keywords back in
nolanlawson Apr 11, 2023
ae28f47
fix: typo in comment
nolanlawson Apr 11, 2023
afc0779
fix: fix rollup script
nolanlawson Apr 12, 2023
5a466c4
fix: remove "./" as it confuses npm during publishing
nolanlawson Apr 12, 2023
e93ee62
fix: tweak script
nolanlawson May 8, 2023
6229d5c
fix: no need for braces
nolanlawson May 8, 2023
11912aa
fix: add backwards compat
nolanlawson May 9, 2023
3a8ec8d
Merge remote-tracking branch 'origin/master' into nolan/package-reform-2
nolanlawson May 9, 2023
e83ff66
fix: backwards compat
nolanlawson May 9, 2023
6e1dc2c
fix: prefer named imports to default imports
nolanlawson May 9, 2023
2fbfb14
fix: add more backwards compat
nolanlawson May 9, 2023
31526df
fix: add more backwards compat
nolanlawson May 9, 2023
a9c17f6
fix: fix downstream version test
nolanlawson May 9, 2023
0672ad6
fix: refactor
nolanlawson May 9, 2023
e89c0ec
fix: string type cast
nolanlawson May 9, 2023
b3a0b20
fix: add autogenerated comment
nolanlawson May 9, 2023
d3c2f92
refactor: refactor rollup script
nolanlawson May 9, 2023
37269a6
refactor: refactor script
nolanlawson May 9, 2023
e65f997
fix: use node: prefix
nolanlawson May 9, 2023
d96251e
fix: simplify tsconfig
nolanlawson May 9, 2023
13af442
fix: simplify tsconfig
nolanlawson May 9, 2023
a0bf6df
fix: simplify tsconfig
nolanlawson May 9, 2023
3809231
fix: simplify tsconfig
nolanlawson May 9, 2023
8d23ba6
fix: typo
nolanlawson May 9, 2023
afaf07f
Merge remote-tracking branch 'origin/master' into nolan/package-reform-2
nolanlawson May 10, 2023
8e6ecb6
fix: switch to named import
nolanlawson May 11, 2023
089cd4a
fix: respond to PR comment
nolanlawson May 11, 2023
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
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ jobs:
- run:
name: Check missing file headers
command: node ./scripts/tasks/check-license-headers.js
- run:
name: Check package.json integrity
command: node ./scripts/tasks/check-and-rewrite-package-json.js --test
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should run as part of Husky, so it shouldn't get out of sync, but this is just a failsafe.

- run:
name: Check formatting
command: yarn prettier --check '{packages,scripts}/**/*.{js,ts,json,md}'
Expand Down
4 changes: 4 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@
},
"affected": {
"defaultBase": "master"
},
"namedInputs": {
"sharedGlobals": ["{workspaceRoot}/scripts/rollup/rollup.config.js"],
"default": ["{projectRoot}/**/*", "sharedGlobals"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tells NX that when this file changes, it should bust the cache

}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"lint-staged": "^13.2.1",
"magic-string": "^0.30.0",
"nx": "15.9.2",
"prettier": "^2.8.7",
"rollup": "^3.20.2",
Expand All @@ -67,7 +68,8 @@
},
"lint-staged": {
"**/*.{js,mjs,ts}": "eslint",
"{packages,scripts}/**/*.{js,mjs,ts,json,md}": "prettier --write"
"{packages,scripts}/**/*.{js,mjs,ts,json,md}": "prettier --write",
"packages/**/package.json": "node ./scripts/tasks/check-and-rewrite-package-json.js"
},
"workspaces": [
"packages/@lwc/*",
Expand Down
48 changes: 25 additions & 23 deletions packages/@lwc/aria-reflection/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{
"//": [
"THIS FILE IS AUTOGENERATED. If you modify it, it will be rewritten by check-and-rewrite-package-json.js",
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/aria-reflection",
"version": "2.45.2",
"description": "ARIA element reflection polyfill for strings",
"homepage": "https://lwc.dev/",
"keywords": [
"aom",
"aria",
"lwc",
"polyfill",
"reflection"
],
"homepage": "https://lwc.dev",
"repository": {
"type": "git",
"url": "https://github.com/salesforce/lwc.git",
Expand All @@ -11,39 +22,30 @@
"bugs": {
"url": "https://github.com/salesforce/lwc/issues"
},
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"license": "MIT",
"typings": "types/index.d.ts",
"scripts": {
"build": "rollup --config scripts/rollup.config.js",
"dev": "rollup --config scripts/rollup.config.js --watch --no-watch.clearScreen"
},
"files": [
"dist/",
"types/"
],
"keywords": [
"lwc",
"aria",
"polyfill",
"reflection",
"aom"
],
"publishConfig": {
"access": "public"
},
"dependencies": {
"@lwc/shared": "2.45.2"
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rollup --config ../../../scripts/rollup/rollup.config.js",
"dev": "rollup --config ../../../scripts/rollup/rollup.config.js --watch --no-watch.clearScreen"
},
"nx": {
"targets": {
"build": {
"outputs": [
"./dist",
"./types"
"dist"
]
}
}
},
"dependencies": {
"@lwc/shared": "2.45.2"
}
}
41 changes: 0 additions & 41 deletions packages/@lwc/aria-reflection/scripts/rollup.config.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/@lwc/aria-reflection/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../../tsconfig.json",

"compilerOptions": {
"outDir": ".",
"lib": ["dom", "es2018"]
},

Expand Down
51 changes: 28 additions & 23 deletions packages/@lwc/babel-plugin-component/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"//": [
"THIS FILE IS AUTOGENERATED. If you modify it, it will be rewritten by check-and-rewrite-package-json.js",
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/babel-plugin-component",
"version": "2.45.2",
"description": "Babel plugin to transform a LWC module",
"homepage": "https://lwc.dev/",
"keywords": [
"lwc"
],
"homepage": "https://lwc.dev",
"repository": {
"type": "git",
"url": "https://github.com/salesforce/lwc.git",
Expand All @@ -10,19 +18,29 @@
"bugs": {
"url": "https://github.com/salesforce/lwc/issues"
},
"version": "2.45.2",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"typings": "types/index.d.ts",
"license": "MIT",
"scripts": {
"build": "rollup --config scripts/rollup.config.js",
"dev": "rollup --config scripts/rollup.config.js --watch --no-watch.clearScreen"
"publishConfig": {
"access": "public"
},
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"types"
"dist"
],
"scripts": {
"build": "rollup --config ../../../scripts/rollup/rollup.config.js",
"dev": "rollup --config ../../../scripts/rollup/rollup.config.js --watch --no-watch.clearScreen"
},
"nx": {
"targets": {
"build": {
"outputs": [
"dist"
]
}
}
},
"dependencies": {
"@babel/helper-module-imports": "~7.21.4",
"@lwc/errors": "2.45.2",
Expand All @@ -35,18 +53,5 @@
},
"peerDependencies": {
"@babel/core": "^7"
},
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"outputs": [
"./dist",
"./types"
]
}
}
}
}
41 changes: 0 additions & 41 deletions packages/@lwc/babel-plugin-component/scripts/rollup.config.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/@lwc/babel-plugin-component/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../../tsconfig.json",

"compilerOptions": {
"outDir": ".",
"lib": ["es2018"]
},

Expand Down
46 changes: 27 additions & 19 deletions packages/@lwc/compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"//": [
"THIS FILE IS AUTOGENERATED. If you modify it, it will be rewritten by check-and-rewrite-package-json.js",
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
],
"name": "@lwc/compiler",
"version": "2.45.2",
"description": "LWC compiler",
"homepage": "https://lwc.dev/",
"keywords": [
"lwc"
],
"homepage": "https://lwc.dev",
"repository": {
"type": "git",
"url": "https://github.com/salesforce/lwc.git",
Expand All @@ -11,16 +18,29 @@
"bugs": {
"url": "https://github.com/salesforce/lwc/issues"
},
"main": "dist/commonjs/index.js",
"typings": "dist/types/index.d.ts",
"license": "MIT",
"scripts": {
"build": "tsc && node ./scripts/update-compiler-version.js",
"dev": "tsc --watch --preserveWatchOutput --incremental"
"publishConfig": {
"access": "public"
},
"main": "dist/index.cjs.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/"
"dist"
],
"scripts": {
"build": "rollup --config ../../../scripts/rollup/rollup.config.js",
"dev": "rollup --config ../../../scripts/rollup/rollup.config.js --watch --no-watch.clearScreen"
},
"nx": {
"targets": {
"build": {
"outputs": [
"dist"
]
}
}
},
"dependencies": {
"@babel/core": "~7.21.4",
"@babel/plugin-proposal-class-properties": "~7.18.6",
Expand All @@ -30,17 +50,5 @@
"@lwc/shared": "2.45.2",
"@lwc/style-compiler": "2.45.2",
"@lwc/template-compiler": "2.45.2"
},
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"outputs": [
"./dist"
]
}
}
}
}
2 changes: 1 addition & 1 deletion packages/@lwc/compiler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export {
OutputConfig,
} from './options';

export const version = '__VERSION__';
export const version = process.env.LWC_VERSION as string;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were already using process.env.LWC_VERSION elsewhere, so this is just being consistent.

2 changes: 1 addition & 1 deletion packages/@lwc/compiler/src/transformers/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DiagnosticLevel,
TransformerErrors,
} from '@lwc/errors';
import compile from '@lwc/template-compiler';
import { compile } from '@lwc/template-compiler';

import { NormalizedTransformOptions } from '../options';
import { TransformResult } from './transformer';
Expand Down
7 changes: 1 addition & 6 deletions packages/@lwc/compiler/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../../tsconfig.json",

"compilerOptions": {
"outDir": "dist/commonjs",
"declarationDir": "dist/types"
},

"include": ["src/", "typings/"]
"include": ["src/"]
}
Loading