Skip to content

Commit

Permalink
Ready to use Preact
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Oct 24, 2018
1 parent 91122a5 commit 3fcd673
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 9 deletions.
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ module.exports = {
plugins: [
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
[
'@babel/plugin-transform-react-jsx',
{
pragma: 'h',
},
],
],
}
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { jestPreset } = require('ts-jest')

module.exports = {
collectCoverageFrom: ['src/**/*.ts'],
collectCoverageFrom: ['src/**/*.ts', 'src/**/*.tsx'],
coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
coverageThreshold: { global: { lines: 95 } },
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['jest-plugin-context/setup'],
transform: jestPreset.transform,
testEnvironment: 'jsdom',
testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]s$',
testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]sx?$',
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"build": "yarn --silent clean && cpx \"./public/**/*\" ./dist && webpack --env.production",
"check-ts": "tsc",
"clean": "rimraf dist",
"format": "prettier \"**/*.{css,js,json,md,scss,ts,yaml,yml}\"",
"format": "prettier \"**/*.{css,js,jsx,json,md,scss,ts,tsx,yaml,yml}\"",
"format:check": "yarn --silent format -l",
"format:write": "yarn --silent format --write",
"lint:css": "stylelint \"style/**/*.{css,scss}\"",
"lint:ts": "tslint \"{src,test}/**/*.ts\"",
"lint:ts": "tslint \"{src,test}/**/*.{ts,tsx}\"",
"preversion": "npm-run-all --npm-path yarn --parallel check-ts format:check lint:* test:coverage",
"start": "yarn --silent watch",
"test": "jest",
Expand All @@ -41,6 +41,7 @@
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-typescript": "^7.1.0",
"@types/jest": "^23.3.5",
Expand Down Expand Up @@ -85,6 +86,7 @@
"@marp-team/marp-core": "^0.0.12",
"incremental-dom": "^0.5.1",
"markdown-it-incremental-dom": "^2.0.1",
"preact": "^8.3.1",
"uuid": "^3.3.2"
},
"resolutions": {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"esModuleInterop": true,
"jsx": "preserve",
"lib": ["es2016", "es2017", "dom"],
"module": "es6",
"moduleResolution": "node",
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module.exports = env => {
module: {
rules: [
{
test: /\.[jt]s$/,
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.worker\.[jt]s$/,
test: /\.worker\.[jt]sx?$/,
exclude: /node_modules/,
loader: ['worker-loader', 'babel-loader'],
},
Expand Down Expand Up @@ -63,7 +63,7 @@ module.exports = env => {
'node_modules/js-yaml/dist/js-yaml.min.js'
),
},
extensions: ['.ts', '.js'],
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
}
}
31 changes: 30 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
"@babel/helper-explode-assignable-expression" "^7.1.0"
"@babel/types" "^7.0.0"

"@babel/helper-builder-react-jsx@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0.tgz#fa154cb53eb918cf2a9a7ce928e29eb649c5acdb"
integrity sha512-ebJ2JM6NAKW0fQEqN8hOLxK84RbRz9OkUhGS/Xd5u56ejMfVbayJ4+LykERZCOUM6faa6Fp3SZNX3fcT16MKHw==
dependencies:
"@babel/types" "^7.0.0"
esutils "^2.0.0"

"@babel/helper-call-delegate@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz#6a957f105f37755e8645343d3038a22e1449cc4a"
Expand Down Expand Up @@ -293,6 +301,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-syntax-jsx@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0.tgz#034d5e2b4e14ccaea2e4c137af7e4afb39375ffd"
integrity sha512-PdmL2AoPsCLWxhIr3kG2+F9v4WH06Q3z+NoGVpQgnUNGcagXHq5sB3OXxkSahKq9TLdNMN/AJzFYSOo8UKDMHg==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-syntax-object-rest-spread@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz#37d8fbcaf216bd658ea1aebbeb8b75e88ebc549b"
Expand Down Expand Up @@ -476,6 +491,15 @@
"@babel/helper-get-function-arity" "^7.0.0"
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-transform-react-jsx@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.0.0.tgz#524379e4eca5363cd10c4446ba163f093da75f3e"
integrity sha512-0TMP21hXsSUjIQJmu/r7RiVxeFrXRcMUigbKu0BLegJK9PkYodHstaszcig7zxXfaBji2LYUdtqIkHs+hgYkJQ==
dependencies:
"@babel/helper-builder-react-jsx" "^7.0.0"
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-jsx" "^7.0.0"

"@babel/plugin-transform-regenerator@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz#5b41686b4ed40bef874d7ed6a84bdd849c13e0c1"
Expand Down Expand Up @@ -2954,7 +2978,7 @@ esutils@^1.1.6:
resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375"
integrity sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=

esutils@^2.0.2:
esutils@^2.0.0, esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=
Expand Down Expand Up @@ -6968,6 +6992,11 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.2, postcss@^7.0.5:
source-map "^0.6.1"
supports-color "^5.5.0"

preact@^8.3.1:
version "8.3.1"
resolved "https://registry.yarnpkg.com/preact/-/preact-8.3.1.tgz#ed34f79d09edc5efd32a378a3416ef5dc531e3ac"
integrity sha512-s8H1Y8O9e+mOBo3UP1jvWqArPmjCba2lrrGLlq/0kN1XuIINUbYtf97iiXKxCuG3eYwmppPKnyW2DBrNj/TuTg==

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down

0 comments on commit 3fcd673

Please sign in to comment.