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

Add turborepo #588

Merged
merged 18 commits into from
Feb 3, 2025
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pnpm-lock.yaml
!.stylelintrc.js
!/.storybook
!/**/.storybook
.turbo
1 change: 0 additions & 1 deletion .github/composite-actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ runs:
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 10
run_install: false

- name: Install Node.js
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,26 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-turborepo-${{ github.sha }}-chromatic
restore-keys: |
${{ runner.os }}-turborepo-
path: .turbo

- name: Build Packages
run: pnpm build:pkg

- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo

- name: Publish to Chromatic
uses: chromaui/action@v1
id: chromatic
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci-react19.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,25 @@ jobs:
- name: Install dependencies
run: pnpm i

- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-turborepo-${{ github.sha }}-ci-react19
restore-keys: |
${{ runner.os }}-turborepo-
path: .turbo

- name: Build packages
run: pnpm build:pkg

- name: Test packages
run: pnpm test

- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo
25 changes: 21 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,34 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Build packages
run: pnpm build:pkg
- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-turborepo-${{ github.sha }}-ci
restore-keys: |
${{ runner.os }}-turborepo-
path: .turbo

- name: Generate documentation
run: pnpm doc:generate

- name: Build packages
run: pnpm build:pkg

- name: Build sample apps
run: pnpm build:apps

- name: Lint packages
- name: Lint
run: pnpm lint

- name: Test packages
- name: Test
run: pnpm test

- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ chromatic.config.json

# generated component data documentation
/apps/docs/datas

