From 4b0bc73fb3864001d73ea11bf844c57ba80e39f8 Mon Sep 17 00:00:00 2001 From: avil13 <13.avil@gmail.com> Date: Sun, 25 Oct 2020 19:52:55 +0300 Subject: [PATCH] feat: monorepo --- .github/workflows/npmpublish.yml | 18 ++ .github/workflows/pull_request.yml | 13 +- README.md | 177 +----------------- package.json | 70 +------ .babelrc => packages/vue-sweetalert2/.babelrc | 0 .../vue-sweetalert2/.editorconfig | 0 .../vue-sweetalert2/.eslintignore | 0 .../vue-sweetalert2/.eslintrc.js | 0 packages/vue-sweetalert2/.gitignore | 26 +++ .../vue-sweetalert2/.prettierignore | 0 .../vue-sweetalert2/.prettierrc.js | 0 .../vue-sweetalert2/CHANGELOG.md | 0 .../vue-sweetalert2/CODE_OF_CONDUCT.md | 0 LICENSE => packages/vue-sweetalert2/LICENSE | 0 packages/vue-sweetalert2/README.md | 176 +++++++++++++++++ .../vue-sweetalert2/__mocks__}/styleMock.js | 0 .../__tests__}/swal-methods.spec.ts | 0 .../vue-sweetalert2/__tests__}/swal.spec.ts | 0 .../vue-sweetalert2/assets}/logo.png | Bin .../assets}/vue-sweetalert2.gif | Bin .../vue-sweetalert2/babel.config.js | 0 .../vue-sweetalert2/ignore-utils.js | 0 .../vue-sweetalert2/jest.config.js | 0 packages/vue-sweetalert2/lerna.json | 6 + .../vue-sweetalert2/nuxt}/index.js | 0 .../vue-sweetalert2/nuxt}/plugin.js | 0 packages/vue-sweetalert2/package.json | 90 +++++++++ .../vue-sweetalert2/src}/index.ts | 0 .../vue-sweetalert2/src}/shims-tsx.d.ts | 0 .../vue-sweetalert2/src}/shims-vue.d.ts | 0 packages/vue-sweetalert2/tsconfig.json | 7 + .../vue-sweetalert2/yarn.lock | 0 tsconfig.json | 9 +- 33 files changed, 342 insertions(+), 250 deletions(-) mode change 100644 => 120000 README.md rename .babelrc => packages/vue-sweetalert2/.babelrc (100%) rename .editorconfig => packages/vue-sweetalert2/.editorconfig (100%) rename .eslintignore => packages/vue-sweetalert2/.eslintignore (100%) rename .eslintrc.js => packages/vue-sweetalert2/.eslintrc.js (100%) create mode 100644 packages/vue-sweetalert2/.gitignore rename .prettierignore => packages/vue-sweetalert2/.prettierignore (100%) rename .prettierrc.js => packages/vue-sweetalert2/.prettierrc.js (100%) rename CHANGELOG.md => packages/vue-sweetalert2/CHANGELOG.md (100%) rename CODE_OF_CONDUCT.md => packages/vue-sweetalert2/CODE_OF_CONDUCT.md (100%) rename LICENSE => packages/vue-sweetalert2/LICENSE (100%) create mode 100644 packages/vue-sweetalert2/README.md rename {__mocks__ => packages/vue-sweetalert2/__mocks__}/styleMock.js (100%) rename {__tests__ => packages/vue-sweetalert2/__tests__}/swal-methods.spec.ts (100%) rename {__tests__ => packages/vue-sweetalert2/__tests__}/swal.spec.ts (100%) rename {assets => packages/vue-sweetalert2/assets}/logo.png (100%) rename {assets => packages/vue-sweetalert2/assets}/vue-sweetalert2.gif (100%) rename babel.config.js => packages/vue-sweetalert2/babel.config.js (100%) rename ignore-utils.js => packages/vue-sweetalert2/ignore-utils.js (100%) rename jest.config.js => packages/vue-sweetalert2/jest.config.js (100%) create mode 100644 packages/vue-sweetalert2/lerna.json rename {nuxt => packages/vue-sweetalert2/nuxt}/index.js (100%) rename {nuxt => packages/vue-sweetalert2/nuxt}/plugin.js (100%) create mode 100644 packages/vue-sweetalert2/package.json rename {src => packages/vue-sweetalert2/src}/index.ts (100%) rename {src => packages/vue-sweetalert2/src}/shims-tsx.d.ts (100%) rename {src => packages/vue-sweetalert2/src}/shims-vue.d.ts (100%) create mode 100644 packages/vue-sweetalert2/tsconfig.json rename yarn.lock => packages/vue-sweetalert2/yarn.lock (100%) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 1f2740a..5c5bfb8 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -5,6 +5,11 @@ on: branches: - master +defaults: + run: + shell: bash + working-directory: packages/vue-sweetalert2 + jobs: test: name: Testing job @@ -26,8 +31,21 @@ jobs: with: node-version: 12 registry-url: https://registry.npmjs.org/ + # Проверяем изменилась ли версия + - name: Set CURRENT VERSION to ENV + run: echo ::set-env name=CURRENT_VERSION::$(node -p -e "require('./package.json').version") + + - name: Set PUBLIC VERSION to ENV + run: echo ::set-env name=PUBLIC_VERSION::$(npm show vue-sweetalert2 version) + + - name: Set NEED_PUBLISH + run: echo ::set-env name=NEED_PUBLISH::$([[ "$CURRENT_VERSION"!="$PUBLIC_VERSION" ]] && echo '1' || echo '') + - run: yarn + if: ${{ env.NEED_PUBLISH }} + - run: yarn publish + if: ${{ env.NEED_PUBLISH }} env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}" diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index af1ba83..cf5cefa 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,4 +1,10 @@ +defaults: + run: + shell: bash + working-directory: packages/vue-sweetalert2 + on: pull_request + name: Pull Request jobs: test: @@ -8,6 +14,7 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-node@v1 with: - node-version: 8 - - run: npm ci - - run: npm run test + node-version: 12 + - run: cd packages/vue-sweetalert2 + - run: yarn + - run: yarn test diff --git a/README.md b/README.md deleted file mode 100644 index 5432154..0000000 --- a/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# vue-sweetalert2 - -[![npm](https://img.shields.io/npm/v/vue-sweetalert2.svg)](https://www.npmjs.com/package/vue-sweetalert2) - -[![Coverage Status](https://coveralls.io/repos/github/avil13/vue-sweetalert2/badge.svg?branch=master)](https://coveralls.io/github/avil13/vue-sweetalert2?branch=master) - -Vue.js wrapper for SweetAlert2. With support SSR. - ---- - -## Attention: - -When using "Vue3: Composition API" it is better **not to use** this wrapper. -It is more practical to call sweetalert2 directly. - -Also, it is better to do it to get feedback faster, and be closer to the documentation. - ---- - - -![VueSweetalert2](assets/logo.png) - -# [Demo](https://avil13.github.io/vue-sweetalert2/) - -![vue-sweetalert2 demo](assets/vue-sweetalert2.gif) - ---- - -## Get started - -### Basics - -```bash -# bash -npm install -S vue-sweetalert2 -``` - -### Add types to TypeScript project - -```js -{ - //...tsconfig.json - "types": [ - "vue-sweetalert2" - ], -} -``` - -## vue 2 - -```js -// main.js -import Vue from 'vue'; -import VueSweetalert2 from 'vue-sweetalert2'; - -// If you don't need the styles, do not connect -import 'sweetalert2/dist/sweetalert2.min.css'; - -Vue.use(VueSweetalert2); -``` - -## vue 3 - -```js -// main.js -import { createApp } from 'vue' -import App from './App.vue' -import './index.css' - -import VueSweetalert2 from 'vue-sweetalert2'; -import 'sweetalert2/dist/sweetalert2.min.css'; - -const app = createApp(App) - -app.use(VueSweetalert2); - -app.mount('#app'); -``` - -Now in the global object, you can access all the methods of [sweetalert2](https://github.com/limonte/sweetalert2). - -```html -// example-vue-component.vue - - - -``` - -// Or - -```js -Vue.swal('Hello Vue world!!!'); -``` - -### Global options - -If you want to add global options like button colors, do something like this: - -```js -// main.js -import Vue from 'vue'; -import VueSweetalert2 from 'vue-sweetalert2'; - -const options = { - confirmButtonColor: '#41b882', - cancelButtonColor: '#ff7674', -}; - -Vue.use(VueSweetalert2, options); -``` - -### Custom styling - -Using scss styles are loaded so - -```js -// main.js -import Vue from 'vue'; -import VueSweetalert2 from 'vue-sweetalert2'; - -Vue.use(VueSweetalert2); -``` - -```scss -// style.scss -@import '~sweetalert2/src/variables'; - -$swal2-background: #990000; - -@import '~sweetalert2/src/sweetalert2'; -``` - -## Nuxt.js - -Install dependencies: - -```bash -npm install -S vue-sweetalert2 -``` - -Add `vue-sweetalert2/nuxt` to modules section of `nuxt.config.js` - -```js -{ - modules: ['vue-sweetalert2/nuxt']; -} -``` - -Or pass in global options like this: - -```js -{ - modules: [ - [ - 'vue-sweetalert2/nuxt', - { - confirmButtonColor: '#41b882', - cancelButtonColor: '#ff7674' - } - ] - ] -} -``` - -## The documentation for `sweetalert2`, you can find [here](https://sweetalert2.github.io/). diff --git a/README.md b/README.md new file mode 120000 index 0000000..e9eff07 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +packages/vue-sweetalert2/README.md \ No newline at end of file diff --git a/package.json b/package.json index 9b4270c..7fe0711 100644 --- a/package.json +++ b/package.json @@ -1,73 +1,5 @@ { "name": "vue-sweetalert2", - "version": "4.0.1", - "description": "Simple Vue sweetalert2 package", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": ["src", "nuxt", "dist"], - "scripts": { - "build": "tsc -p .", - "test": "jest --no-cache", - "test:watch": "jest --watch", - "test:coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", - "prepublish": "npm run test && npm run build && auto-changelog", - "__postpublish": "npm run test:coveralls", - "lint:prettier": "prettier --write src/*.ts", - "lint:ts": "tsc --noEmit --skipLibCheck", - "lint": "npm run lint:prettier && npm run lint:ts" - }, - "keywords": ["sweetalert", "sweetalert2", "alert", "prompt", "ssr"], - "author": "Aleksey Pivkin @avil13", "license": "MIT", - "dependencies": { - "sweetalert2": "10.x" - }, - "homepage": "https://avil13.github.io/vue-sweetalert2/", - "repository": { - "type": "git", - "url": "git+https://github.com/avil13/vue-sweetalert2.git" - }, - "devDependencies": { - "@types/jest": "^26.0.14", - "@types/node": "^14.11.8", - "@typescript-eslint/eslint-plugin": "^4.4.1", - "@typescript-eslint/parser": "^4.4.1", - "@vue/eslint-config-typescript": "^7.0.0", - "@vue/test-utils": "^1.1.0", - "auto-changelog": "^2.2.1", - "babel-core": "^6.26.3", - "babel-eslint": "^10.1.0", - "babel-polyfill": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-preset-stage-3": "^6.24.1", - "babel-preset-vue": "^2.0.2", - "coveralls": "^3.1.0", - "eslint": "^7.11.0", - "eslint-plugin-vue": "^7.0.1", - "husky": "^4.3.0", - "jest": "^26.5.3", - "lint-staged": "^10.4.0", - "prettier": "^2.1.2", - "require-hacker": "^3.0.1", - "ts-jest": "^26.4.1", - "typescript": "^4.0.3", - "vue": "^2.6.12", - "vue-jest": "^3.0.7", - "vue-template-compiler": "^2.6.12" - }, - "nodemonConfig": { - "watch": ["src"], - "exec": "npm run prepublish", - "delay": 2500 - }, - "lint-staged": { - "*.{js,html,vue,md,json}": ["npm run lint:prettier"], - "*.{ts}": ["npm run lint:prettier && npm run lint:ts"] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged && npm test", - "pre-push": "lint-staged && npm test" - } - } + "private": true } diff --git a/.babelrc b/packages/vue-sweetalert2/.babelrc similarity index 100% rename from .babelrc rename to packages/vue-sweetalert2/.babelrc diff --git a/.editorconfig b/packages/vue-sweetalert2/.editorconfig similarity index 100% rename from .editorconfig rename to packages/vue-sweetalert2/.editorconfig diff --git a/.eslintignore b/packages/vue-sweetalert2/.eslintignore similarity index 100% rename from .eslintignore rename to packages/vue-sweetalert2/.eslintignore diff --git a/.eslintrc.js b/packages/vue-sweetalert2/.eslintrc.js similarity index 100% rename from .eslintrc.js rename to packages/vue-sweetalert2/.eslintrc.js diff --git a/packages/vue-sweetalert2/.gitignore b/packages/vue-sweetalert2/.gitignore new file mode 100644 index 0000000..75078f3 --- /dev/null +++ b/packages/vue-sweetalert2/.gitignore @@ -0,0 +1,26 @@ +node_modules +dist +npm-shrinkwrap.json + +.DS_Store +node_modules/ +dist/ +npm-debug.log +yarn-error.log + +#yarn.lock +package-lock.json + +# Editor directories and files +.idea +*.suo +*.ntvs* +*.njsproj +*.sln + +.vscode/settings.json +coverage + +.npmrc + +dist diff --git a/.prettierignore b/packages/vue-sweetalert2/.prettierignore similarity index 100% rename from .prettierignore rename to packages/vue-sweetalert2/.prettierignore diff --git a/.prettierrc.js b/packages/vue-sweetalert2/.prettierrc.js similarity index 100% rename from .prettierrc.js rename to packages/vue-sweetalert2/.prettierrc.js diff --git a/CHANGELOG.md b/packages/vue-sweetalert2/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to packages/vue-sweetalert2/CHANGELOG.md diff --git a/CODE_OF_CONDUCT.md b/packages/vue-sweetalert2/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to packages/vue-sweetalert2/CODE_OF_CONDUCT.md diff --git a/LICENSE b/packages/vue-sweetalert2/LICENSE similarity index 100% rename from LICENSE rename to packages/vue-sweetalert2/LICENSE diff --git a/packages/vue-sweetalert2/README.md b/packages/vue-sweetalert2/README.md new file mode 100644 index 0000000..5432154 --- /dev/null +++ b/packages/vue-sweetalert2/README.md @@ -0,0 +1,176 @@ +# vue-sweetalert2 + +[![npm](https://img.shields.io/npm/v/vue-sweetalert2.svg)](https://www.npmjs.com/package/vue-sweetalert2) + +[![Coverage Status](https://coveralls.io/repos/github/avil13/vue-sweetalert2/badge.svg?branch=master)](https://coveralls.io/github/avil13/vue-sweetalert2?branch=master) + +Vue.js wrapper for SweetAlert2. With support SSR. + +--- + +## Attention: + +When using "Vue3: Composition API" it is better **not to use** this wrapper. +It is more practical to call sweetalert2 directly. + +Also, it is better to do it to get feedback faster, and be closer to the documentation. + +--- + + +![VueSweetalert2](assets/logo.png) + +# [Demo](https://avil13.github.io/vue-sweetalert2/) + +![vue-sweetalert2 demo](assets/vue-sweetalert2.gif) + +--- + +## Get started + +### Basics + +```bash +# bash +npm install -S vue-sweetalert2 +``` + +### Add types to TypeScript project + +```js +{ + //...tsconfig.json + "types": [ + "vue-sweetalert2" + ], +} +``` + +## vue 2 + +```js +// main.js +import Vue from 'vue'; +import VueSweetalert2 from 'vue-sweetalert2'; + +// If you don't need the styles, do not connect +import 'sweetalert2/dist/sweetalert2.min.css'; + +Vue.use(VueSweetalert2); +``` + +## vue 3 + +```js +// main.js +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +import VueSweetalert2 from 'vue-sweetalert2'; +import 'sweetalert2/dist/sweetalert2.min.css'; + +const app = createApp(App) + +app.use(VueSweetalert2); + +app.mount('#app'); +``` + +Now in the global object, you can access all the methods of [sweetalert2](https://github.com/limonte/sweetalert2). + +```html +// example-vue-component.vue + + + +``` + +// Or + +```js +Vue.swal('Hello Vue world!!!'); +``` + +### Global options + +If you want to add global options like button colors, do something like this: + +```js +// main.js +import Vue from 'vue'; +import VueSweetalert2 from 'vue-sweetalert2'; + +const options = { + confirmButtonColor: '#41b882', + cancelButtonColor: '#ff7674', +}; + +Vue.use(VueSweetalert2, options); +``` + +### Custom styling + +Using scss styles are loaded so + +```js +// main.js +import Vue from 'vue'; +import VueSweetalert2 from 'vue-sweetalert2'; + +Vue.use(VueSweetalert2); +``` + +```scss +// style.scss +@import '~sweetalert2/src/variables'; + +$swal2-background: #990000; + +@import '~sweetalert2/src/sweetalert2'; +``` + +## Nuxt.js + +Install dependencies: + +```bash +npm install -S vue-sweetalert2 +``` + +Add `vue-sweetalert2/nuxt` to modules section of `nuxt.config.js` + +```js +{ + modules: ['vue-sweetalert2/nuxt']; +} +``` + +Or pass in global options like this: + +```js +{ + modules: [ + [ + 'vue-sweetalert2/nuxt', + { + confirmButtonColor: '#41b882', + cancelButtonColor: '#ff7674' + } + ] + ] +} +``` + +## The documentation for `sweetalert2`, you can find [here](https://sweetalert2.github.io/). diff --git a/__mocks__/styleMock.js b/packages/vue-sweetalert2/__mocks__/styleMock.js similarity index 100% rename from __mocks__/styleMock.js rename to packages/vue-sweetalert2/__mocks__/styleMock.js diff --git a/__tests__/swal-methods.spec.ts b/packages/vue-sweetalert2/__tests__/swal-methods.spec.ts similarity index 100% rename from __tests__/swal-methods.spec.ts rename to packages/vue-sweetalert2/__tests__/swal-methods.spec.ts diff --git a/__tests__/swal.spec.ts b/packages/vue-sweetalert2/__tests__/swal.spec.ts similarity index 100% rename from __tests__/swal.spec.ts rename to packages/vue-sweetalert2/__tests__/swal.spec.ts diff --git a/assets/logo.png b/packages/vue-sweetalert2/assets/logo.png similarity index 100% rename from assets/logo.png rename to packages/vue-sweetalert2/assets/logo.png diff --git a/assets/vue-sweetalert2.gif b/packages/vue-sweetalert2/assets/vue-sweetalert2.gif similarity index 100% rename from assets/vue-sweetalert2.gif rename to packages/vue-sweetalert2/assets/vue-sweetalert2.gif diff --git a/babel.config.js b/packages/vue-sweetalert2/babel.config.js similarity index 100% rename from babel.config.js rename to packages/vue-sweetalert2/babel.config.js diff --git a/ignore-utils.js b/packages/vue-sweetalert2/ignore-utils.js similarity index 100% rename from ignore-utils.js rename to packages/vue-sweetalert2/ignore-utils.js diff --git a/jest.config.js b/packages/vue-sweetalert2/jest.config.js similarity index 100% rename from jest.config.js rename to packages/vue-sweetalert2/jest.config.js diff --git a/packages/vue-sweetalert2/lerna.json b/packages/vue-sweetalert2/lerna.json new file mode 100644 index 0000000..8f89cb9 --- /dev/null +++ b/packages/vue-sweetalert2/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": ["packages/*"], + "version": "independent", + "npmClient": "yarn", + "useWorkspaces": true +} diff --git a/nuxt/index.js b/packages/vue-sweetalert2/nuxt/index.js similarity index 100% rename from nuxt/index.js rename to packages/vue-sweetalert2/nuxt/index.js diff --git a/nuxt/plugin.js b/packages/vue-sweetalert2/nuxt/plugin.js similarity index 100% rename from nuxt/plugin.js rename to packages/vue-sweetalert2/nuxt/plugin.js diff --git a/packages/vue-sweetalert2/package.json b/packages/vue-sweetalert2/package.json new file mode 100644 index 0000000..bde97ff --- /dev/null +++ b/packages/vue-sweetalert2/package.json @@ -0,0 +1,90 @@ +{ + "name": "vue-sweetalert2", + "version": "4.0.1", + "description": "Simple Vue sweetalert2 package", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "src", + "nuxt", + "dist" + ], + "scripts": { + "build": "tsc -p .", + "test": "jest --no-cache", + "test:watch": "jest --watch", + "test:coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", + "prepublish": "npm run test && npm run build && auto-changelog", + "__postpublish": "npm run test:coveralls", + "lint:prettier": "prettier --write src/*.ts", + "lint:ts": "tsc --noEmit --skipLibCheck", + "lint": "npm run lint:prettier && npm run lint:ts" + }, + "keywords": [ + "sweetalert", + "sweetalert2", + "alert", + "prompt", + "ssr" + ], + "author": "Aleksey Pivkin @avil13", + "license": "MIT", + "dependencies": { + "sweetalert2": "10.x" + }, + "homepage": "https://avil13.github.io/vue-sweetalert2/", + "repository": { + "type": "git", + "url": "git+https://github.com/avil13/vue-sweetalert2.git" + }, + "devDependencies": { + "@types/jest": "^26.0.14", + "@types/node": "^14.11.8", + "@typescript-eslint/eslint-plugin": "^4.4.1", + "@typescript-eslint/parser": "^4.4.1", + "@vue/eslint-config-typescript": "^7.0.0", + "@vue/test-utils": "^1.1.0", + "auto-changelog": "^2.2.1", + "babel-core": "^6.26.3", + "babel-eslint": "^10.1.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-preset-stage-3": "^6.24.1", + "babel-preset-vue": "^2.0.2", + "coveralls": "^3.1.0", + "eslint": "^7.11.0", + "eslint-plugin-vue": "^7.0.1", + "husky": "^4.3.0", + "jest": "^26.5.3", + "lerna": "^3.22.1", + "lint-staged": "^10.4.0", + "prettier": "^2.1.2", + "require-hacker": "^3.0.1", + "ts-jest": "^26.4.1", + "typescript": "^4.0.3", + "vue": "^2.6.12", + "vue-jest": "^3.0.7", + "vue-template-compiler": "^2.6.12" + }, + "nodemonConfig": { + "watch": [ + "src" + ], + "exec": "npm run prepublish", + "delay": 2500 + }, + "lint-staged": { + "*.{js,html,vue,md,json}": [ + "npm run lint:prettier" + ], + "*.{ts}": [ + "npm run lint:prettier && npm run lint:ts" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged && npm test", + "pre-push": "lint-staged && npm test" + } + } +} diff --git a/src/index.ts b/packages/vue-sweetalert2/src/index.ts similarity index 100% rename from src/index.ts rename to packages/vue-sweetalert2/src/index.ts diff --git a/src/shims-tsx.d.ts b/packages/vue-sweetalert2/src/shims-tsx.d.ts similarity index 100% rename from src/shims-tsx.d.ts rename to packages/vue-sweetalert2/src/shims-tsx.d.ts diff --git a/src/shims-vue.d.ts b/packages/vue-sweetalert2/src/shims-vue.d.ts similarity index 100% rename from src/shims-vue.d.ts rename to packages/vue-sweetalert2/src/shims-vue.d.ts diff --git a/packages/vue-sweetalert2/tsconfig.json b/packages/vue-sweetalert2/tsconfig.json new file mode 100644 index 0000000..d67bba5 --- /dev/null +++ b/packages/vue-sweetalert2/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist/", + "rootDir": "./src" + } +} \ No newline at end of file diff --git a/yarn.lock b/packages/vue-sweetalert2/yarn.lock similarity index 100% rename from yarn.lock rename to packages/vue-sweetalert2/yarn.lock diff --git a/tsconfig.json b/tsconfig.json index b602579..4efb026 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,9 +19,14 @@ "sourceMap": true, "types": ["node", "jest"], "paths": { - "@/*": ["./src/*"] + "@/*": [ + "packages/vue-sweetalert2/src/*" + ] } }, - "include": ["./src/**/*.ts", "./src/**/*.vue"], + "include": [ + "packages/vue-sweetalert2/src/**/*.ts", + "packages/vue-sweetalert2/src/**/*.vue" + ], "exclude": ["node_modules", "dist", "example"] }