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

build: add typescript project references #4055

Merged
merged 22 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ac079d0
build: add typescript project references
Apr 21, 2022
b70f3c6
test: add check for typescript proj refs
Apr 21, 2022
25a4eae
build: add compile scripts, fix tsconfig in packages
Apr 21, 2022
bf7f9cd
refactor: extract common tsconfig into common config
Apr 21, 2022
a25d302
build: add post compile step to deal with JS files and test artifacts
Apr 22, 2022
a6828fa
build: add tsconfig for node 14
Apr 22, 2022
580495b
refactor: common tsconfig to reuse node 14 base config
Apr 22, 2022
9d7556b
refactor: remove tsc clean from existing clean script
Apr 22, 2022
c66653a
docs: add info about new compile scripts
Apr 22, 2022
2dae190
fix(compile): add packages that use webpack to compile step
Apr 22, 2022
14ee6d6
fix: add separate tsconfig for ts-loader / webpack
Apr 23, 2022
b27f02c
fix(soql): add tsconfig for webpack / ts-loader
Apr 23, 2022
352d068
Merge branch 'develop' into mohanraj-r/typescript-project-ref-enable
mohanraj-r Apr 23, 2022
3d61170
build: revert to es6 target in tsconfig
Apr 23, 2022
3dec188
build: refactor post compile webpack and file copy steps
Apr 25, 2022
cff7b38
docs: update info about limitations of compile watch mode
Apr 25, 2022
c076518
refactor: remove unnecessary tsconfig webpack config files
Apr 25, 2022
6e7e80b
docs: link work items to TODO items
Apr 26, 2022
6cfd6bc
Merge branch 'develop' into mohanraj-r/typescript-project-ref-enable
Apr 26, 2022
761cd60
docs: update comment about copying js files
Apr 26, 2022
25bfccf
Merge branch 'develop' into mohanraj-r/typescript-project-ref-enable
May 3, 2022
58e53fd
Merge branch 'develop' into mohanraj-r/typescript-project-ref-enable
mohanraj-r May 3, 2022
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
337 changes: 337 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@monorepo-utils/workspaces-to-typescript-project-references": "2.7.6",
"@octokit/core": "3.6.0",
"@salesforce/dev-config": "1.6.0",
"@tsconfig/node14": "1.0.1",
"acorn": "6.4.2",
"ajv": "6.12.6",
"check-peer-dependencies": "4.1.0",
Expand Down Expand Up @@ -42,14 +44,17 @@
"webpack-cli": "3.3.12"
},
"scripts": {
"postinstall": "lerna bootstrap --no-ci -- --no-package-lock && node scripts/reformat-with-prettier && npm run check:peer-deps",
"postinstall": "lerna bootstrap --no-ci -- --no-package-lock && node scripts/reformat-with-prettier && npm run check:peer-deps && npm run check:typescript-project-references",
"bootstrap": "lerna bootstrap --no-ci -- --no-package-lock && node scripts/reformat-with-prettier",
"circleci:artifacts": "node scripts/download-vsix-from-circleci.js",
"commit-init": "commitizen init cz-conventional-changelog --save-dev --save-exact --force",
"commit": "git-cz",
"clean": "lerna run clean && git clean -xfd",
"reinstall": "rm -f package-lock.json && npm run clean && npm install",
"compile": "lerna run --stream compile",
"compile": "tsc --build",
"postcompile": "shx cp packages/salesforcedx-visualforce-markup-language-server/src/beautify/beautify-* packages/salesforcedx-visualforce-markup-language-server/out/src/beautify && shx cp -R packages/salesforcedx-visualforce-language-server/test/unit/fixtures packages/salesforcedx-visualforce-language-server/out/test/unit",
"compile:clean": "tsc --build --clean && npm run compile",
"compile:watch": "tsc --build --watch",
mohanraj-r marked this conversation as resolved.
Show resolved Hide resolved
"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
"publish": "node scripts/publish-circleci.js",
Expand All @@ -68,6 +73,7 @@
"check:links": "find . -name \\*.md -not -path '*/node_modules/*' -print0 | xargs -0 -n1 npx markdown-link-check --quiet --alive 200,206,429",
"check:deps": "lerna exec --no-bail --stream depcheck",
"check:peer-deps": "check-peer-dependencies",
"check:typescript-project-references": "workspaces-to-typescript-project-references --includesRoot --check",
"vscode:package": "lerna exec --scope @salesforce/salesforcedx-* -- npm prune --production && lerna run vscode:package --concurrency 1 && node scripts/reformat-with-prettier",
"vscode:sha256": "lerna run vscode:sha256 --concurrency 1",
"vscode:publish": "lerna run vscode:publish --concurrency 1",
Expand Down
25 changes: 14 additions & 11 deletions packages/salesforcedx-apex-debugger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es2016"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-utils-vscode"
},
{
"path": "../salesforcedx-test-utils-vscode"
}
]
}
21 changes: 11 additions & 10 deletions packages/salesforcedx-apex-replay-debugger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["es2016", "dom"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-utils-vscode"
}
]
}
19 changes: 8 additions & 11 deletions packages/salesforcedx-sobjects-faux-generator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es2016"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"resolveJsonModule": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"strict": true
"resolveJsonModule": true
},
"exclude": ["node_modules", "out"]
"include": ["src/**/*","src/data/*.json", "test/**/*"],
"exclude": [
"node_modules",
"out"
],
"references": []
}
20 changes: 10 additions & 10 deletions packages/salesforcedx-test-utils-vscode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["es6", "dom"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"strict": true
},
"exclude": ["node_modules", "out"]
"exclude": [
"node_modules",
"out"
],
"references": [
{
"path": "../salesforcedx-utils-vscode"
}
]
}
21 changes: 9 additions & 12 deletions packages/salesforcedx-utils-vscode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["es6", "dom"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"strict": true,
"skipLibCheck": true,
"typeRoots": [ "node_modules/@types" ]
"typeRoots": [
"node_modules/@types"
]
},
"exclude": ["node_modules", "out"]
"exclude": [
"node_modules",
"out"
],
"references": []
}
20 changes: 13 additions & 7 deletions packages/salesforcedx-visualforce-language-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es2016"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true
"strict": false,
"noImplicitAny": false
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-visualforce-markup-language-server"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es6"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true
"strict": false,
"noImplicitAny": false,
// Generating Type Definitions from Javascript is blocked by requiring private name
// https://github.com/microsoft/TypeScript/issues/37832
// "allowJs": true, // for the beautify js files
Copy link
Contributor

