Skip to content

Commit

Permalink
Move root PNPM workspace to js directory
Browse files Browse the repository at this point in the history
Closes keycloak#35455

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Nov 29, 2024
1 parent dd5c652 commit caaf6b3
Show file tree
Hide file tree
Showing 21 changed files with 145 additions and 134 deletions.
6 changes: 0 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
# UI (@keycloak/ui-maintainers)
###################################################################################################

/eslint.config.js @keycloak/ui-maintainers
/package.json @keycloak/ui-maintainers
/pnpm-lock.yaml @keycloak/ui-maintainers
/pnpm-workspace.yaml @keycloak/ui-maintainers
/tsconfig.eslint.json @keycloak/ui-maintainers
/tsconfig.json @keycloak/ui-maintainers
/themes/ @keycloak/ui-maintainers @keycloak/maintainers
/js/ @keycloak/ui-maintainers
/js/**/maven-resources-community/**/messages_*.properties @keycloak/ui-maintainers @keycloak/maintainers
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/conditional/conditions
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ operator/ operator
docs/guides/ guides
docs/documentation/ documentation

eslint.config.js js
package.json js
pnpm-lock.yaml js
pnpm-workspace.yaml js
tsconfig.eslint.json js
tsconfig.json js
js/ js
rest/admin-ui-ext/ js
services/ js
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/node-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ runs:
id: tooling-versions
shell: bash
run: |
echo "node=$(cat pom.xml | grep '<node.version>' | cut -d '>' -f 2 | cut -d '<' -f 1 | cut -c 2-)" >> $GITHUB_OUTPUT
echo "pnpm=$(cat pom.xml | grep '<pnpm.version>' | cut -d '>' -f 2 | cut -d '<' -f 1 | cut -c 1-)" >> $GITHUB_OUTPUT
echo "node=$(cat js/pom.xml | grep '<node.version>' | cut -d '>' -f 2 | cut -d '<' -f 1 | cut -c 2-)" >> $GITHUB_OUTPUT
echo "pnpm=$(cat js/pom.xml | grep '<pnpm.version>' | cut -d '>' -f 2 | cut -d '<' -f 1 | cut -c 1-)" >> $GITHUB_OUTPUT
# Downloading Node.js often fails due to network issues, therefore we cache the artifacts downloaded by the frontend plugin.
- uses: actions/cache@v4
Expand Down
1 change: 1 addition & 0 deletions .github/actions/pnpm-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ runs:
- name: Install dependencies
shell: bash
run: pnpm install --prefer-offline --frozen-lockfile
working-directory: js

# This step is only needed to ensure that the Cypress binary is installed.
# If the binary was retrieved from the cache, this step is a no-op.
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/js-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ jobs:
- uses: ./.github/actions/pnpm-setup

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
working-directory: js

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
working-directory: js

ui-shared:
name: UI Shared
Expand All @@ -85,8 +87,10 @@ jobs:
- uses: ./.github/actions/pnpm-setup

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
working-directory: js

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
working-directory: js

account-ui:
name: Account UI
Expand All @@ -101,8 +105,10 @@ jobs:
- uses: ./.github/actions/pnpm-setup

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
working-directory: js

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
working-directory: js

admin-ui:
name: Admin UI
Expand All @@ -117,12 +123,16 @@ jobs:
- uses: ./.github/actions/pnpm-setup

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} lint
working-directory: js

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test
working-directory: js

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build
working-directory: js

- run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:check-types
working-directory: js

account-ui-e2e:
name: Account UI E2E
Expand Down Expand Up @@ -156,9 +166,11 @@ jobs:

- name: Install Playwright browsers
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} exec playwright install --with-deps
working-directory: js

- name: Run Playwright tests
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test
working-directory: js

- name: Upload Playwright report
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -228,6 +240,7 @@ jobs:

- name: Compile Admin Client
run: pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-client build
working-directory: js

- name: Download Keycloak server
uses: actions/download-artifact@v4
Expand All @@ -249,6 +262,7 @@ jobs:

- name: Start LDAP server
run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:ldap-server &
working-directory: js

- name: Run Cypress
uses: cypress-io/github-action@v6
Expand Down
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,9 @@ quarkus/data/*.db
# Git ephemeral files
*.versionsBackup

# frontend-maven-plugin
node

# Wireit
.wireit

# Vite
dist

!/quarkus/dist
!/quarkus/**/src/**/dist

# ESLint
.eslintcache

# NPM
node_modules

# SDKMAM environment file
.sdkmanrc

Expand Down
14 changes: 14 additions & 0 deletions js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frontend-maven-plugin
node

# Wireit
.wireit

# Vite
dist

# ESLint
.eslintcache

# NPM
node_modules
3 changes: 3 additions & 0 deletions js/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ if [ ! -f "$FILE" ]; then
exit 0;
fi

# Change to the js directory.
cd js

# Exit if dependencies are not installed.
if [ ! -d "node_modules" ]; then
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion js/apps/account-ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../tsconfig.json",
"include": ["src"],
"exclude": ["**/*.test.ts", "**/*.test.tsx"]
}
2 changes: 1 addition & 1 deletion js/apps/admin-ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../tsconfig.json",
"include": ["src"],
"exclude": ["**/*.test.ts", "**/*.test.tsx"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion js/libs/keycloak-admin-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"module": "Node16",
Expand Down
2 changes: 1 addition & 1 deletion js/libs/ui-shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../tsconfig.json",
"include": ["src"],
"exclude": ["**/*.test.ts", "**/*.test.tsx"]
}
2 changes: 1 addition & 1 deletion package.json → js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"packageManager": "[email protected]+sha512.c8180b3fbe4e4bca02c94234717896b5529740a6cbadf19fa78254270403ea2f27d4e1d46a08a0f56c89b63dc8ebfd3ee53326da720273794e6200fcf0d184ab",
"scripts": {
"prepare": "husky js/.husky"
"prepare": "cd .. && husky js/.husky"
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
Expand Down
30 changes: 15 additions & 15 deletions pnpm-lock.yaml → js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions js/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
- apps/*
- libs/*
- themes-vendor
Loading

0 comments on commit caaf6b3

Please sign in to comment.