Skip to content

Commit

Permalink
chore: switch to turborepo and bun
Browse files Browse the repository at this point in the history
  • Loading branch information
IslamZaoui committed Sep 29, 2024
1 parent 8148c57 commit 1414ad2
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 4,428 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI/CD

on:
push:
Expand All @@ -13,19 +13,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up bun
uses: oven-sh/setup-bun@v2
with:
version: 9.11.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
bun-version: 1.1.29

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Run lint
run: bun lint

- name: Run linter
run: pnpm lint && pnpm build
- name: Run build
run: bun run build
18 changes: 6 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish
on:
workflow_run:
workflows: [Lint]
workflows: [CI/CD]
branches: [main]
types: [completed]

Expand All @@ -19,25 +19,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Set up bun
uses: oven-sh/setup-bun@v2
with:
version: 9.11.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
bun-version: 1.1.29

- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
publish: bun release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
dist
.vercel
.vercel
bun.lockb
.turbo
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Secure your [sveltekit](https://kit.svelte.dev/) app using [http response headers](https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html)

[![Lint](https://github.com/IslamZaoui/securekit/actions/workflows/lint.yaml/badge.svg)](https://github.com/IslamZaoui/securekit/actions/workflows/lint.yaml)
[![npm](https://img.shields.io/npm/v/%40islamzaoui%2Fsecurekit)](https://www.npmjs.com/package/@islamzaoui/securekit)
[![CI/CD](https://github.com/IslamZaoui/securekit/actions/workflows/lint.yaml/badge.svg)](https://github.com/IslamZaoui/securekit/actions/workflows/lint.yaml)
[![NPM](https://img.shields.io/npm/v/%40islamzaoui%2Fsecurekit)](https://www.npmjs.com/package/@islamzaoui/securekit)
[![Issues](https://img.shields.io/github/issues/IslamZaoui/securekit)](https://github.com/IslamZaoui/securekit/issues)
[![License](https://img.shields.io/github/license/IslamZaoui/securekit)](https://github.com/IslamZaoui/securekit/blob/main/LICENSE)

Expand Down
9 changes: 4 additions & 5 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,25 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"postinstall": "cd ../../packages/securekit && pnpm run build"
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-vercel": "^5.4.4",
"@sveltejs/kit": "catalog:default",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^9.6.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "catalog:default",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.4.9",
"typescript": "catalog:default",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3"
},
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
"name": "monorepo",
"private": true,
"scripts": {
"build": "pnpm run -r build",
"dev": "pnpm run -r --parallel --stream dev",
"release": "pnpm run -r build && changeset publish",
"lint": "prettier --check \"**/*.{json,md}\" && pnpm run -r lint",
"format": "prettier --write \"**/*.{json,md}\" && pnpm run -r format"
"build": "turbo run build",
"dev": "turbo run dev",
"release": "turbo run build && changeset publish",
"lint": "prettier --check \"**/*.{json,md}\" && turbo run lint",
"format": "prettier --write \"**/*.{json,md}\" && turbo run format"
},
"workspaces": [
"packages/*",
"apps/*"
],
"devDependencies": {
"@changesets/cli": "catalog:default",
"prettier": "catalog:default"
"@changesets/cli": "^2.27.8",
"prettier": "^3.1.1",
"turbo": "^2.1.2"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
8 changes: 4 additions & 4 deletions packages/securekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
"license": "MIT",
"description": "Secure your sveltekit app using http response security headers",
"devDependencies": {
"prettier": "catalog:default",
"tsup": "catalog:default",
"typescript": "catalog:default"
"prettier": "^3.1.1",
"tsup": "^8.3.0",
"typescript": "^5.0.0"
},
"peerDependencies": {
"@sveltejs/kit": "catalog:default"
"@sveltejs/kit": "^2.0.0"
}
}
Loading

0 comments on commit 1414ad2

Please sign in to comment.