.turbo
1 change: 1 addition & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const config = {
"stylelint-config-clean-order" // This is a plugin that enforces a consistent order of CSS properties
],
rules: {
"prettier/prettier": null,
// We want to enforce the use of logical properties
"csstools/use-logical": true,
"selector-class-pattern": [
Expand Down
4 changes: 4 additions & 0 deletions apps/docs/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.turbo/*
.next/*
node_modules/*
datas/*
2 changes: 1 addition & 1 deletion apps/docs/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const Components = defineDocumentType(() => ({
section: {
type: "string"
},
warning: {
alpha: {
type: "string"
},
status: {
Expand Down
3 changes: 1 addition & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"start": "next start",
"dev": "next dev",
"build": "next build",
"lint": "next lint",
"lint:types": "tsc --noEmit",
"eslint": "next lint",
"storybook": "storybook dev -p 6010",
"build:storybook": "storybook build",
"generate": "pnpm run \"/^generate:.*/\"",
Expand Down
1 change: 1 addition & 0 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "@workleap/typescript-configs/web-application.json",
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"jsx": "preserve",
"module": "preserve",
"moduleResolution": "Bundler",
Expand Down
4 changes: 3 additions & 1 deletion apps/samples/basic/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
node_modules
*.md
*.yml
*.yaml
*.yaml
.turbo/*
.next/*
3 changes: 2 additions & 1 deletion apps/samples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"dev": "webpack serve --config webpack.dev.js",
"build": "webpack --config webpack.build.js",
"lint": "eslint ./src"
"eslint": "eslint ./src --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
"typecheck": "tsc"
},
"dependencies": {
"@hopper-ui/components": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions apps/samples/basic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"exclude": ["dist", "node_modules"],
"include": ["**/*", "../../../types"],
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"paths": {
"@hopper-ui/components": ["../../../packages/components/src/index.ts"],
}
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
command = "pnpm doc:generate && pnpm build:pkg && pnpm doc:build"
command = "pnpm doc:generate && pnpm build:pkg && pnpm build:doc"
publish = "apps/docs/.next"
environment = { NODE_OPTIONS = "--max-old-space-size=8192" }

Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,22 @@
"scripts": {
"doc:start": "pnpm --filter=docs dev",
"doc:storybook": "pnpm --filter=docs storybook",
"doc:build": "pnpm --filter=docs build",
"doc:generate": "pnpm --filter=docs generate",
"doc:lint": "pnpm --filter=docs lint",
"dev:basic": "pnpm -r --filter=basic dev",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm -r build",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules turbo run test --continue",
"test-storybook": "test-storybook",
"build:tokens": "pnpm --filter=\"@hopper-ui/tokens\" build",
"build:pkg": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm -r --filter \"{packages/**}\" build ",
"build:apps": "pnpm -r --filter \"{apps/**}\" build ",
"build:doc": "turbo run build --filter=./apps/docs",
"build:tokens": "turbo run build --filter=./packages/tokens",
"build:pkg": "turbo run build --filter=./packages/*",
"build:apps": "turbo run build --filter=./apps/*",
"changeset": "changeset",
"ci-release": "pnpm build:pkg && changeset publish",
"install-react19": "pnpm -r --filter \"{packages/**}\" add -D react@19 react-dom@19 @types/react@19 @types/react-dom@19 && pnpm add -D -w react@19 react-dom@19 @types/react@19 @types/react-dom@19",
"generate-icons": "pnpm --filter=\"svg-icons\" generate-icons && pnpm --filter=\"@hopper-ui/icons*\" generate-icons",
"lint": "pnpm run \"/^lint:.*/\"",
"lint:eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
"lint:style": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-location node_modules/.cache/stylelint --max-warnings=0",
"lint:types": "pnpm run typecheck",
"typecheck": "pnpm -r --parallel --include-workspace-root exec tsc --noEmit",
"lint": "turbo run lint --continue",
"eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint --ignore-pattern packages --ignore-pattern apps",
"typecheck": "tsc",
"clean": "pnpm -r --parallel --include-workspace-root exec pnpm dlx rimraf dist node_modules/.cache",
"reset": "pnpm clean && pnpm reset:modules",
"reset:modules": "pnpm -r --parallel --include-workspace-root exec pnpm dlx rimraf node_modules pnpm-lock.yaml",
Expand Down Expand Up @@ -92,13 +89,15 @@
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"tsconfig-paths-webpack-plugin": "4.2.0",
"tsx": "4.19.2"
"tsx": "4.19.2",
"turbo": "2.3.4"
},
"resolutions": {
"eslint-plugin-react-hooks": "4.6.2"
},
"bugs": {
"url": "https://github.com/gsoft-inc/wl-hopper/issues"
},
"homepage": "https://github.com/gsoft-inc/wl-hopper#readme"
"homepage": "https://github.com/gsoft-inc/wl-hopper#readme",
"packageManager": "[email protected]"
}
3 changes: 3 additions & 0 deletions packages/components/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turbo/*
dist/*
node_modules/*
2 changes: 2 additions & 0 deletions packages/components/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
**/dist/*
1 change: 1 addition & 0 deletions packages/components/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const config: Config = {
prefix: "<rootDir>"
})
},
cacheDirectory: "./node_modules/.cache/jest",
resolver: "<rootDir>/../../tooling/intl-jest-resolver/jestResolver.cjs",
setupFilesAfterEnv: ["<rootDir>/setupTests.ts"]
};
Expand Down
5 changes: 4 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
],
"scripts": {
"dev": "tsup --config ./tsup.dev.ts",
"build": "tsup --config ./tsup.build.ts",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsup --config ./tsup.build.ts",
"eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
"stylelint": "stylelint \"**/*.css\" --config ../../.stylelintrc.js --allow-empty-input --cache --cache-location node_modules/.cache/stylelint --max-warnings=0",
"typecheck": "tsc",
"test": "jest",
"find-types": "tsx scripts/findImportedTypes.ts"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"exclude": ["dist", "node_modules"],
"include": ["**/*", "../../types/*"],
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"paths": {
"@hopper-ui/styled-system": ["../styled-system/src/index.ts"],
"@hopper-ui/components": ["../components/src/index.ts"],
Expand Down
3 changes: 3 additions & 0 deletions packages/icons/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turbo/*
dist/*
node_modules/*
2 changes: 2 additions & 0 deletions packages/icons/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
**/dist/*
1 change: 1 addition & 0 deletions packages/icons/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { compilerOptions } from "./tsconfig.json";

const config: Config = {
testEnvironment: "jsdom",
cacheDirectory: "./node_modules/.cache/jest",
transform: {
"^.+\\.(js|ts|tsx)$": ["@swc/jest", swcConfig as Record<string, unknown>]
},
Expand Down
6 changes: 5 additions & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
},
"scripts": {
"build": "tsup --config ./tsup.build.ts",
"generate-icons": "tsx scripts/build.ts"
"generate-icons": "tsx scripts/build.ts",
"eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
"stylelint": "stylelint \"**/*.css\" --config ../../.stylelintrc.js --allow-empty-input --cache --cache-location node_modules/.cache/stylelint --max-warnings=0",
"typecheck": "tsc",
"test": "jest"
},
"peerDependencies": {
"@hopper-ui/styled-system": "^2.4",
Expand Down
2 changes: 2 additions & 0 deletions packages/icons/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"exclude": ["dist", "node_modules"],
"include": ["**/*", "../../types/*"],
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"paths": {
"@hopper-ui/styled-system": ["../styled-system/src/index.ts"],
"@hopper-ui/icons": ["../icons/src/index.ts"],
Expand Down
3 changes: 3 additions & 0 deletions packages/styled-system/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turbo/*
dist/*
node_modules/*
2 changes: 2 additions & 0 deletions packages/styled-system/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
**/dist/*
1 change: 1 addition & 0 deletions packages/styled-system/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const config: Config = {
prefix: "<rootDir>"
})
},
cacheDirectory: "./node_modules/.cache/jest",
setupFilesAfterEnv: ["<rootDir>/setupTests.ts"]
};

Expand Down
3 changes: 3 additions & 0 deletions packages/styled-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"scripts": {
"dev": "tsup --config ./tsup.dev.ts",
"build": "tsup --config ./tsup.build.ts",
"eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
"stylelint": "stylelint \"**/*.css\" --allow-empty-input --config ../../.stylelintrc.js --cache --cache-location node_modules/.cache/stylelint --max-warnings=0",
"typecheck": "tsc",
"test": "jest"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const DarkSemanticTokens = {
"--hop-upsell-border-disabled": "var(--hop-sunken-treasure-700)",
"--hop-upsell-border-press": "var(--hop-sunken-treasure-400)",
"--hop-upsell-icon": "var(--hop-sunken-treasure-700)",
"--hop-upsell-icon-selected": "var(--hop-sunken-treasure-300)",
"--hop-upsell-icon-selected": "var(--hop-sunken-treasure-100)",
"--hop-upsell-icon-hover": "var(--hop-sunken-treasure-800)",
"--hop-upsell-icon-press": "var(--hop-sunken-treasure-900)",
"--hop-upsell-icon-weakest": "var(--hop-sunken-treasure-100)",
Expand All @@ -156,7 +156,7 @@ export const DarkSemanticTokens = {
"--hop-upsell-surface-selected": "var(--hop-sunken-treasure-800)",
"--hop-upsell-surface-disabled": "var(--hop-sunken-treasure-700)",
"--hop-upsell-surface-hover": "var(--hop-sunken-treasure-100)",
"--hop-upsell-surface-press": "var(--hop-sunken-treasure-300)",
"--hop-upsell-surface-press": "var(--hop-sunken-treasure-200)",
"--hop-upsell-surface-weak": "var(--hop-sunken-treasure-800)",
"--hop-upsell-surface-weak-hover": "var(--hop-sunken-treasure-700)",
"--hop-upsell-surface-weak-press": "var(--hop-sunken-treasure-600)",
Expand Down
2 changes: 2 additions & 0 deletions packages/styled-system/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"exclude": ["dist", "node_modules"],
"include": ["**/*", "../../types/*"],
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"paths": {
"@hopper-ui/icons": ["../icons/src/index.ts"],
"@hopper-ui/components": ["../components/src/index.ts"],
Expand Down
3 changes: 3 additions & 0 deletions packages/svg-icons/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turbo/*
dist/*
node_modules/*
1 change: 1 addition & 0 deletions packages/svg-icons/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config: Config = {
transform: {
"^.+\\.(js|ts|tsx)$": ["@swc/jest", swcConfig as Record<string, unknown>]
},
cacheDirectory: "./node_modules/.cache/jest",
extensionsToTreatAsEsm: [".ts"]
};

Expand Down
5 changes: 4 additions & 1 deletion packages/svg-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"build": "pnpm run \"/^build:.*/\"",
"build:icons": "copyfiles --flat src/optimized-icons/* dist/icons",
"build:rich-icons": "copyfiles --flat src/optimized-rich-icons/* dist/rich-icons",
"generate-icons": "tsx scripts/build.ts"
"generate-icons": "tsx scripts/build.ts",
"eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
"typecheck": "tsc",
"test": "jest"
},
"devDependencies": {
"@swc/core": "1.10.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/svg-icons/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"extends": "@workleap/typescript-configs/library.json",
"exclude": ["dist", "node_modules"],
"include": ["**/*", "../../types/*"]
"include": ["**/*", "../../types/*"],
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
}
}
Loading
Loading