Skip to content

Commit aa53f28

Browse files
committed
chore: update workflow
1 parent ad6ae74 commit aa53f28

File tree

7 files changed

+116
-16
lines changed

7 files changed

+116
-16
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/release.yml

+23-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,36 @@ name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
79

810
jobs:
911
release:
12+
permissions:
13+
contents: write # to create release (changesets/action)
14+
pull-requests: write # to create pull request (changesets/action)
15+
name: Release
1016
runs-on: ubuntu-latest
1117
steps:
12-
- uses: actions/checkout@v3
18+
- name: Checkout Repo
19+
uses: actions/checkout@v3
1320
with:
21+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1422
fetch-depth: 0
15-
16-
- uses: actions/setup-node@v3
23+
- name: Setup Bun
24+
uses: oven-sh/setup-bun@v1
1725
with:
18-
node-version: 16.x
26+
bun-version: latest
1927

20-
- run: npx changelogithub
28+
- run: bun install
29+
30+
- name: Create Release Pull Request or Publish to npm
31+
id: changesets
32+
uses: changesets/action@v1
33+
with:
34+
publish: bun run release
2135
env:
22-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

biome.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.2.2/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"formatter": {
7+
"enabled": true
8+
},
9+
"linter": {
10+
"enabled": true,
11+
"rules": {
12+
"recommended": true
13+
}
14+
},
15+
"javascript": {
16+
"formatter": {
17+
"semicolons": "asNeeded",
18+
"indentStyle": "space",
19+
"quoteStyle": "single"
20+
}
21+
},
22+
"files": {
23+
"ignore": ["dist"]
24+
}
25+
}

bun.lockb

90.7 KB
Binary file not shown.

package.json

+30-8
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,60 @@
11
{
22
"name": "js-sdk",
33
"version": "0.0.0",
4+
"exports": {
5+
".": {
6+
"import": {
7+
"types": "./dist/index.d.mts",
8+
"default": "./dist/index.mjs"
9+
},
10+
"require": {
11+
"types": "./dist/index.d.ts",
12+
"default": "./dist/index.js"
13+
}
14+
}
15+
},
416
"main": "dist/index.js",
17+
"module": "dist/index.mjs",
518
"types": "dist/index.d.ts",
6-
"description": "",
19+
"files": [
20+
"dist"
21+
],
22+
"description": "undb javascript sdk",
723
"scripts": {
8-
"build": "bun run build.mjs",
24+
"build": "tsup src/index.ts --env.NODE_ENV production",
925
"dev": "bun --watch src/index.ts",
1026
"test": "bun test",
1127
"test:watch": "bun --watch test",
28+
"lint": "biome check src",
29+
"lint:fix": "biome check --apply src",
30+
"format": "biome format src --write",
31+
"release": "changeset publish",
1232
"prepublishOnly": "bun run build"
1333
},
14-
"files": [
15-
"dist"
16-
],
1734
"keywords": [
1835
"bun"
1936
],
2037
"license": "MIT",
2138
"homepage": "https://github.com/wobsoriano/pkg-name#readme",
2239
"repository": {
2340
"type": "git",
24-
"url": "git+https://github.com/wobsoriano/pkg-name.git"
41+
"url": "git+https://github.com/undb-io/js-sdk.git"
2542
},
26-
"bugs": "https://github.com/wobsoriano/pkg-name/issues",
27-
"author": "Robert Soriano <sorianorobertc@gmail.com>",
43+
"bugs": "https://github.com/undb-io/js-sdk/issues",
44+
"author": "nichenqin <nichenqin@hotmail.com>",
2845
"devDependencies": {
46+
"@biomejs/biome": "^1.8.3",
2947
"@types/bun": "^1.1.6",
3048
"bun-plugin-dts": "^0.2.3",
3149
"bun-types": "^1.1.25",
3250
"msw": "^2.3.5",
51+
"tsup": "^8.2.4",
3352
"typescript": "^5.5.4"
3453
},
3554
"peerDependencies": {
3655
"openapi-fetch": "^0.11.1"
56+
},
57+
"dependencies": {
58+
"@changesets/cli": "^2.27.7"
3759
}
3860
}

tsup.config.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { defineConfig } from 'tsup'
2+
import { name, version } from './package.json'
3+
4+
export default defineConfig((overrideOptions) => {
5+
const isProd = overrideOptions.env?.NODE_ENV === 'production'
6+
7+
return {
8+
entry: ['src/index.ts'],
9+
minify: isProd,
10+
clean: true,
11+
sourcemap: true,
12+
dts: true,
13+
format: ['cjs', 'esm'],
14+
define: {
15+
PACKAGE_NAME: `"${name}"`,
16+
PACKAGE_VERSION: `"${version}"`,
17+
},
18+
}
19+
})

0 commit comments

Comments
 (0)