Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit 63690fc

Browse files
authored
Fix buld & remove release and add workflow (#10)
* Fix build and remove release * Add workflow * Update publish.yml * Update package.json
1 parent 48c6084 commit 63690fc

File tree

5 files changed

+50
-203
lines changed

5 files changed

+50
-203
lines changed

.gtihub/workflows/publish.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
name: Publish
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
- name: Use Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '16'
19+
- name: Install pnpm
20+
run: npm install -g pnpm
21+
- name: Install dependencies
22+
run: pnpm install
23+
- name: Build app
24+
run: pnpm run build
25+
- name: Publish to npm
26+
uses: JS-DevTools/npm-publish@v1
27+
with:
28+
token: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.6, 0.1.7, 0.1.8
2+
3+
- Just build fixes
4+
15
## 0.1.5
26

37
- Bundle production code as `es2020`

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "simplebar-vue3",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"main": "./dist/simplebar-vue3.umd.js",
5-
"module": "./dist/simplebar-vue3.es.js",
5+
"module": "./dist/simplebar-vue3.mjs",
66
"types": "./dist/lib.d.ts",
77
"exports": {
88
".": {
99
"require": "./dist/simplebar-vue3.umd.js",
10-
"import": "./dist/simplebar-vue3.es.js"
10+
"import": "./dist/simplebar-vue3.mjs"
1111
}
1212
},
1313
"repository": {
@@ -25,8 +25,7 @@
2525
"license": "MIT",
2626
"scripts": {
2727
"dev": "vite",
28-
"build": "vue-tsc --noEmit && vite build",
29-
"release": "ts-node --transpile-only scripts/release.ts"
28+
"build": "vue-tsc --noEmit && vite build"
3029
},
3130
"devDependencies": {
3231
"@types/fs-extra": "^9.0.13",

scripts/release.ts

-196
This file was deleted.

vite.config.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
import { defineConfig } from 'vite';
22
import path from 'path';
33
import vue from '@vitejs/plugin-vue';
4+
import * as fse from 'fs-extra';
45

56
const root = process.cwd();
67

78
// https://vitejs.dev/config/
89
export default defineConfig({
9-
plugins: [vue()],
10+
plugins: [
11+
vue(), //
12+
{
13+
name: 'plugin:move-types',
14+
apply: 'build',
15+
async closeBundle() {
16+
const fileName = 'lib.d.ts';
17+
const libDTS = path.join(root, 'src', fileName);
18+
const distLibDTS = path.join(root, 'dist', fileName);
19+
await fse.copyFile(libDTS, distLibDTS);
20+
}
21+
}
22+
],
1023
build: {
1124
target: 'es2020',
12-
1325
lib: {
1426
entry: path.resolve(root, 'src', 'lib.ts'),
1527
name: 'simplebar-vue3',

0 commit comments

Comments
 (0)