Skip to content

Commit

Permalink
Update tsconfig to use ES6, add troubleshooting in README
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Apr 7, 2024
1 parent 8e378d2 commit d967779
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.repository != 'wikimedia-gadgets/twinkle-starter' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm run lint
- run: npm run build
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ Do check regularly for new twinkle-core releases, since dependabot wouldn't be a

</details>

## Troubleshooting
- Getting `JavaScript parse error (scripts need to be valid ES5)` after deploying the output of `grunt build`:
- This is because your wiki doesn't support ES6 for JavaScript (only supported in MW 1.42+). Please change the `target` field in `webpack.config.js` and `tsconfig.json` files from `es6` to `es5`.

## Need help?

Channels for reporting issues or seeking help include:
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/docker/main.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docker-compose up --detach --build
docker compose up --detach --build
sleep 15 # need to give some time for the database to start working properly

docker exec docker_mediawiki_1 bash /var/www/html/setup.sh
docker compose exec mediawiki bash /var/www/html/setup.sh
10 changes: 4 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
/* Visit https://aka.ms/tsconfig.json to read more about this file */
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
"target": "ES5",
"module": "ES2020",
"target": "es6",
"module": "es2020",
"lib": [
"dom",
"es5",
"es2015.collection"
// Only Map and Set from this are supported in IE 11.
"es6",
],
"outDir": "./build",
"sourceMap": true,
Expand Down

0 comments on commit d967779

Please sign in to comment.