Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repo scaffolding #27

Merged
merged 5 commits into from Feb 22, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Expand Up @@ -12,5 +12,5 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": ["@spautz/tiny-immutable-set--basic-demo"]
}
2 changes: 2 additions & 0 deletions .changeset/mean-roses-eat.md
@@ -0,0 +1,2 @@
---
---
21 changes: 12 additions & 9 deletions .github/reusable-workflows/setup-repo/action.yml
@@ -1,28 +1,26 @@
name: Setup repo (reusable)
description: Standardized workspace setup for the tiny-immutable-set repo
description: Standardized workspace setup for tiny-immutable-set
inputs:
node-version:
description: NodeJS version, for actions/setup-node
type: string
required: true
use-lockfile:
description: Whether or not to honor pnpm-lock.yaml or other lockfiles
type: boolean
required: true
default: true
default: 'true'

runs:
using: composite
steps:
- uses: actions/setup-node@v3.7.0
if: ${{ github.event.inputs.node-version }} != "nvmrc"
if: ${{ inputs.node-version == 'nvmrc' }}
with:
node-version: ${{ github.event.inputs.node-version }}
node-version-file: .nvmrc
registry-url: 'https://registry.npmjs.org'
- uses: actions/setup-node@v3.7.0
if: ${{ github.event.inputs.node-version }} == "nvmrc"
if: ${{ inputs.node-version != 'nvmrc' }}
with:
node-version-file: .nvmrc
node-version: ${{ inputs.node-version }}
registry-url: 'https://registry.npmjs.org'

- uses: oven-sh/setup-bun@v1.1.1
Expand All @@ -45,10 +43,15 @@ runs:
${{ runner.os }}-pnpm-store-

- name: Remove lockfile to loosen dependency tree
if: ${{ !github.event.inputs.use-lockfile }}
if: ${{ inputs.use-lockfile == 'false' }}
shell: bash
run: |
rm -f bun.lockb package-lock.json pnpm-lock.yaml yarn.lock
- name: Keep lockfile intact
if: ${{ inputs.use-lockfile != 'false' }}
shell: bash
run: |
echo "(not removing lockfile)"

- name: Install dependencies
shell: bash
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -54,3 +54,23 @@ jobs:
run: |
cd packages/${{ matrix.package-name }}
pnpm run all:ci

demo-ci:
name: Demo CI
runs-on: ubuntu-latest
strategy:
matrix:
demo-name: [basic-demo]

steps:
- uses: actions/checkout@v3.5.3

- uses: ./.github/reusable-workflows/setup-repo
with:
node-version: latest
use-lockfile: false

- name: Run CI checks for demo
run: |
cd demos/${{ matrix.demo-name }}
pnpm run all:ci
3 changes: 2 additions & 1 deletion .github/workflows/publish-release.yml
Expand Up @@ -34,6 +34,7 @@ jobs:
- name: Publish to NPM
run: |
cd packages/${{ matrix.package-name }}
NPM_CONFIG_PROVENANCE=true pnpm publish --tag next
pnpm pack
NPM_CONFIG_PROVENANCE=true pnpm publish --tag next *${{ matrix.package-name }}*.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -47,6 +47,7 @@ dist-ssr/
legacy-types/
out/
public/build/
packages/*/*.tgz

# storybook

Expand Down
7 changes: 6 additions & 1 deletion .prettierignore
Expand Up @@ -28,7 +28,6 @@ yarn.lock
.pnp.js
.pnpm-store/
node_modules/
framework-tests/*/.yalc/

# unit tests

Expand All @@ -49,17 +48,23 @@ playwright-report/

.cache/
.next/
_fresh/
build/
dist/
dist-ssr/
legacy-types/
out/
public/build/
packages/*/*.tgz

# storybook

storybook-static/

# framework-tests

framework-tests/*/.yalc/

# log files

