Skip to content

Commit

Permalink
feat: update exports and bundling strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-Zayne committed Aug 19, 2024
1 parent b80de04 commit 61bb5a9
Show file tree
Hide file tree
Showing 13 changed files with 547 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-masks-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zayne-labs/callapi": patch
---

update bundling and exports
34 changes: 34 additions & 0 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish and Test every commit
on:
pull_request:
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.7.0

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies and build
run: |
pnpm install --frozen-lockfile
pnpm build
- run: pnpm test:release
9 changes: 5 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ const eslintConfigArray = typegen([
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
projectService: {
allowDefaultProject: ["*.js"],
defaultProject: "tsconfig.eslint.json",
},
project: "tsconfig.eslint.json",
// projectService: {
// allowDefaultProject: ["*.js", ""],
// defaultProject: "tsconfig.eslint.json",
// },
tsconfigRootDir: import.meta.dirname,
},
},
Expand Down
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,31 @@
"test:format": "prettier --write --cache .",
"test:lint": "eslint src/**/*.ts --max-warnings 10 --report-unused-disable-directives",
"test:size": "size-limit",
"test:release": "pkg-pr-new publish",
"build": "tsup",
"build:dev": "tsup --watch",
"version-package": "changeset version",
"release": "changeset publish"
"release": "changeset publish --access public"
},
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"./utils": {
"import": "./dist/esm/utils/index.js",
"require": "./dist/cjs/utils/index.cjs"
}
},
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"size-limit": {
"path": "./src/index.ts",
"limit": "2 kb"
},
"size-limit": [
{
"path": "./src/index.ts",
"limit": "2 kb"
}
],
"sideEffects": false,
"repository": "ryan-zayne/callApi",
"homepage": "https://github.com/ryan-zayne/callApi#readme",
Expand All @@ -58,6 +62,7 @@
"@arethetypeswrong/cli": "^0.15.4",
"@changesets/cli": "^2.27.7",
"@eslint/js": "^9.9.0",
"@size-limit/esbuild-why": "^11.1.4",
"@size-limit/preset-small-lib": "^11.1.4",
"@stylistic/eslint-plugin": "^2.6.4",
"@zayne-labs/tsconfig": "^0.1.1",
Expand All @@ -71,6 +76,7 @@
"globals": "^15.9.0",
"husky": "^9.1.4",
"lint-staged": "^15.2.9",
"pkg-pr-new": "^0.0.20",
"prettier": "^3.3.3",
"size-limit": "^11.1.4",
"terser": "^5.31.6",
Expand Down
Loading

0 comments on commit 61bb5a9

Please sign in to comment.