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

Commonality 1.0 #380

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e9f2332
Delete redundant test files and update dependencies in package.json
alec-chernicki Jul 10, 2024
8223507
chore: update lockfile
alec-chernicki Jul 10, 2024
a9aca5e
Add workflow for publishing package preview and remove test
alec-chernicki Jul 10, 2024
458dea0
Delete commonality workflow and add vitest to utils-onboarding packag…
alec-chernicki Jul 10, 2024
5886fe9
Update vitest version to 2.0.2 in multiple package.json
alec-chernicki Jul 10, 2024
0d71c0d
Update environment variables in ci.yml file
alec-chernicki Jul 10, 2024
77d3ffb
Add vitest package as a dependency in package.json files
alec-chernicki Jul 10, 2024
ebf25ab
Add vitest dependency to package.json
alec-chernicki Jul 10, 2024
d729a2f
Add vitest as a development dependency to packages
alec-chernicki Jul 10, 2024
a6f23c5
Update test data with churn and complexity values
alec-chernicki Jul 10, 2024
bbb4e03
Add churn and complexity fields to test cases
alec-chernicki Jul 10, 2024
5b2e54c
Add churn and complexity properties in test data objects
alec-chernicki Jul 10, 2024
97e3520
Add churn and complexity properties to test packages
alec-chernicki Jul 10, 2024
29197b1
Update package-preview workflow with new publish path
alec-chernicki Jul 10, 2024
85bad2a
Add vitest package as a dependency
alec-chernicki Jul 10, 2024
45119a9
Add churn and complexity values to packages
alec-chernicki Jul 10, 2024
e1b53e0
Remove "test" script from package.json
alec-chernicki Jul 10, 2024
d7e1292
Refactor tests and add churn, complexity metrics
alec-chernicki Jul 10, 2024
5289bbe
Refactor tests and update package analysis data
alec-chernicki Jul 10, 2024
6f7dd74
Update inline snapshot for dev-peer version test
alec-chernicki Jul 10, 2024
2bc96ec
Rename vite config to vitest.integration.config
alec-chernicki Jul 11, 2024
aef9569
Remove spell check step and update dependencies
alec-chernicki Jul 11, 2024
5cf11e4
Update workflow and commonality dependencies
alec-chernicki Jul 11, 2024
6657e0b
chore: update lockfile
alec-chernicki Jul 11, 2024
7dbd047
Add publish command and update dependencies
alec-chernicki Jul 11, 2024
47879a1
Update publish command and studio dep version
alec-chernicki Jul 11, 2024
fffc255
Update lockfile
alec-chernicki Jul 11, 2024
d7bcb32
Remove lint fix from pre-commit hook
alec-chernicki Jul 11, 2024
3a4ce78
Update publish CLI and workflow for single app
alec-chernicki Jul 11, 2024
ee04815
Wrap publish in try-catch, exit on failure
alec-chernicki Jul 11, 2024
2b859b6
Add GitHub workflow for Commonality publish
alec-chernicki Jul 11, 2024
cbf4f71
Update dependencies in package.json
alec-chernicki Jul 11, 2024
b4c9d78
Update lockfile
alec-chernicki Jul 11, 2024
14f0af5
Add build step to commonality workflow
alec-chernicki Jul 11, 2024
3cec073
Add license and private flags to package schema
alec-chernicki Jul 11, 2024
b183ad1
Update tests and refactor package privacy logic
alec-chernicki Jul 11, 2024
af3c083
Extend pkg-pr-new publish paths in CI workflow
alec-chernicki Jul 12, 2024
f2db530
Update imports from PackageType to BlockType
alec-chernicki Jul 12, 2024
316b80f
Add integration test and update exports with .js extension
alec-chernicki Jul 12, 2024
f91a274
Rename vite config to vitest config
alec-chernicki Jul 12, 2024
e2e8bde
Remove local studio
alec-chernicki Jul 12, 2024
d197630
Update lockfile
alec-chernicki Jul 12, 2024
2a2e1aa
Add name to publish step in workflow
alec-chernicki Jul 12, 2024
ec74d65
Remove init command and related tests
alec-chernicki Jul 12, 2024
27bc629
Update import paths with .js extension
alec-chernicki Jul 12, 2024
b2b1e2a
Refactor privacy handling and update dependencies
alec-chernicki Jul 14, 2024
ec3e4d6
Update tests and types for package privacy and enums
alec-chernicki Jul 14, 2024
8af8566
Update API URL and improve types in publish cmd
alec-chernicki Jul 14, 2024
19516e0
Add gitBranch support and update dependencies
alec-chernicki Jul 18, 2024
78e9d95
Update dependencies and improve publish command
alec-chernicki Jul 26, 2024
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
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ concurrency:
permissions:
contents: read

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -33,9 +29,6 @@ jobs:
- name: Lint
run: pnpm run lint

- name: Spell check
run: pnpm -F documentation run spellcheck

