Skip to content

Commit

Permalink
DX-1264: Unify exports (#1290)
Browse files Browse the repository at this point in the history
* chore: move to new build pipeline

* fix: turn all example versions to "latest"

* fix: remove unneccesary install step before doing bun add

* fix: add 10s sleep after workflow publish

* fix: use copying into dist folder instead

* fix: ci

* fix: ci

* fix: change canary release tag from next to canary

* fix: update redis dependency as latest

* chore: remove export fields that are not required

We can remove these two because the files they were referencing did not
exist in the older versions. So this is not a breaking change

* fix: husky warning

* fix: revert deleting prepare script before publishing

---------

Co-authored-by: CahidArda <cahidardaooz@hotmail.com>
  • Loading branch information
ytkimirti and CahidArda authored Oct 4, 2024
1 parent d949397 commit 45ed724
Show file tree
Hide file tree
Showing 26 changed files with 50 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
working-directory: ./dist
run: |
npm pkg delete scripts.prepare
npm publish --access public --tag=next
npm publish --access public --tag=canary
15 changes: 6 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ jobs:
run: bun run build

- name: Install example
run: |
bun install
bun add @upstash/redis@../../dist
run: bun add @upstash/redis@../../dist
working-directory: ./examples/vercel-functions-app-router

- name: Build example
Expand Down Expand Up @@ -100,9 +98,7 @@ jobs:
run: bun run build

- name: Install example
run: |
bun install
bun add @upstash/redis@../../dist
run: bun add @upstash/redis@../../dist
working-directory: ./examples/vercel-functions-pages-router

- name: Build example
Expand Down Expand Up @@ -255,7 +251,6 @@ jobs:

- name: Install example
run: |
bun install
bun add @upstash/redis@../../dist
npm install -g wrangler
working-directory: examples/cloudflare-workers
Expand Down Expand Up @@ -348,7 +343,6 @@ jobs:

- name: Install example
run: |
bun install
bun add @upstash/redis@../../dist
npm install -g wrangler
Expand Down Expand Up @@ -449,7 +443,6 @@ jobs:
- name: Install example
working-directory: ./examples/fastly
run: |
bun install
bun add @upstash/redis@../../dist
curl -L https://github.com/fastly/cli/releases/download/v1.7.0/fastly_v1.7.0_linux-amd64.tar.gz > fastly.tar.gz
tar -xf ./fastly.tar.gz
Expand Down Expand Up @@ -613,3 +606,7 @@ jobs:
run: |
npm pkg delete scripts.prepare
npm publish --tag=ci --verbose
- name: Sleep for 10s
run: sleep 10s
shell: bash
2 changes: 1 addition & 1 deletion examples/auto-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@upstash/redis": "^1.30.1",
"@upstash/redis": "latest",
"next": "14.2.3",
"react": "^18",
"react-dom": "^18"
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-cdk-typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/aws-cdk-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"typescript": "~5.4.5"
},
"dependencies": {
"@upstash/redis": "^1.33.0",
"@upstash/redis": "latest",
"aws-cdk-lib": "2.147.2",
"constructs": "^10.0.0",
"source-map-support": "^0.5.21"
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-lambda/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/aws-lambda/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@upstash/redis": "^1.31.6"
"@upstash/redis": "latest"
}
}

2 changes: 1 addition & 1 deletion examples/azure-functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/azure-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@azure/functions": "^4.0.0",
"@upstash/redis": "^1.34.0"
"@upstash/redis": "latest"
},
"devDependencies": {
"@types/node": "18.x",
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudflare-workers-with-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"publish": "wrangler publish"
},
"dependencies": {
"@upstash/redis": "../../dist"
"@upstash/redis": "latest"
}
}
Binary file added examples/cloudflare-workers/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/fastly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@fastly/js-compute": "^0.5.5",
"@upstash/redis": "../../dist",
"@upstash/redis": "latest",
"flight-path": "^1.0.10"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/google-cloud-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"@google-cloud/functions-framework": "^3.0.0",
"@upstash/redis": "^1.31.6"
"@upstash/redis": "latest"
}
}