Choose a reason for hiding this comment

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

would we ever uncomment this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are about a half-dozen failures in a couple of packages due to this check. So yes if we can clean them up we can have this enabled. Another way is to have this only in the packages that are failing and have it enabled globally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a WI and linked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry misread as question about noUnusedLocals in the tsconfig common json.
For allowJs guess as long as we have the beautify JS src files checked in (not sure if there is a third party lib that can be imported instead that has been created since) and the TSC issue is open. This is in case someone wonders why are the JS files being copied over instead of being run through tsc. Updated comment.

},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": []
}
25 changes: 14 additions & 11 deletions packages/salesforcedx-vscode-apex-debugger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es2016"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-apex-debugger"
},
{
"path": "../salesforcedx-test-utils-vscode"
}
]
}
28 changes: 17 additions & 11 deletions packages/salesforcedx-vscode-apex-replay-debugger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["es2016", "dom"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-apex-replay-debugger"
},
{
"path": "../salesforcedx-utils-vscode"
},
{
"path": "../salesforcedx-test-utils-vscode"
}
]
}
25 changes: 14 additions & 11 deletions packages/salesforcedx-vscode-apex/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es6"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-utils-vscode"
},
{
"path": "../salesforcedx-test-utils-vscode"
}
]
}
28 changes: 17 additions & 11 deletions packages/salesforcedx-vscode-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": ["dom", "es2016"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
"rootDir": ".",
"outDir": "out",
"preserveConstEnums": true,
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules", ".vscode-test", "out"]
"exclude": [
"node_modules",
".vscode-test",
"out"
],
"references": [
{
"path": "../salesforcedx-sobjects-faux-generator"
},
{
"path": "../salesforcedx-utils-vscode"
},
{
"path": "../salesforcedx-test-utils-vscode"
}
]
}
Loading