Skip to content

Commit

Permalink
refactor(ci,deps): updated deps, added .gitlab-ci.yml, revamped test-…
Browse files Browse the repository at this point in the history
…utils

[bump]
  • Loading branch information
DuCanhGH committed Apr 4, 2024
1 parent 44d1676 commit 738bdee
Show file tree
Hide file tree
Showing 62 changed files with 2,138 additions and 1,329 deletions.
42 changes: 42 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
default:
image: node:20.10.0
before_script:
- corepack enable pnpm
- pnpm config set store-dir .pnpm-store
- pnpm i
cache:
key:
files:
- pnpm-lock.yaml
paths:
- .pnpm-store

workflow:
rules:
- if: '$CI_COMMIT_MESSAGE !~ /\[skip ci\]/'

stages:
- build-and-test
- publish

build-and-test-job:
stage: build-and-test
script:
- pnpm build
- pnpm typecheck
- NEXT_TEST_MODE=dev pnpm test -- -- --ci --runInBand
- NEXT_TEST_MODE=start pnpm test -- -- --ci --runInBand

publish-job:
stage: publish
id_tokens:
SIGSTORE_ID_TOKEN:
aud: sigstore
script:
- pnpm build
- pnpm typecheck
- pnpm serwist-release
rules:
- if: '$CI_COMMIT_BRANCH == "master" &&
$CI_PIPELINE_SOURCE != "merge_request_event" &&
($CI_COMMIT_TITLE =~ /chore\(packages\): publish packages/ || $CI_COMMIT_MESSAGE =~ /\[bump\]/)'
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
32 changes: 16 additions & 16 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "workspace:*",
"@mantine/hooks": "7.6.1",
"@tabler/icons-react": "2.47.0",
"bright": "0.8.4",
"@mantine/hooks": "7.7.1",
"@tabler/icons-react": "3.1.0",
"bright": "0.8.5",
"client-only": "0.0.1",
"contentlayer": "0.3.4",
"highlight.js": "11.9.0",
"next": "14.2.0-canary.3",
"next": "14.2.0-canary.56",
"next-contentlayer": "0.3.4",
"react": "18.3.0-canary-966d17483-20240305",
"react-dom": "18.3.0-canary-966d17483-20240305",
"react": "19.0.0-canary-7a2609eed-20240403",
"react-dom": "19.0.0-canary-7a2609eed-20240403",
"server-only": "0.0.1",
"tailwind-merge": "2.2.1",
"tailwind-merge": "2.2.2",
"uuid": "9.0.1",
"zustand": "4.5.2"
},
"devDependencies": {
"@types/extend": "3.0.4",
"@types/hast": "3.0.4",
"@types/mdast": "4.0.3",
"@types/mdx": "2.0.11",
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"@types/mdx": "2.0.12",
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"@types/uuid": "9.0.8",
"autoprefixer": "10.4.18",
"autoprefixer": "10.4.19",
"extend": "3.0.2",
"github-slugger": "2.0.0",
"hast-util-has-property": "3.0.0",
Expand All @@ -42,12 +42,12 @@
"mdast-util-mdx": "3.0.0",
"mdast-util-to-markdown": "2.1.0",
"mdast-util-to-string": "4.0.0",
"mdx-bundler": "10.0.1",
"postcss": "8.4.35",
"mdx-bundler": "10.0.2",
"postcss": "8.4.38",
"rehype-highlight": "7.0.0",
"rehype-sanitize": "6.0.0",
"tailwindcss": "3.4.1",
"typescript": "5.5.0-dev.20240306",
"tailwindcss": "3.4.3",
"typescript": "5.5.0-dev.20240404",
"unified": "10.1.2",
"unist-util-is": "6.0.0",
"unist-util-visit": "5.0.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Callout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Icon as TablerIcon, IconCheck as SuccessIcon, IconExclamationMark as WarningIcon, IconX as ErrorIcon } from "@tabler/icons-react";
import { IconX as ErrorIcon, IconCheck as SuccessIcon, type Icon as TablerIcon, IconExclamationMark as WarningIcon } from "@tabler/icons-react";
import type { DetailedHTMLProps, HTMLAttributes } from "react";
import { twMerge } from "tailwind-merge";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const withPWA = require("@ducanh2912/next-pwa").default({
import withPWAInit from "@ducanh2912/next-pwa";

const withPWA = withPWAInit({
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
Expand All @@ -9,4 +11,4 @@ const nextConfig = {
reactStrictMode: true,
};

module.exports = withPWA(nextConfig);
export default withPWA(nextConfig);
10 changes: 5 additions & 5 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
14 changes: 7 additions & 7 deletions examples/custom-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"@fastify/compress": "7.0.0",
"@fastify/compress": "7.0.3",
"cross-env": "7.0.3",
"fastify": "4.26.2",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@swc/core": "1.4.5",
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"@swc/core": "1.4.12",
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"nodemon": "3.1.0",
"rimraf": "5.0.5",
"ts-node": "10.9.2",
"typescript": "5.3.3"
"typescript": "5.4.3"
}
}
2 changes: 1 addition & 1 deletion examples/custom-server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fastify = Fastify({
},
});

const port = parseInt(process.env.PORT ?? "3000", 10);
const port = Number.parseInt(process.env.PORT ?? "3000", 10);
const dev = process.env.NODE_ENV !== "production";

fastify.register(fastifyCompress);
Expand Down
10 changes: 5 additions & 5 deletions examples/custom-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
10 changes: 5 additions & 5 deletions examples/lifecycle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
16 changes: 8 additions & 8 deletions examples/next-i18next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"cross-env": "7.0.3",
"express": "4.18.3",
"express": "4.19.2",
"fastify-compress": "4.1.0",
"i18next": "23.10.0",
"next": "14.1.2",
"i18next": "23.10.1",
"next": "14.1.4",
"next-i18next": "15.2.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "14.0.5"
"react-i18next": "14.1.0"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
10 changes: 5 additions & 5 deletions examples/next-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
12 changes: 6 additions & 6 deletions examples/offline-fallback-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"sharp": "0.33.2"
"sharp": "0.33.3"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
8 changes: 4 additions & 4 deletions examples/reproduction-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"typescript": "5.3.3"
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"typescript": "5.4.3"
}
}
10 changes: 5 additions & 5 deletions examples/web-push/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
},
"dependencies": {
"@ducanh2912/next-pwa": "latest",
"next": "14.1.2",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"web-push": "3.6.7"
},
"devDependencies": {
"@types/node": "20.11.24",
"@types/react": "18.2.63",
"@types/react-dom": "18.2.20",
"@types/node": "20.12.4",
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24",
"@types/web-push": "3.6.3",
"typescript": "5.3.3"
"typescript": "5.4.3"
}
}
2 changes: 1 addition & 1 deletion examples/web-push/worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ self.addEventListener("notificationclick", (event) => {
);
});

