Skip to content

Commit

Permalink
Merge pull request #1341 from belgattitude/global-scripts-prefixes
Browse files Browse the repository at this point in the history
Global scripts prefixes
  • Loading branch information
belgattitude authored Feb 16, 2022
2 parents c03ca67 + 253a235 commit b565d35
Show file tree
Hide file tree
Showing 36 changed files with 822 additions and 261 deletions.
6 changes: 6 additions & 0 deletions .changeset/angry-lamps-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"blog-app": minor
"web-app": minor
---

Add es-check to ensure produced build files passes ecmascript
11 changes: 11 additions & 0 deletions .changeset/chatty-sloths-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"blog-app": minor
"remix-app": minor
"vite-app": minor
"web-app": minor
"@your-org/core-lib": minor
"@your-org/db-main-prisma": minor
"@your-org/ui-lib": minor
---

Refactor scripts identifiers defined in package.json. Restrict usage of ':' in apps and packages
9 changes: 6 additions & 3 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "belgattitude/nextjs-monorepo-example" }],
"changelog": [
"@changesets/changelog-github",
{ "repo": "belgattitude/nextjs-monorepo-example" }
],
"commit": false,
"linked": [],
"access": "private",
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "out-of-range"
}
}
}
6 changes: 6 additions & 0 deletions .changeset/gentle-rules-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"blog-app": minor
"remix-app": minor
---

Added stylint for css files
5 changes: 5 additions & 0 deletions .changeset/short-news-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"blog-app": minor
---

Add size-limit checks for build files
15 changes: 13 additions & 2 deletions .github/workflows/ci-blog-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ jobs:
working-directory: apps/blog-app
run: |
yarn lint --cache
yarn lint-styles
- name: Unit tests
working-directory: apps/blog-app
run: |
yarn ci-test:unit
yarn test-unit --runInBand --color
- name: Build blog-app
working-directory: apps/blog-app
Expand All @@ -110,13 +111,23 @@ jobs:
# Don't send telemetry for ci
NEXT_TELEMETRY_DISABLED: 1

- name: Check bundle size
working-directory: apps/blog-app
run: |
yarn check-build-size
- name: Check ecmascript checks for build files
working-directory: apps/blog-app
run: |
yarn check-dist
- name: Install Playwright
run: npx playwright install --with-deps chromium webkit

- name: E2E run blog-app playwright tests
working-directory: apps/blog-app
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:e2e
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test-e2e
env:
E2E_WEBSERVER_MODE: BUILD_AND_START
CI: 1
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ci-e2e-prisma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:
- dev
- main
paths:
- "packages/db-main-prisma"
- ".github/workflows/**"
- 'packages/db-main-prisma'
- '.github/workflows/**'

pull_request:
types:
- opened
- synchronize
- reopened
paths:
- "packages/db-main-prisma"
- ".github/workflows/**"
- 'packages/db-main-prisma'
- '.github/workflows/**'

jobs:
e2e:
Expand Down Expand Up @@ -65,8 +65,6 @@ jobs:
- name: E2E prisma
working-directory: packages/db-main-prisma
run: |
yarn test:e2e
yarn test-e2e
env:
E2E_PRISMA_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/db-main-prisma-e2e?schema=public


2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e-web-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: E2E run web-app playwright tests
working-directory: apps/web-app
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:e2e
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test-e2e
env:
E2E_WEBSERVER_MODE: BUILD_AND_START
CI: 1
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/ci-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ on:
- dev
- main
paths:
- "packages/**"
- ".yarnrc.yml"
- ".prettier*.*"
- "*.base.json"
- "*.base.js"
- ".prettier*.*"
- ".github/workflows/**"
- 'packages/**'
- '.yarnrc.yml'
- '.prettier*.*'
- '*.base.json'
- '*.base.js'
- '.prettier*.*'
- '.github/workflows/**'

pull_request:
types:
- opened
- synchronize
- reopened
paths:
- "packages/**"
- ".yarnrc.yml"
- "*.base.json"
- "*.base.js"
- ".prettier*.*"
- ".github/workflows/**"
- 'packages/**'
- '.yarnrc.yml'
- '*.base.json'
- '*.base.js'
- '.prettier*.*'
- '.github/workflows/**'

jobs:
test:
Expand Down Expand Up @@ -85,21 +85,20 @@ jobs:
- name: Linter
run: |
yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run lint --cache
yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run lint-styles
# Test packages that have changed (--include & --since)
- name: Unit tests changed packages
run: |
yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run test:unit
yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main --recursive run test-unit --runInBand --colors
# to debug cache issues: ls ${{ github.workspace }}/.cache

