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

feat: add vite #35

Merged
merged 2 commits into from
Oct 29, 2022
Merged
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
38,849 changes: 28,167 additions & 10,682 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,43 @@
"repository": "git@github.com:alexander-heimbuch/redux-vuex.git",
"license": "MIT",
"scripts": {
"build": "rm -rf dist && webpack && node ./.build/prepublish.js",
"clean": "rm -rf dist/*",
"typings": "tsc",
"package": "vite build",
"build": "npm run clean && npm run package && npm run typings",
"test": "jest \"__tests__/.*\\.test\\.ts\"",
"release": "release-it"
"release": "release-it",
"prepare": "husky install"
},
"dependencies": {
"get-value": "3.0.1",
"set-value": "3.0.1"
"set-value": "4.1.0"
},
"peerDependencies": {
"vue": "3.x",
"redux": "4.x",
"@vue/runtime-core": "3.x"
"redux": "4.x"
},
"module": "./dist/redux-vuex.es.js",
"types": "./dist/typings/index.d.ts",
"exports": {
".": {
"import": "./dist/redux-vuex.es.js"
}
},
"devDependencies": {
"@babel/core": "7.11.6",
"@babel/preset-env": "7.11.5",
"@babel/runtime": "7.11.2",
"@vue/runtime-core": "3.0.0",
"@vue/test-utils": "2.0.0-beta.5",
"@vue/test-utils": "2.2.1",
"@types/jest": "27.0.1",
"husky": "4.3.0",
"husky": "8.0.1",
"jest": "26.4.2",
"prettier": "2.1.2",
"pretty-quick": "3.0.2",
"redux": "4.1.1",
"release-it": "14.11.5",
"redux": "4.2.0",
"release-it": "15.5.0",
"ts-jest": "^26.4.0",
"ts-loader": "8.0.4",
"typescript": "4.0.3",
"vue": "3.0.0",
"webpack": "4.44.2",
"webpack-cli": "3.3.12",
"@types/get-value": "3.0.0",
"fs-extra": "10.0.0",
"ramda": "0.27.1"
"typescript": "4.8.4",
"vue": "3.2.41",
"vite": "3.1.8",
"@vitejs/plugin-vue": "3.1.2"
},
"husky": {
"hooks": {
Expand Down
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { provide as provideStore } from './provide-store'
import { mapState } from './map-state'
import { mapActions } from './map-actions'

import { injectStore, injectActions } from './tokens'
import { ProvideStoreOptions, MapOptions } from './types'
import { injectStore, injectActions, storeToken, actionsToken } from './tokens'

export {
provideStore,
mapState,
mapActions,
storeToken,
actionsToken,
injectStore,
injectActions,
ProvideStoreOptions,
MapOptions
injectActions
}
2 changes: 1 addition & 1 deletion src/map-state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as get from 'get-value'
import { ref, UnwrapRef, onUnmounted, reactive } from '@vue/runtime-core'
import { ref, UnwrapRef, onUnmounted, reactive } from 'vue'

import { injectStore } from './tokens'
import { objectMapper, applyMappers } from './helper'
Expand Down
2 changes: 1 addition & 1 deletion src/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Store, createStore, combineReducers } from 'redux'
import { inject, provide, App } from '@vue/runtime-core'
import { inject, provide, App } from 'vue'
import { Actions } from './types'

export const storeToken = Symbol('ReduxStore')
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@vue/runtime-core'
import { App } from 'vue'
import { Store } from 'redux'

export interface ProvideStoreOptions {
Expand Down
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"declaration": true,
"outDir": "./dist"
"outDir": "./dist/typings",
"emitDeclarationOnly": true
},
"include": ["src/**/*"]
"include": ["./src/index.ts"]
}
18 changes: 18 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require('path');
const { defineConfig } = require('vite');
const vue = require('@vitejs/plugin-vue');

export default defineConfig({
build: {
lib: {
formats: ['es'],
entry: path.resolve(__dirname, 'src', 'index.ts'),
name: 'ReduxVuex',
fileName: (format) => `redux-vuex.${format}.js`,
},
rollupOptions: {
external: ['vue', 'redux']
},
},
plugins: [vue()]
});