Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/js-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: JavaScript CI

on:
pull_request:
branches:
- main
paths:
- '**/*.ts'
- '**/*.js'
push:
branches:
- main
paths:
- '**/*.ts'
- '**/*.js'

jobs:
lint-ts:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.6.5
run_install: true
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Check Types
run: pnpm lint:ts
lint-js:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: 1.9.4
- name: Biome Check
run: biome ci --formatter-enabled=false --changed

11 changes: 11 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

# Check if the current branch is main or in a detached state
branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)

if [[ "$branch" == "main" ]]; then
echo "You are on the main branch. Committing directly to main is not allowed."
exit 1
fi

pnpm lint-staged
5 changes: 3 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": false
"useIgnoreFile": false,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": false,
"ignore": ["node_modules", "dist"]
"include": ["src/**/*"]
},
"formatter": {
"enabled": true,
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jacobwolf/gitops-secrets",
"version": "0.0.1",
"version": "0.0.2",
"description": "Easily and securely inject environment variable secrets—no matter the size—into any JavaScript runtime.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -9,11 +9,16 @@
"access": "public"
},
"scripts": {
"lint": "biome check --write .",
"lint:js": "biome check --write .",
"lint:ts": "tsc --noEmit --pretty",
"format": "biome format --write .",
"build": "tsup",
"test": "vitest",
"prepublishOnly": "pnpm build"
"prepublishOnly": "pnpm build",
"prepare": "husky"
},
"lint-staged": {
"*.{js,ts}": ["pnpm lint:js"]
},
"repository": {
"type": "git",
Expand All @@ -25,6 +30,8 @@
"packageManager": "[email protected]",
"devDependencies": {
"@biomejs/biome": "1.9.4",
"husky": "^9.1.7",
"lint-staged": "^15.5.0",
"tsup": "^8.4.0",
"typescript": "^5.8.2",
"vitest": "^3.0.9"
Expand Down
Loading