export {};
export type {};
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
"type": "module",
"license": "MIT",
"private": true,
"packageManager": "[email protected]",
"workspaces": [
"docs",
"packages/**",
"examples/**",
"!examples/**/.next"
],
"packageManager": "[email protected]",
"workspaces": ["docs", "packages/**", "examples/**", "!**/.next", "next-pwa-e2e-test"],
"scripts": {
"build": "cross-env FORCE_COLOR=1 turbo run build --filter=./packages/*",
"code-check": "biome check --max-diagnostics=150 --log-kind=compact .",
Expand All @@ -27,24 +22,25 @@
"publish-packages": "pnpm typecheck && pnpm lint && pnpm build && changeset publish",
"test": "cross-env FORCE_COLOR=1 turbo run test --filter=./packages/*",
"typecheck": "cross-env FORCE_COLOR=1 turbo run typecheck"
},
},
"devDependencies": {
"@biomejs/biome": "1.5.3",
"@biomejs/biome": "1.6.4",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@ducanh2912/next-pwa": "workspace:*",
"@types/node": "20.11.24",
"@serwist/release": "workspace:*",
"@types/node": "20.12.4",
"@types/shell-quote": "1.7.5",
"@typescript-eslint/eslint-plugin": "7.1.1",
"@typescript-eslint/parser": "7.1.1",
"@typescript-eslint/eslint-plugin": "7.5.0",
"@typescript-eslint/parser": "7.5.0",
"cross-env": "7.0.3",
"fast-glob": "3.3.2",
"jest": "29.7.0",
"npm-check-updates": "16.14.15",
"npm-check-updates": "16.14.18",
"rimraf": "5.0.5",
"shell-quote": "1.8.1",
"tslib": "2.6.2",
"turbo": "1.12.4",
"typescript": "5.5.0-dev.20240306"
"turbo": "1.13.2",
"typescript": "5.5.0-dev.20240404"
}
}
Loading

0 comments on commit 738bdee

Please sign in to comment.