lerna-debug.log*
Expand Down
3 changes: 3 additions & 0 deletions framework-tests/pnpm-workspace.yaml
@@ -0,0 +1,3 @@
# This ensures no stray `pnpm` commands run within a framework test reach the main workspace
packages:
- '.'
17 changes: 9 additions & 8 deletions package.json
Expand Up @@ -14,7 +14,7 @@
"url": "https://github.com/spautz/"
},
"engines": {
"node": "^16 || ^18 || ^19 || ^20 || ^21",
"node": "^18 || ^20 || ^21",
"pnpm": "^8"
},
"packageManager": "pnpm@8.15.1",
Expand All @@ -35,7 +35,7 @@
"packages:test:coverage": "pnpm -r run test:coverage",
"packages:test:quick": "pnpm --parallel -r run test:quick",
"packages:typecheck": "pnpm -r run typecheck",
"packages:yalc-publish": "pnpm -r --filter \"*^...\" exec yalc publish --sig --push --replace",
"packages:yalc-publish": "pnpm -r --filter \"./packages/*\" exec yalc publish --sig --push --replace",
"packages:all": "pnpm -r run all",
"packages:all:readonly": "pnpm -r run all:readonly",
"packages:all:quick": "pnpm --parallel -r run all:quick",
Expand Down Expand Up @@ -67,13 +67,14 @@
"typecheck": "tsc -p ./tsconfig.json --noEmit"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.14.1",
"@changesets/cli": "2.27.1",
"@changesets/types": "6.0.0",
"@size-limit/preset-small-lib": "11.0.2",
"@typescript-eslint/eslint-plugin": "6.20.0",
"@typescript-eslint/parser": "6.20.0",
"@vitest/coverage-v8": "1.2.2",
"@vitest/ui": "1.2.2",
"@typescript-eslint/eslint-plugin": "7.0.2",
"@typescript-eslint/parser": "7.0.2",
"@vitest/coverage-v8": "1.3.1",
"@vitest/ui": "1.3.1",
"changesets-format-with-issue-links": "0.3.0",
"downlevel-dts": "0.11.0",
"eslint": "8.56.0",
Expand All @@ -85,9 +86,9 @@
"publint": "0.2.7",
"rimraf": "5.0.5",
"size-limit": "11.0.2",
"tsup": "8.0.1",
"tsup": "8.0.2",
"typescript": "5.3.3",
"vitest": "1.2.2",
"vitest": "1.3.1",
"yalc": "1.0.0-pre.53"
},
"lint-staged": {
Expand Down
15 changes: 6 additions & 9 deletions packages/tiny-immutable-set/package.json
Expand Up @@ -51,21 +51,21 @@
},
"main": "./dist/cjs/index.cjs",
"module": "./dist/esm/index.js",
"jsnext:main": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"sideEffects": false,
"scripts": {
"____ HOOKS _________________________________________________________": "",
"prepack": "pnpm run clean && pnpm run build",
"postpack": "pnpm run build:verifypack",
"____ INTEGRATION ___________________________________________________": "",
"clean": "pnpm run build:clean && pnpm run test:clean && rimraf --glob ./node_modules/.cache *.log",
"all": "pnpm run typecheck && pnpm run lint:fix && pnpm run test:coverage && pnpm run build",
"all:readonly": "pnpm run typecheck && pnpm run lint && pnpm run test:quick",
"all:quick": "pnpm run typecheck && pnpm run lint:fix",
"all:ci": "pnpm run typecheck && pnpm run lint && pnpm run test:ci && pnpm run build",
"all:ci": "pnpm run typecheck && pnpm run lint && pnpm run test:ci && pnpm pack",
"____ INDIVIDUAL COMMANDS ___________________________________________": "",
"build": "pnpm run build:clean && pnpm run build:cjs && pnpm run build:esm && pnpm run build:verify && pnpm run build:legacytypes",
"build:clean": "rimraf ./dist ./legacy-types",
"build:clean": "rimraf --glob ./dist ./legacy-types ./*.tgz",
"build:cjs": "tsup src/index.ts --format cjs --dts --outDir=./dist/cjs/ --tsconfig=./tsconfig.build-cjs.json",
"build:cjs:watch": "pnpm run build:cjs --watch",
"build:esm": "tsc -p tsconfig.build-esm.json",
Expand All @@ -75,6 +75,7 @@
"build:legacytypes:4.0": "downlevel-dts ./dist ./legacy-types/ts4.0/dist --to=4.0",
"build:legacytypes:4.5": "downlevel-dts ./dist ./legacy-types/ts4.5/dist --to=4.5",
"build:verify": "publint --strict && size-limit",
"build:verifypack": "ls *.tgz | xargs -I {} attw {} --exclude-entrypoints internal-raw-src",
"lint": "eslint . --max-warnings 0",
"lint:fix": "eslint . --max-warnings 0 --fix",
"test": "pnpm run test:coverage",
Expand All @@ -90,7 +91,7 @@
"dependencies": {},
"devDependencies": {
"@ngard/tiny-get": "1.2.2",
"@types/node": "20.11.16"
"@types/node": "20.11.19"
},
"peerDependencies": {},
"size-limit": [
Expand All @@ -99,14 +100,10 @@
"import": "{}",
"limit": "20 B"
},
{
"path": "./dist/esm/index.js",
"limit": "1 kb"
},
{
"path": "./dist/esm/index.js",
"import": "{ set }",
"limit": "1 kb"
"limit": "300 B"
}
],
"typesVersions": {
Expand Down