Skip to content

Commit cc6077d

Browse files
committed
Initial package boilerplate
1 parent 6488c87 commit cc6077d

13 files changed

+5044
-0
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.eslintrc.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
const { resolve } = require("node:path");
3+
4+
const project = resolve(process.cwd(), "tsconfig.json");
5+
6+
/** @type {import("eslint").Linter.Config} */
7+
module.exports = {
8+
extends: ["eslint:recommended", "prettier"],
9+
plugins: ["only-warn", "jest"],
10+
parser: "@typescript-eslint/parser",
11+
globals: {
12+
React: true,
13+
JSX: true,
14+
},
15+
env: {
16+
node: true,
17+
"jest/globals": true,
18+
},
19+
settings: {
20+
"import/resolver": {
21+
typescript: {
22+
project,
23+
},
24+
},
25+
},
26+
ignorePatterns: [
27+
// Ignore dotfiles
28+
".*.js",
29+
"node_modules/",
30+
"dist/",
31+
"coverage/",
32+
],
33+
overrides: [
34+
{
35+
files: ["*.js?(x)", "*.ts?(x)"],
36+
},
37+
],
38+
};

.github/workflows/ci.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI Checks
2+
on: pull_request
3+
4+
jobs:
5+
ci-checks:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
9+
- name: Use Node.js
10+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
11+
with:
12+
node-version: 20.x
13+
- name: Extract pnpm version and install
14+
run: |
15+
VERSION=$(cat package.json | grep '"packageManager": "pnpm@' | sed 's/.*"pnpm@\([^"]*\)".*/\1/')
16+
npm install -g pnpm@$VERSION
17+
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v 4.0.2
18+
with:
19+
path: ~/.pnpm-store
20+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
21+
- run: pnpm install --frozen-lockfile
22+
- run: pnpm build
23+
- run: pnpm lint
24+
- run: pnpm format:check
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release & Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
release-and-publish:
15+
runs-on: ubuntu-latest
16+
environment: main
17+
steps:
18+
19+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Use Node.js
23+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
24+
with:
25+
node-version: 20.x
26+
- name: Extract pnpm version and install
27+
run: |
28+
VERSION=$(cat package.json | grep '"packageManager": "pnpm@' | sed 's/.*"pnpm@\([^"]*\)".*/\1/')
29+
npm install -g pnpm@$VERSION
30+
- name: Cache pnpm modules
31+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v 4.0.2
32+
with:
33+
path: ~/.pnpm-store
34+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
- run: pnpm install --frozen-lockfile
36+
- run: pnpm build
37+
- name: Configure PNPM to use token
38+
run:
39+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
40+
- name: Run Changeset Workflow
41+
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
with:
46+
publish: pnpm changeset publish
47+
createGithubReleases: true

.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# Dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# Local env files
9+
.env
10+
.env.local
11+
.env.development.local
12+
.env.test.local
13+
.env.production.local
14+
15+
# Testing
16+
coverage
17+
18+
# Build Outputs
19+
dist
20+
21+
22+
# Debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# Misc
28+
.DS_Store
29+
*.pem

package.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "ghcommit",
3+
"version": "0.1.0",
4+
"private": false,
5+
"description": "Directly change files on github using the github API, to support GPG signing",
6+
"keywords": [
7+
"actions",
8+
"github",
9+
"git",
10+
"gpg"
11+
],
12+
"license": "MIT",
13+
"author": {
14+
"name": "Sam Lanning",
15+
"url": "https://samlanning.com"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/s0/ghcommit.git"
20+
},
21+
"exports": {
22+
".": {
23+
"import": "./dist/index.mjs",
24+
"require": "./dist/index.js",
25+
"types": "./dist/index.d.ts"
26+
}
27+
},
28+
"scripts": {
29+
"build": "tsup",
30+
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
31+
"format:fix": "prettier --write \"**/*.{ts,tsx,md}\"",
32+
"lint": "eslint . --max-warnings 0",
33+
"test": "jest",
34+
"test:watch": "jest --watch"
35+
},
36+
"devDependencies": {
37+
"@changesets/cli": "^2.27.7",
38+
"@types/eslint": "^8.56.5",
39+
"@types/jest": "^29.5.12",
40+
"@types/node": "^20.11.24",
41+
"@typescript-eslint/eslint-plugin": "^7.16.0",
42+
"@typescript-eslint/parser": "^7.16.0",
43+
"eslint": "^8.57.0",
44+
"eslint-config-prettier": "^9.1.0",
45+
"eslint-plugin-jest": "^28.6.0",
46+
"eslint-plugin-only-warn": "^1.1.0",
47+
"jest": "^29.7.0",
48+
"prettier": "^3.3.3",
49+
"ts-jest": "^29.2.0",
50+
"tsup": "^8.1.0",
51+
"typescript": "^5.3.3"
52+
},
53+
"files": [
54+
"dist"
55+
],
56+
"packageManager": "[email protected]",
57+
"publishConfig": {
58+
"access": "public"
59+
}
60+
}

0 commit comments

Comments
 (0)