# Build packages that have changed (--include & --since), assuming that
# apps build are done already. Otherwise --from & --since
- name: Run build for changed packages
run: |
yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main run packages:build
yarn workspaces foreach -tv --include '@your-org/*' --since=origin/main run build
# Test storybook build on packages that have changed (--include & --since)
- name: Run storybook build for changed packages
run: |
yarn workspaces foreach -tv --exclude '*-app' --since=origin/main run build-storybook
41 changes: 20 additions & 21 deletions .github/workflows/ci-remix-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ on:
- dev
- main
paths:
- "apps/remix-app/**"
- "packages/**"
- "package.json"
- "yarn.lock"
- ".yarnrc.yml"
- "*.base.json"
- "*.base.js"
- ".prettier*.*"
- ".github/workflows/**"

- 'apps/remix-app/**'
- 'packages/**'
- 'package.json'
- 'yarn.lock'
- '.yarnrc.yml'
- '*.base.json'
- '*.base.js'
- '.prettier*.*'
- '.github/workflows/**'

pull_request:
types:
Expand All @@ -26,15 +25,15 @@ on:
# Only consider those files/paths to trigger the github action
# to prevent unnecessary builds.
paths:
- "apps/remix-app/**"
- "packages/**"
- "package.json"
- "yarn.lock"
- ".yarnrc.yml"
- "*.base.json"
- "*.base.js"
- ".prettier*.*"
- ".github/workflows/**"
- 'apps/remix-app/**'
- 'packages/**'
- 'package.json'
- 'yarn.lock'
- '.yarnrc.yml'
- '*.base.json'
- '*.base.js'
- '.prettier*.*'
- '.github/workflows/**'

jobs:
test:
Expand Down Expand Up @@ -78,14 +77,14 @@ jobs:
working-directory: apps/remix-app
run: |
yarn lint --cache
yarn lint-styles
- name: Unit tests
working-directory: apps/remix-app
run: |
yarn ci-test:unit
yarn test-unit --runInBand --color
- name: Build remix-app
working-directory: apps/remix-app
run: |
yarn build
41 changes: 19 additions & 22 deletions .github/workflows/ci-vite-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ on:
- dev
- main
paths:
- "apps/vite-app/**"
- "packages/**"
- "package.json"
- "yarn.lock"
- ".yarnrc.yml"
- "*.base.json"
- "*.base.js"
- ".prettier*.*"
- ".github/workflows/**"
- 'apps/vite-app/**'
- 'packages/**'
- 'package.json'
- 'yarn.lock'
- '.yarnrc.yml'
- '*.base.json'
- '*.base.js'
- '.prettier*.*'
- '.github/workflows/**'

pull_request:
types:
- opened
- synchronize
- reopened
paths:
- "apps/vite-app/**"
- "packages/**"
- "package.json"
- "yarn.lock"
- ".yarnrc.yml"
- "*.base.json"
- "*.base.js"
- ".prettier*.*"
- ".github/workflows/**"
- 'apps/vite-app/**'
- 'packages/**'
- 'package.json'
- 'yarn.lock'
- '.yarnrc.yml'
- '*.base.json'
- '*.base.js'
- '.prettier*.*'
- '.github/workflows/**'

jobs:
test:
Expand Down Expand Up @@ -78,12 +78,9 @@ jobs:
- name: Unit tests
working-directory: apps/vite-app
run: |
yarn ci-test:unit
yarn test-unit --runInBand --color
- name: Build vite-app
working-directory: apps/vite-app
run: |
yarn build
9 changes: 7 additions & 2 deletions .github/workflows/ci-web-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Unit tests
working-directory: apps/web-app
run: |
yarn ci-test:unit
yarn test-unit --runInBand --color
- name: Build web-app
working-directory: apps/web-app
Expand All @@ -120,4 +120,9 @@ jobs:
- name: Check bundle size
working-directory: apps/web-app
run: |
yarn bundle:check-size
yarn check-build-size
- name: Check ecmascript checks for build files
working-directory: apps/web-app
run: |
yarn check-dist
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn g:fix-staged-files --debug
yarn g:lint-staged-files --debug
Loading

3 comments on commit b565d35

@vercel
Copy link

@vercel vercel bot commented on b565d35 Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on b565d35 Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on b565d35 Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.