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

Refactor to Typescript #92

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintrc.js

This file was deleted.

11 changes: 0 additions & 11 deletions .flowconfig

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/ts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Typescript CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 15.x
- run: yarn install
- run: yarn test

build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 15.x
- run: yarn install
- run: yarn build

format:
runs-on: ubuntu-latest
name: Format
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 15.x
- run: yarn install
- run: yarn ts:format:check
Empty file removed .gitplaceholder
Empty file.
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

31 changes: 0 additions & 31 deletions .size-snapshot.json

This file was deleted.

17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

11 changes: 9 additions & 2 deletions ava.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ export default {
failWithoutAssertions: true,
verbose: true,
files: [
'src/*.test.js',
'src/*.test.*',
],
extensions: [
'ts',
'tsx',
],
require: [
'@babel/register',
'ts-node/register',
],
environmentVariables: {
'TS_NODE_PROJECT': './tsconfig.test.json',
}
};
8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

69 changes: 15 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,21 @@
"name": "theming",
"version": "3.3.0",
"description": "Unified CSSinJS theming solution for React",
"main": "dist/theming.cjs.js",
"main": "dist/index.js",
"module": "dist/theming.esm.js",
"typings": "./src/index.d.ts",
"typings": "./dist/index.d.ts",
"files": [
"src",
"dist"
],
"engines": {
"node": ">=8"
"node": ">=12.20"
},
"scripts": {
"lint": "eslint .",
"flow": "flow check --max-warnings 0",
"ts-check": "tsc",
"test": "ava",
"tdd": "yarn test --watch",
"coverage": "nyc yarn test",
"coveralls": "yarn coverage && coveralls < coverage/lcov.info",
"prebuild": "rimraf dist",
"build": "rollup -c",
"prepare": "yarn build",
"match-snapshot": "SNAPSHOT=match rollup -c"
},
"nyc": {
"include": [
"src"
],
"exclude": [
"src/*test*"
],
"all": true,
"cache": true,
"reporter": [
"lcov",
"text"
]
"build": "tsdx build",
"ts:format": "prettier src/* --write",
"ts:format:check": "prettier src/* --check"
},
"repository": {
"type": "git",
Expand All @@ -59,43 +38,25 @@
},
"homepage": "https://github.com/cssinjs/theming#readme",
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/react": "^16.4.18",
"ava": "^1.0.0-rc.1",
"babel-plugin-dev-expression": "^0.2.1",
"coveralls": "^3.0.0",
"eslint": "^5.8.0",
"eslint-config-jss": "^5.0.1",
"eslint-config-prettier": "^4.2.0",
"flow-bin": "^0.131.0",
"nyc": "^13.1.0",
"@types/react-test-renderer": "^16.9.1",
"@types/sinon": "^10.0.0",
"ava": "^4.0.0-alpha.2",
"react": "^16.8.0",
"react-test-renderer": "^16.8.0",
"rimraf": "^2.6.1",
"rollup": "^0.66.6",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-replace": "^2.1.0",
"rollup-plugin-size-snapshot": "^0.7.0",
"rollup-plugin-uglify": "^6.0.0",
"sinon": "^7.1.1",
"typescript": "^3.1.6"
"sinon": "^10.0.0",
"ts-node": "^9.1.1",
"tsdx": "^0.14.1",
"typescript": "^4.2.4"
},
"dependencies": {
"hoist-non-react-statics": "^3.3.0",
"prop-types": "^15.5.8",
"react-display-name": "^0.2.4",
"tiny-warning": "^1.0.2"
},
"peerDependencies": {
"react": ">=16.3"
"react": ">=16.7"
}
}
12 changes: 12 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
printWidth: 80,
trailingComma: "all",
tabWidth: 2,
semi: true,
singleQuote: true,
quoteProps: "as-needed",
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: "avoid",
endOfLine: "lf"
}
113 changes: 0 additions & 113 deletions rollup.config.js

This file was deleted.

Loading