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

Use downlevel-dts, test compile in TS 3.4 #936

Merged
merged 3 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
29 changes: 29 additions & 0 deletions .github/workflows/test_old_compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build in TSC 3.4

on: [push, pull_request]


jobs:
build_old:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: NPM install
run: npm ci

- name: Build
run: npm run build

- name: Install typescript@~3.4
run: npm install typescript@~3.4

- name: Print TypeScript version
run: npx tsc --version

- name: Type check .d.ts files
run: npx tsc ts3.4/lit-element.d.ts --noEmit -t esnext --moduleResolution Node
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules/
/lib/
/ts3.4/**/*.d.ts

#Compiler Output
lit-element.js
Expand Down
9 changes: 9 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
docs/
.travis.yml
check-version-tracker.js
rollup.config.js
tslint.json
tsconfig_apidoc.json
wct.conf.json
.vscode/
.github/
.clang-format
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"/lit-element.js.map"
],
"scripts": {
"build": "tsc",
"build": "tsc && downlevel-dts . ts3.4",
"build:babel-test": "babel src/test/lib/decorators_test.ts --out-file test/lib/decorators-babel_test.js",
"gen-docs": "typedoc --readme docs/_api/api-readme.md --tsconfig tsconfig_apidoc.json --mode modules --theme docs/_api/theme --excludeNotExported --excludePrivate --ignoreCompilerErrors --exclude '{**/*test*,**/node_modules/**,**/test/**}' --out ./docs/api --gaID UA-39334307-23 src/**/*.ts",
"test": "npm run build && npm run build:babel-test && wct",
Expand All @@ -46,6 +46,7 @@
"@webcomponents/webcomponentsjs": "^2.2.3",
"chai": "^4.0.2",
"clang-format": "^1.2.4",
"downlevel-dts": "^0.4.0",
"lit-element-benchmarks": "^0.1.0",
"mocha": "^6.2.2",
"np": "^5.2.1",
Expand All @@ -56,12 +57,19 @@
"tachometer": "^0.4.16",
"tslint": "^5.20.1",
"typedoc": "^0.14.2",
"typescript": "^3.8.2",
"typescript": "~3.8.2",
"uglify-es": "^3.3.9",
"wct-mocha": "^1.0.0",
"web-component-tester": "^6.9.2"
},
"typings": "lit-element.d.ts",
"typesVersions": {
"<3.8": {
"*": [
"ts3.4/*"
]
}
},
"dependencies": {
"lit-html": "^1.1.1"
},
Expand Down
28 changes: 28 additions & 0 deletions ts3.4/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es2017",
"module": "es2015",
"moduleResolution": "node",
"lib": ["esnext.array", "esnext", "es2017", "dom"],
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"inlineSources": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitThis": true,
"outDir": "./",
// Only necessary because @types/uglify-js can't find types for source-map
"skipLibCheck": true,
"experimentalDecorators": true
},
"include": [
"custom_typings/**/*.ts",
"src/**/*.ts"
],
"exclude": []
}