Skip to content

Commit b063368

Browse files
authored
Merge pull request #49 from askides/feat/vite
Feat/vite
2 parents 15eadae + 6124e41 commit b063368

19 files changed

Lines changed: 4548 additions & 5474 deletions

.github/workflows/release.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- dev
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (e.g., 1.0.0)'
8+
required: true
9+
type: string
810

911
jobs:
1012
release:
@@ -31,11 +33,39 @@ jobs:
3133
- name: Run Tests
3234
run: pnpm run lib:test
3335

34-
- name: Install dependencies
36+
- name: Build
3537
run: pnpm run lib:build
3638

37-
- name: Semantic Release
39+
- name: Copy README
40+
run: cp README.md libs/react-plock/dist/
41+
42+
- name: Manual Release
3843
env:
3944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4045
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41-
run: pnpm run lib:release
46+
VERSION: ${{ inputs.version }}
47+
run: |
48+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
49+
git config --global user.name "github-actions[bot]"
50+
npm version $VERSION
51+
pnpm --filter react-plock publish
52+
53+
- name: Generate Changelog
54+
id: changelog
55+
run: |
56+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^)
57+
CHANGELOG=$(git log --pretty=format:"- %s" ${PREVIOUS_TAG}..HEAD)
58+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
59+
echo "$CHANGELOG" >> $GITHUB_ENV
60+
echo "EOF" >> $GITHUB_ENV
61+
62+
- name: Create GitHub Release
63+
uses: actions/create-release@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
tag_name: v${{ inputs.version }}
68+
release_name: v${{ inputs.version }}
69+
body: ${{ env.CHANGELOG }}
70+
draft: false
71+
prerelease: false

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
version: 8
2020

2121
- run: pnpm install
22-
- run: pnpm run lib:test
22+
- run: pnpm run --filter react-plock test

examples/with-nextjs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
],
2121
"paths": {
2222
"@/*": ["./src/*"],
23-
"@local/lib": ["../../libs/react-plock/index"],
23+
"@local/lib": ["../../libs/react-plock/src/index"],
2424
"@assets/*": ["../../assets/*"]
2525
}
2626
},

examples/with-vite/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"noEmit": true,
1818
"jsx": "react-jsx",
1919
"paths": {
20-
"@local/lib": ["../../libs/react-plock/index"],
20+
"@local/lib": ["../../libs/react-plock/src/index"],
2121
"@assets/*": ["../../assets/*"]
2222
}
2323
},

libs/react-plock/.releaserc

Lines changed: 0 additions & 15 deletions
This file was deleted.

libs/react-plock/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

libs/react-plock/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

libs/react-plock/jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

libs/react-plock/package.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "react-plock",
33
"version": "3.0.2",
4+
"type": "module",
45
"description": "The 1kB Masonry Grid for React",
56
"author": "Renato Pozzi <askides@proton.me>",
67
"homepage": "https://github.com/askides/react-plock#readme",
@@ -19,26 +20,15 @@
1920
"url": "git+https://github.com/askides/react-plock.git"
2021
},
2122
"scripts": {
22-
"test": "jest",
23-
"lib:bump": "changelogen --bump",
24-
"lib:bump:dev": "changelogen --bump --prerelease dev",
25-
"lib:publish": "changelogen --publish",
26-
"lib:publish:dev": "npm publish react-plock --tag dev",
27-
"lib:release": "semantic-release",
28-
"build": "tsup index.ts --dts --minify"
23+
"test": "vitest run",
24+
"build": "vite build",
25+
"lib:publish": "npm publish react-plock",
26+
"lib:publish:dev": "npm publish react-plock --tag dev"
2927
},
3028
"bugs": {
3129
"url": "https://github.com/askides/react-plock/issues"
3230
},
3331
"peerDependencies": {
3432
"react": "^18.2.0"
35-
},
36-
"devDependencies": {
37-
"@types/jest": "^29.4.0",
38-
"@types/react": "^18.0.28",
39-
"changelogen": "^0.5.5",
40-
"jest": "^29.4.3",
41-
"semantic-release": "^22.0.12",
42-
"ts-jest": "^29.0.5"
4333
}
4434
}

libs/react-plock/src/Plock.spec.tsx

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)