Skip to content

Commit

Permalink
refactor: use consistent build process across packages (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored May 11, 2023
1 parent ed73fca commit cfb0424
Show file tree
Hide file tree
Showing 62 changed files with 752 additions and 903 deletions.
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
- 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"]
}
}
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;
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

0 comments on commit cfb0424

Please sign in to comment.