type-check:
runs-on: ubuntu-latest
steps:
Expand Down
38 changes: 23 additions & 15 deletions .github/workflows/commonality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@ name: Commonality

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
FORCE_COLOR: 1
branches:
- '*'

jobs:
validate:
timeout-minutes: 10
publish:
name: Publish Commonality
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
- name: Enable Corepack
run: corepack enable

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

- name: Install dependencies
run: pnpm install

- name: Check
run: pnpm exec commonality check
- name: Build
run: pnpm build

- name: Constrain
run: pnpm exec commonality constrain
- name: Publish Commonality
run: pnpm exec commonality publish
env:
COMMONALITY_PROJECT_ID: ${{ secrets.COMMONALITY_PROJECT_ID }}
COMMONALITY_PUBLISH_KEY: ${{ secrets.COMMONALITY_PUBLISH_KEY }}
25 changes: 25 additions & 0 deletions .github/workflows/package-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Package Preview
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Publish Preview
run: pnpx pkg-pr-new publish --pnpm './apps/commonality' './packages/utils-core'
29 changes: 0 additions & 29 deletions .github/workflows/playwright.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run lint:fix

41 changes: 22 additions & 19 deletions apps/commonality/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"postbuild": "tsc --emitDeclarationOnly --declaration",
"lint": "eslint ./src --fix",
"test": "vitest",
"test:integration": "vitest --config=vite.integration.config.ts",
"test:integration": "vitest --config=vitest.integration.config.ts",
"type-check": "tsc --noEmit",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@antfu/install-pkg": "^0.3.1",
"@commonalityco/studio": "workspace:*",
"@antfu/install-pkg": "^0.3.3",
"@clack/prompts": "^0.7.0",
"@sindresorhus/slugify": "^2.2.1",
"boxen": "^7.1.1",
"chalk": "^5.3.0",
Expand All @@ -59,26 +59,28 @@
"detect-indent": "^7.0.1",
"find-up": "^6.3.0",
"fs-extra": "^11.2.0",
"get-port": "^7.0.0",
"get-port": "^7.1.0",
"git-branch": "^2.0.1",
"globby": "^13.2.2",
"import-meta-resolve": "^4.0.0",
"import-meta-resolve": "^4.1.0",
"ip": "^1.1.9",
"jest-diff": "^29.7.0",
"jiti": "^1.21.0",
"jiti": "^1.21.6",
"ky": "^1.5.0",
"local-pkg": "^0.5.0",
"lodash-es": "^4.17.21",
"micromatch": "^4.0.5",
"nanoid": "^5.0.6",
"micromatch": "^4.0.7",
"nanoid": "^5.0.7",
"ora": "^7.0.1",
"pathe": "^1.1.2",
"pino": "^8.19.0",
"pino": "^8.21.0",
"prompts": "^2.4.2",
"std-env": "^3.7.0",
"strip-ansi": "^7.1.0",
"update-notifier": "^7.0.0",
"update-notifier": "^7.2.0",
"wait-on": "^7.2.0",
"yaml": "^2.3.4",
"zod": "^3.22.4"
"yaml": "^2.5.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@commonalityco/config-tsconfig": "workspace:*",
Expand All @@ -92,21 +94,22 @@
"@commonalityco/utils-core": "workspace:*",
"@commonalityco/utils-file": "workspace:*",
"@commonalityco/utils-onboarding": "workspace:*",
"@swc/core": "^1.4.2",
"@swc/core": "^1.7.2",
"@types/fs-extra": "^11.0.4",
"@types/git-branch": "^2.0.5",
"@types/ip": "^1.1.3",
"@types/lodash-es": "^4.17.12",
"@types/mock-fs": "^4.13.4",
"@types/node": "^20.11.20",
"@types/node": "^20.14.12",
"@types/prompts": "^2.4.9",
"@types/wait-on": "^5.3.4",
"eslint-config-commonality": "workspace:*",
"execa": "^8.0.1",
"mock-fs": "^5.2.0",
"npm-run-all": "^4.1.5",
"rimraf": "^5.0.5",
"tsup": "^8.0.2",
"typescript": "^5.3.3",
"vitest": "^0.34.6"
"rimraf": "^5.0.9",
"tsup": "^8.2.3",
"typescript": "^5.5.4",
"vitest": "^2.0.4"
}
}
}
11 changes: 2 additions & 9 deletions apps/commonality/src/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Command } from 'commander';
import { constrain } from './commands/constrain.js';
import { studio } from './commands/studio.js';
import { check } from './commands/check.js';
import { init } from './commands/init.js';
import { publish } from './commands/publish.js';
import packageJson from '../../package.json';

const program = new Command();
Expand All @@ -16,9 +13,5 @@ program
.description('Build bigger with the tools you already love')
.version(packageJson.version);

program.addCommand(init);
program.addCommand(check);
program.addCommand(constrain);
program.addCommand(studio);

program.addCommand(publish);
program.parse(process.argv);
Loading
Loading