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

Build and packaging with tsdx #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# name: CI
# on: [push]
# jobs:
# build:
# runs-on: ubuntu-latest

# steps:
# - name: Begin CI...
# uses: actions/checkout@v2

# - name: Use Node 12
# uses: actions/setup-node@v1
# with:
# node-version: 12.x

# - name: Use cached node_modules
# uses: actions/cache@v1
# with:
# path: node_modules
# key: nodeModules-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# nodeModules-

# - name: Install dependencies
# run: yarn install --frozen-lockfile
# env:
# CI: true

# - name: Lint
# run: yarn lint
# env:
# CI: true

# - name: Test
# run: yarn test --ci --coverage --maxWorkers=2
# env:
# CI: true

# - name: Build
# run: yarn build
# env:
# CI: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/node_modules

# Build output
/lib
/dist

# Logs and temp files
/tmp
Expand Down
31 changes: 25 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
"description": "Vuex Toolkit. An alternative API for Vuex.",
"version": "0.0.1",
"scripts": {
"clean": "rimraf lib",
"dev": "yarn clean && tsc --watch",
"build": "yarn clean && tsc"
"clean": "rimraf dist",
"dev": "yarn clean && tsdx watch",
"build": "yarn clean && tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "yarn build"
},
"dependencies": {
"lodash": "^4.17.19",
Expand All @@ -18,17 +21,33 @@
"devDependencies": {
"@redux-saga/types": "^1.1.0",
"@types/lodash": "^4.14.151",
"husky": "^4.2.5",
"redux": "4.x.x",
"rimraf": "^3.0.2",
"tsdx": "^0.13.2",
"tslib": "^2.0.0",
"typescript": "^3.9.7",
"vue": "2.x.x",
"vuex": "3.x.x"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"main": "dist/index.js",
"module": "dist/vuex-toolkit.esm.js",
"typings": "dist/index.d.ts",
"files": [
"/lib"
"/dist",
"/src"
],
"husky": {
"hooks": {
"pre-commit": "echo 'tsdx lint'"
}
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"author": "Georgii (Egor) Gorbachev <[email protected]>",
"license": "MIT",
"repository": "banderror/vuex-toolkit",
Expand Down
5 changes: 5 additions & 0 deletions test/foo.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('foo', () => {
it('works', () => {
expect(true).toEqual(true);
});
});
46 changes: 37 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
{
"include": ["src", "types"],
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"importHelpers": true,

"rootDir": "src",
"outDir": "lib",

"declaration": true,
"declarationMap": true,
"sourceMap": true,
"importHelpers": true,
"esModuleInterop": true,

"strict": true,
"noImplicitAny": false
},
"include": [
"src/**/*"
]
}
}

// {
// // "include": ["src", "types"],
// "compilerOptions": {
// // "module": "esnext",
// // "moduleResolution": "node",
// // "esModuleInterop": true
// // "importHelpers": true,

// // "rootDir": "./src",

// // "declaration": true,
// // "sourceMap": true,

// // "strict": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noImplicitReturns": true,
// "noFallthroughCasesInSwitch": true,

// "lib": ["dom", "esnext"],
// "baseUrl": "./",
// "paths": {
// "*": ["src/*", "node_modules/*"]
// },
// "jsx": "react",
// }
// }
Loading