Skip to content

Commit

Permalink
TypeScript proof-of-concept
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Mar 2, 2022
1 parent 5a62f9f commit 8284d0b
Show file tree
Hide file tree
Showing 36 changed files with 426 additions and 65 deletions.
4 changes: 3 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.git
.github
.husky
.idea
.storybook
.wordpress-org
Expand Down Expand Up @@ -65,6 +66,7 @@ README.md
rollup.config.js
scoper.inc.php
SECURITY.md
tsconfig.json
tsconfig.shared.json
webpack.config.cjs
webpack.config.test.cjs
.husky
28 changes: 27 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@
"^@googleforcreators\\/(.*)\\/(.*)": "./packages/$1/src/$2",
"^@googleforcreators\\/(.*)": "./packages/$1/src/",
"^@web-stories-wp\\/(.*)": "./packages/$1/src/"
}
},
"extensions": [ ".js", ".jsx", ".ts", ".tsx" ]
}
},
"jsdoc": {
Expand Down Expand Up @@ -281,6 +282,31 @@
]
},
"overrides": [
{
"files": [
"**/*.ts",
"**/*.tsx"
],
"excludedFiles": [
"**/*.d.ts"
],
"extends": [
"plugin:@typescript-eslint/eslint-recommended"
],
"plugins": [
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"rules": {
"no-duplicate-imports": "off",
"@typescript-eslint/no-duplicate-imports": "error",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",
"no-unused-vars": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
}
},
{
"files": [
"__mocks__/**/*.js",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
branches:
- main
- release/*
Expand All @@ -14,6 +15,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
# The branches below must be a subset of the branches above
branches:
- main
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-css-js-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**.css'
- 'packages/**/*.md'
- '.eslint*'
Expand All @@ -24,6 +25,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**.css'
- 'packages/**/*.md'
- '.eslint*'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'web-stories.php'
Expand All @@ -14,6 +16,8 @@ on:
pull_request:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'web-stories.php'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests-karma-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand All @@ -23,6 +24,7 @@ on:
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests-karma-editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.cjs'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand All @@ -26,6 +27,7 @@ on:
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.cjs'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests-unit-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
# Only run if JS-related files changed.
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'packages/templates/src/raw/**'
Expand All @@ -17,6 +19,8 @@ on:
# Only run if JS-related files changed.
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'packages/templates/src/raw/**'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
/packages/migration/scripts/module.js
/packages/*/dist
/packages/*/dist-module
/packages/*/dist-types
/build
/bin/build
/bin/local-env/data
Expand All @@ -21,3 +22,4 @@ phpcs.xml
phpunit.xml
.phpunit.result.cache
/packages/*/package-lock.json
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"exports",
"main",
"module",
"types",
"source",
"publishConfig",
"sideEffects",
Expand Down
1 change: 1 addition & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = function (api) {
development: !isProduction,
},
],
'@babel/preset-typescript',
],
plugins: [
'@wordpress/babel-plugin-import-jsx-pragma',
Expand Down
Loading

0 comments on commit 8284d0b

Please sign in to comment.