2 changes: 1 addition & 1 deletion examples/ion/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "next start"
},
"dependencies": {
"@upstash/redis": "^1.34.0",
"@upstash/redis": "latest",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18",
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@upstash/redis": "^1.33.0",
"@upstash/redis": "latest",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@upstash/redis": "^1.33.0",
"@upstash/redis": "latest",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@upstash/redis": "^1.33.0"
"@upstash/redis": "latest"
}
}
2 changes: 1 addition & 1 deletion examples/serverless-framework/counter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/serverless-framework/counter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@upstash/redis": "^1.31.6"
"@upstash/redis": "latest"
}
}

2 changes: 1 addition & 1 deletion examples/sst-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"packages/*"
],
"dependencies": {
"@upstash/redis": "^1.34.0"
"@upstash/redis": "latest"
}
}
2 changes: 1 addition & 1 deletion examples/terraform/counter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@upstash/redis": "^1.31.6"
"@upstash/redis": "latest"
}
}

2 changes: 1 addition & 1 deletion examples/vercel-functions-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@upstash/redis": "^1.33.0",
"@upstash/redis": "latest",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
Expand Down
2 changes: 1 addition & 1 deletion examples/vercel-functions-pages-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@upstash/redis": "^1.33.0",
"@upstash/redis": "latest",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
Expand Down
46 changes: 22 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.30.2",
"main": "./nodejs.js",
"module": "./nodejs.mjs",
"types": "./nodejs.d.ts",
"exports": {
".": {
"import": "./nodejs.mjs",
Expand All @@ -12,22 +13,31 @@
"import": "./nodejs.mjs",
"require": "./nodejs.js"
},
"./node.js": "./node.js",
"./node.mjs": "./node.mjs",
"./cloudflare": {
"import": "./cloudflare.mjs",
"require": "./cloudflare.js"
},
"./cloudflare.js": "./cloudflare.js",
"./cloudflare.mjs": "./cloudflare.mjs",
"./cloudflare.js": {
"import": "./cloudflare.mjs",
"require": "./cloudflare.js"
},
"./cloudflare.mjs": {
"import": "./cloudflare.mjs",
"require": "./cloudflare.js"
},
"./fastly": {
"import": "./fastly.mjs",
"require": "./fastly.js"
},
"./fastly.js": "./fastly.js",
"./fastly.mjs": "./fastly.mjs"
"./fastly.js": {
"import": "./fastly.mjs",
"require": "./fastly.js"
},
"./fastly.mjs": {
"import": "./fastly.mjs",
"require": "./fastly.js"
}
},
"types": "./nodejs.d.ts",
"description": "An HTTP/REST based Redis client built on top of Upstash REST API.",
"repository": {
"type": "git",
Expand All @@ -41,39 +51,27 @@
"upstash"
],
"files": [
"./**"
"./*"
],
"scripts": {
"build": "tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/",
"build": "tsup && cp package.json README.md LICENSE dist/",
"test": "bun test pkg",
"fmt": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"prepare": "husky install",
"prepare": "husky",
"lint": "eslint \"**/*.{js,ts,tsx}\" --quiet --fix",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"",
"lint:fix": "eslint . -c .ts,.tsx,.js,.jsx --fix",
"commit": "cz",
"lint:format": "bun run lint:fix && bun run format"
"lint:format": "bun run lint:fix && bun run format",
"check-exports": "bun run build && cd dist && attw -P"
},
"author": "Andreas Thomas <dev@chronark.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/upstash/upstash-redis/issues"
},
"homepage": "https://github.com/upstash/upstash-redis#readme",
"typesVersions": {
"*": {
"nodejs": [
"./nodejs.d.ts"
],
"cloudflare": [
"./cloudflare.d.ts"
],
"fastly": [
"./fastly.d.ts"
]
}
},
"devDependencies": {
"@biomejs/biome": "latest",
"@commitlint/cli": "^19.3.0",
Expand Down
5 changes: 0 additions & 5 deletions tsup.config.js → tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["platforms/nodejs.ts", "platforms/cloudflare.ts", "platforms/fastly.ts"],
format: ["cjs", "esm"],
splitting: true,
sourcemap: false,
clean: true,
bundle: true,
dts: true,
minify: true,
minifyWhitespace: true,
});

0 comments on commit 45ed724

Please sign in to comment.