From 2352f4579432ae9336296c61b46645b9b8fe2025 Mon Sep 17 00:00:00 2001 From: Hikari Date: Wed, 21 Jan 2026 13:59:28 -0800 Subject: [PATCH] feat: scaffold TypeScript project - Initialize pnpm project with TypeScript support - Add standard ESLint and TypeScript configurations - Create basic src/index.ts with sample export - Set up GitHub Actions CI workflow - Add prod.env with 1Password references - Configure .gitignore for Node.js projects Co-Authored-By: Claude Opus 4 --- .github/workflows/ci.yml | 40 ++++++++++++ .gitignore | 133 +++++++++++++++++++++++++++++++++++++++ eslint.config.mjs | 3 + package.json | 27 ++++++++ prod.env | 7 +++ src/index.ts | 17 +++++ tsconfig.json | 8 +++ 7 files changed, 235 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 eslint.config.mjs create mode 100644 package.json create mode 100644 prod.env create mode 100644 src/index.ts create mode 100644 tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..112b9de --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + ci: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Check dependency pinning + uses: naomi-lgbt/dependency-pin-check@main + + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Run linter + run: pnpm lint + + - name: Build project + run: pnpm build + + - name: Run tests + run: pnpm test \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16ece5c --- /dev/null +++ b/.gitignore @@ -0,0 +1,133 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# pnpm +pnpm-lock.yaml \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..4a7b3c7 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,3 @@ +import Config from "@nhcarrigan/eslint-config"; + +export default Config; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..facfd90 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "rondelle", + "version": "1.0.0", + "description": "", + "main": "./dist/index.js", + "type": "module", + "scripts": { + "build": "tsc", + "lint": "eslint .", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "packageManager": "pnpm@10.28.1", + "devDependencies": { + "@nhcarrigan/eslint-config": "5.2.0", + "@nhcarrigan/typescript-config": "4.0.0", + "@types/node": "22.10.7", + "eslint": "9.19.0", + "typescript": "5.7.3" + }, + "engines": { + "node": ">=20.0.0", + "pnpm": ">=9.0.0" + } +} diff --git a/prod.env b/prod.env new file mode 100644 index 0000000..abcf3d5 --- /dev/null +++ b/prod.env @@ -0,0 +1,7 @@ +# 1Password vault references - safe to commit +# Run with: op run --env-file=prod.env -- + +# Example environment variables +DATABASE_URL=op://Development/rondelle-database/connection-string +API_KEY=op://Development/rondelle-api/api-key +SECRET_TOKEN=op://Development/rondelle-secrets/token \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..3b615b1 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,17 @@ +/** + * @copyright 2026 + * @license Naomi's Public License + * @author Naomi Carrigan + */ + +/** + * Adds two numbers together. + * @param a - The first number. + * @param b - The second number. + * @returns The sum of the two numbers. + */ +const calculateSum = (a: number, b: number): number => { + return a + b; +}; + +export { calculateSum }; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bb111a6 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@nhcarrigan/typescript-config", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["src/**/*"] +} \ No newline at end of file