Skip to content

Commit

Permalink
refactor: adapt to new libs
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 22, 2020
1 parent cf2553b commit d42e6a3
Show file tree
Hide file tree
Showing 22 changed files with 1,112 additions and 653 deletions.
20 changes: 0 additions & 20 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverage.lcov
dist
package-lock.json
.DS_Store
temp
12 changes: 2 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
{
"[javascript]": {
"editor.formatOnSave": false
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": false
"editor.formatOnSave": true
},
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
{ "language": "typescript", "autoFix": true }
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
5 changes: 0 additions & 5 deletions __tests__/.eslintrc.js

This file was deleted.

14 changes: 1 addition & 13 deletions __tests__/pinia/stores/cart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createStore } from '../../../src'
import { useUserStore, UserStore } from './user'
import { PiniaStore, ExtractGettersFromStore } from 'src/store'
import { useUserStore } from './user'

export const useCartStore = createStore({
id: 'cart',
Expand All @@ -25,17 +24,6 @@ export const useCartStore = createStore({

export type CartStore = ReturnType<typeof useCartStore>

// const a: PiniaStore<{
// u: UserStore
// c: CartStore
// }>

// a.cart

// const getters: ExtractGettersFromStore<CartStore>

// getters.items

export function addItem(name: string) {
const store = useCartStore()
store.state.rawItems.push(name)
Expand Down
1 change: 1 addition & 0 deletions __tests__/pinia/stores/combined.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck TODO: implement it or do something different for combined stores
import { useUserStore } from './user'
import { useCartStore } from './cart'
import { pinia, CombinedState } from '../../../src/pinia'
Expand Down
2 changes: 1 addition & 1 deletion __tests__/pinia/stores/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createStore, WrapStoreWithId } from 'src/store'
import { createStore } from 'src/store'

function apiLogin(a: string, p: string) {
if (a === 'ed' && p === 'ed') return Promise.resolve({ isAdmin: true })
Expand Down
16 changes: 0 additions & 16 deletions __tests__/tds/store.test-d.ts

This file was deleted.

49 changes: 49 additions & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// this the shared base config for all packages.
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "./dist/src/index.d.ts",

"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/temp/"
},

"docModel": {
"enabled": true
},

"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "./dist/<unscopedPackageName>.d.ts"
},

"tsdocMetadata": {
"enabled": false
},

"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
},

"extractorMessageReporting": {
"default": {
"logLevel": "warning",
"addToApiReportFile": true
},

"ae-missing-release-tag": {
"logLevel": "none"
}
},

"tsdocMessageReporting": {
"default": {
"logLevel": "warning"
}
}
}
}
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:10
- image: circleci/node:12

working_directory: ~/repo

Expand All @@ -26,4 +26,4 @@ jobs:

- run:
name: Send code coverage
command: yarn codecov
command: yarn run codecov
70 changes: 42 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
{
"name": "pinia",
"version": "0.1.0-alpha.1",
"version": "2.0.0-alpha.1",
"description": "Some awesome description",
"main": "dist/pinia.common.js",
"module": "dist/pinia.esm.js",
"unpkg": "dist/pinia.js",
"browser": "dist/pinia.esm.js",
"types": "dist/src",
"main": "dist/pinia.cjs.js",
"browser": "dist/pinia.esm-browser.js",
"module": "dist/pinia.esm-bundler.js",
"unpkg": "dist/pinia.global.js",
"jsdelivr": "dist/pinia.global.js",
"types": "dist/pinia.d.ts",
"sideEffects": false,
"author": {
"name": "Eduardo San Martin Morote",
"email": "[email protected]"
},
"scripts": {
"lint": "eslint --color --ext=js,html,vue,ts src __tests__ *.js",
"lint:fix": "yarn run lint --fix",
"unit": "jest",
"build": "rollup -c rollup.config.js",
"build:dts": "api-extractor run --local --verbose",
"release": "bash scripts/release.sh",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"lint": "prettier -c --parser typescript \"{src,__tests__,e2e}/**/*.[jt]s?(x)\"",
"lint:fix": "yarn run lint --write",
"test:types": "tsc --build tsconfig.json",
"test:unit": "jest --coverage",
"dev": "yarn run unit --watchAll",
"pretest": "yarn run lint",
"test": "yarn run unit && yarn run build",
"build": "rollup -c rollup.config.js",
"prepublishOnly": "yarn run build"
"test": "yarn run test:types && yarn run test:unit && yarn run build && yarn run build:dts"
},
"files": [
"dist",
"dist/src",
"dist/*.js",
"dist/pinia.d.ts",
"LICENSE",
"README.md"
],
"tsd": {
"directory": "__tests__/dts"
},
"keywords": [
"vue",
"vuex",
Expand All @@ -47,29 +48,42 @@
],
"license": "MIT",
"devDependencies": {
"@microsoft/api-extractor": "7.8.1",
"@nuxt/types": "^0.6.1",
"@rollup/plugin-alias": "^3.0.0",
"@rollup/plugin-replace": "^2.2.1",
"@types/jest": "^25.1.1",
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@types/jest": "^26.0.14",
"@types/node": "^14.11.2",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"codecov": "^3.6.1",
"eslint": "^6.4.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.1",
"jest": "^25.1.0",
"lint-staged": "^10.2.11",
"pascalcase": "^1.0.0",
"prettier": "^1.18.2",
"rimraf": "^3.0.1",
"rollup": "^1.30.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-typescript2": "^0.25.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.1",
"ts-jest": "^25.1.0",
"tsd": "^0.11.0",
"typescript": "^3.7.4",
"vue": "next"
"vue": "^3.0.0",
"yorkie": "^2.0.0"
},
"gitHooks": {
"pre-commit": "lint-staged",
"commit-msg": "node scripts/verifyCommit.js"
},
"lint-staged": {
"*.js": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit d42e6a3

Please sign in to comment.