Skip to content

Commit

Permalink
rework build system (#9710)
Browse files Browse the repository at this point in the history
Simplify `scripts/compile-references.js`. TypeScript Server now properly
understand TypeScript references for navigation, so we can simplify our
`tsconfig` setup.

Rewrite some `npm/yarn` scripts to do less on install (`yarn` or `yarn
install`). It will only run the required `prepare` scripts across our
packages, wire `tsconfig.json` files and build the TypeScript sources.

To build the example applications you need to run one of `yarn browser
build`, `yarn electron build` or `yarn build:examples`.

Linting is done as part of CI, but it won't automatically run locally
anymore. You can run `yarn lint` to lint your code. For the best
experience you should also enable the ESLint extension in your IDE.

Installation:

- `yarn` install deps and compile TypeScript.
- `yarn dowload:plugins` to install plugins.

Building:

- `yarn build` build TypeScript and both apps.
- `yarn compile` build TypeScript.
- `yarn browser build` build both TypeScript and the browser app.
- `yarn electron build` build both TypeScript and the electron app.
- `yarn build:examples` build both apps.

Watching:

- `yarn watch` watch TypeScript and both example apps.
- `yarn watch:ts` watch only TypeScript.
- `yarn browser watch` watch both TypeScript and the browser app.
- `yarn electron watch` watch both TypeScript and the electron app.

Linting:

- `yarn lint` lint TypeScript sources.
  • Loading branch information
paul-marechal authored Sep 21, 2021
1 parent a73a746 commit 23e09c2
Show file tree
Hide file tree
Showing 137 changed files with 3,878 additions and 2,519 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ jobs:
shell: bash
run: |
yarn --skip-integrity-check --network-timeout 100000
yarn lint
npx electron-replace-ffmpeg
npx electron-codecs-test
yarn build:examples
./scripts/check_git_status.sh
env:
NODE_OPTIONS: --max_old_space_size=4096
Expand All @@ -63,13 +65,13 @@ jobs:
if: matrix.tests != 'skip' && runner.os == 'Linux'
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test:browser
run: yarn browser test

- name: Test (electron)
if: matrix.tests != 'skip' && runner.os == 'Linux'
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test:electron
run: yarn electron test

publish:
needs: build
Expand Down Expand Up @@ -100,6 +102,7 @@ jobs:
- name: Pre-Publish
run: |
yarn --skip-integrity-check --network-timeout 100000
yarn compile
yarn docs
env:
NODE_OPTIONS: --max_old_space_size=4096
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ports:
- port: 9339 # Node.js debug port
onOpen: ignore
tasks:
- init: yarn --network-timeout 100000
- init: yarn --network-timeout 100000 && yarn build:examples
command: >
jwm &
yarn --cwd examples/browser start ../.. --hostname=0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [git] removed exports from namespace `defaultGutterStyles`, `maxWidth`, `continuationStyle`, `highlightStyle`). [#9999](https://github.com/eclipse-theia/theia/pull/9999)
- [task] `TaskDefinition.properties.required` is now optional to align with the specification [#10015](https://github.com/eclipse-theia/theia/pull/10015)
- [core] `setTopPanelVisibily` renamed to `setTopPanelVisibility` [#10020](https://github.com/eclipse-theia/theia/pull/10020)
- [application-manager] break `rebuild` API: second argument is now an optional object instead of an optional array.

## v1.17.2 - 9/1/2021

Expand Down
47 changes: 24 additions & 23 deletions configs/base.tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"compilerOptions": {
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"noImplicitAny": true,
"noEmitOnError": false,
"noImplicitThis": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"downlevelIteration": true,
"resolveJsonModule": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "ES2017",
"jsx": "react",
"lib": [
"ES2017",
"dom"
],
"sourceMap": true
}
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"noImplicitAny": true,
"noEmitOnError": false,
"noImplicitThis": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"downlevelIteration": true,
"resolveJsonModule": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "ES2017",
"jsx": "react",
"lib": [
"ES2017",
"dom"
],
"sourceMap": true
}
}
152 changes: 0 additions & 152 deletions configs/root-compilation.tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion dev-packages/application-manager/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
],
parserOptions: {
tsconfigRootDir: __dirname,
project: 'compile.tsconfig.json'
project: 'tsconfig.json'
},
rules: {
'import/no-dynamic-require': 'off'
Expand Down
Loading

0 comments on commit 23e09c2

Please sign in to comment.