mirror of https://github.com/coder/coder.git
chore: switch from `yarn` to `pnpm` (#8822)
This commit is contained in:
parent
cf35c0dfc5
commit
4b81cfaa0d
|
@ -10,14 +10,22 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: buildjet/setup-node@v3
|
uses: buildjet/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18.17.0
|
node-version: 18.17.0
|
||||||
# See https://github.com/actions/setup-node#caching-global-packages-data
|
# See https://github.com/actions/setup-node#caching-global-packages-data
|
||||||
cache: "yarn"
|
cache: "pnpm"
|
||||||
cache-dependency-path: ${{ inputs.directory }}/yarn.lock
|
cache-dependency-path: ${{ inputs.directory }}/pnpm-lock.yaml
|
||||||
|
- name: Install root node_modules
|
||||||
|
shell: bash
|
||||||
|
run: ./scripts/pnpm_install.sh
|
||||||
|
|
||||||
- name: Install node_modules
|
- name: Install node_modules
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ../scripts/yarn_install.sh
|
run: ../scripts/pnpm_install.sh
|
||||||
working-directory: ${{ inputs.directory }}
|
working-directory: ${{ inputs.directory }}
|
||||||
|
|
|
@ -226,18 +226,6 @@ jobs:
|
||||||
cache: false
|
cache: false
|
||||||
go-version: 1.20.6
|
go-version: 1.20.6
|
||||||
|
|
||||||
- name: Install prettier
|
|
||||||
# We only need prettier for fmt, so do not install all dependencies.
|
|
||||||
# There is no way to install a single package with yarn, so we have to
|
|
||||||
# make a new package.json with only prettier listed as a dependency.
|
|
||||||
# Then running `yarn` will only install prettier.
|
|
||||||
run: |
|
|
||||||
cd site
|
|
||||||
mv package.json package.json.bak
|
|
||||||
jq '{dependencies: {prettier: .devDependencies.prettier}}' < package.json.bak > package.json
|
|
||||||
yarn --frozen-lockfile
|
|
||||||
mv package.json.bak package.json
|
|
||||||
|
|
||||||
- name: Install shfmt
|
- name: Install shfmt
|
||||||
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0
|
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0
|
||||||
|
|
||||||
|
@ -508,7 +496,7 @@ jobs:
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
|
|
||||||
- run: yarn test:ci --max-workers $(nproc)
|
- run: pnpm test:ci --max-workers $(nproc)
|
||||||
working-directory: site
|
working-directory: site
|
||||||
|
|
||||||
- name: Check code coverage
|
- name: Check code coverage
|
||||||
|
@ -546,13 +534,12 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
sudo npm install -g prettier
|
|
||||||
make -B site/out/index.html
|
make -B site/out/index.html
|
||||||
|
|
||||||
- run: yarn playwright:install
|
- run: pnpm playwright:install
|
||||||
working-directory: site
|
working-directory: site
|
||||||
|
|
||||||
- run: yarn playwright:test
|
- run: pnpm playwright:test
|
||||||
env:
|
env:
|
||||||
DEBUG: pw:api
|
DEBUG: pw:api
|
||||||
working-directory: site
|
working-directory: site
|
||||||
|
@ -657,28 +644,19 @@ jobs:
|
||||||
with:
|
with:
|
||||||
sqlc-version: "1.19.1"
|
sqlc-version: "1.19.1"
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
cd offlinedocs
|
|
||||||
yarn
|
|
||||||
# Install prettier globally
|
|
||||||
prettier_version=$(jq -r '.devDependencies.prettier' < package.json)
|
|
||||||
yarn global add "prettier@${prettier_version}"
|
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
run: |
|
run: |
|
||||||
cd offlinedocs
|
cd offlinedocs
|
||||||
yarn format:check
|
pnpm format:check
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
cd offlinedocs
|
cd offlinedocs
|
||||||
yarn lint
|
pnpm lint
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
version="$(./scripts/version.sh)"
|
make -j build/coder_docs_"$(./scripts/version.sh)".tgz
|
||||||
make -j build/coder_docs_"$version".tgz
|
|
||||||
|
|
||||||
required:
|
required:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -17,15 +17,16 @@ encrypter = "encrypter"
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
extend-exclude = [
|
extend-exclude = [
|
||||||
"**.svg",
|
"**.svg",
|
||||||
"**.png",
|
"**.png",
|
||||||
"**.lock",
|
"**.lock",
|
||||||
"go.sum",
|
"go.sum",
|
||||||
"go.mod",
|
"go.mod",
|
||||||
# These files contain base64 strings that confuse the detector
|
# These files contain base64 strings that confuse the detector
|
||||||
"**XService**.ts",
|
"**XService**.ts",
|
||||||
"**identity.go",
|
"**identity.go",
|
||||||
"scripts/ci-report/testdata/**",
|
"scripts/ci-report/testdata/**",
|
||||||
"**/*_test.go",
|
"**/*_test.go",
|
||||||
"**/*.test.tsx"
|
"**/*.test.tsx",
|
||||||
|
"**/pnpm-lock.yaml",
|
||||||
]
|
]
|
||||||
|
|
|
@ -78,3 +78,5 @@ scripts/apitypings/testdata/**/*.ts
|
||||||
|
|
||||||
# Generated files shouldn't be formatted.
|
# Generated files shouldn't be formatted.
|
||||||
site/e2e/provisionerGenerated.ts
|
site/e2e/provisionerGenerated.ts
|
||||||
|
|
||||||
|
**/pnpm-lock.yaml
|
||||||
|
|
|
@ -11,3 +11,5 @@ scripts/apitypings/testdata/**/*.ts
|
||||||
|
|
||||||
# Generated files shouldn't be formatted.
|
# Generated files shouldn't be formatted.
|
||||||
site/e2e/provisionerGenerated.ts
|
site/e2e/provisionerGenerated.ts
|
||||||
|
|
||||||
|
**/pnpm-lock.yaml
|
||||||
|
|
29
Makefile
29
Makefile
|
@ -50,7 +50,7 @@ endif
|
||||||
# Note, all find statements should be written with `.` or `./path` as
|
# Note, all find statements should be written with `.` or `./path` as
|
||||||
# the search path so that these exclusions match.
|
# the search path so that these exclusions match.
|
||||||
FIND_EXCLUSIONS= \
|
FIND_EXCLUSIONS= \
|
||||||
-not \( \( -path '*/.git/*' -o -path './build/*' -o -path './vendor/*' -o -path './.coderv2/*' -o -path '*/node_modules/*' -o -path './site/out/*' -o -path './coderd/apidoc/*' \) -prune \)
|
-not \( \( -path '*/.git/*' -o -path './build/*' -o -path './vendor/*' -o -path './.coderv2/*' -o -path '*/node_modules/*' -o -path '*/out/*' -o -path './coderd/apidoc/*' -o -path '*/.next/*' \) -prune \)
|
||||||
# Source files used for make targets, evaluated on use.
|
# Source files used for make targets, evaluated on use.
|
||||||
GO_SRC_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.go' -not -name '*_test.go')
|
GO_SRC_FILES := $(shell find . $(FIND_EXCLUSIONS) -type f -name '*.go' -not -name '*_test.go')
|
||||||
# All the shell files in the repo, excluding ignored files.
|
# All the shell files in the repo, excluding ignored files.
|
||||||
|
@ -357,13 +357,13 @@ build/coder_helm_$(VERSION).tgz:
|
||||||
|
|
||||||
site/out/index.html: site/package.json $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \))
|
site/out/index.html: site/package.json $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \))
|
||||||
cd site
|
cd site
|
||||||
../scripts/yarn_install.sh
|
../scripts/pnpm_install.sh
|
||||||
yarn build
|
pnpm build
|
||||||
|
|
||||||
offlinedocs/out/index.html: $(shell find ./offlinedocs $(FIND_EXCLUSIONS) -type f) $(shell find ./docs $(FIND_EXCLUSIONS) -type f | sed 's: :\\ :g')
|
offlinedocs/out/index.html: $(shell find ./offlinedocs $(FIND_EXCLUSIONS) -type f) $(shell find ./docs $(FIND_EXCLUSIONS) -type f | sed 's: :\\ :g')
|
||||||
cd offlinedocs
|
cd offlinedocs
|
||||||
../scripts/yarn_install.sh
|
../scripts/pnpm_install.sh
|
||||||
yarn export
|
pnpm export
|
||||||
|
|
||||||
build/coder_docs_$(VERSION).tgz: offlinedocs/out/index.html
|
build/coder_docs_$(VERSION).tgz: offlinedocs/out/index.html
|
||||||
tar -czf "$@" -C offlinedocs/out .
|
tar -czf "$@" -C offlinedocs/out .
|
||||||
|
@ -390,9 +390,9 @@ fmt/prettier:
|
||||||
cd site
|
cd site
|
||||||
# Avoid writing files in CI to reduce file write activity
|
# Avoid writing files in CI to reduce file write activity
|
||||||
ifdef CI
|
ifdef CI
|
||||||
yarn run format:check
|
pnpm run format:check
|
||||||
else
|
else
|
||||||
yarn run format:write
|
pnpm run format:write
|
||||||
endif
|
endif
|
||||||
.PHONY: fmt/prettier
|
.PHONY: fmt/prettier
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ lint/site-icons:
|
||||||
|
|
||||||
lint/ts:
|
lint/ts:
|
||||||
cd site
|
cd site
|
||||||
yarn && yarn lint
|
pnpm i && pnpm lint
|
||||||
.PHONY: lint/ts
|
.PHONY: lint/ts
|
||||||
|
|
||||||
lint/go:
|
lint/go:
|
||||||
|
@ -532,29 +532,26 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
|
||||||
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
|
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
|
||||||
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
|
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
|
||||||
cd site
|
cd site
|
||||||
yarn run format:types
|
pnpm run format:types
|
||||||
|
|
||||||
coderd/rbac/object_gen.go: scripts/rbacgen/main.go coderd/rbac/object.go
|
coderd/rbac/object_gen.go: scripts/rbacgen/main.go coderd/rbac/object.go
|
||||||
go run scripts/rbacgen/main.go ./coderd/rbac > coderd/rbac/object_gen.go
|
go run scripts/rbacgen/main.go ./coderd/rbac > coderd/rbac/object_gen.go
|
||||||
|
|
||||||
docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
|
docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
|
||||||
go run scripts/metricsdocgen/main.go
|
go run scripts/metricsdocgen/main.go
|
||||||
cd site
|
pnpm run format:write:only ./docs/admin/prometheus.md
|
||||||
yarn run format:write:only ../docs/admin/prometheus.md
|
|
||||||
|
|
||||||
docs/cli.md: scripts/clidocgen/main.go $(GO_SRC_FILES)
|
docs/cli.md: scripts/clidocgen/main.go $(GO_SRC_FILES)
|
||||||
BASE_PATH="." go run ./scripts/clidocgen
|
BASE_PATH="." go run ./scripts/clidocgen
|
||||||
cd site
|
pnpm run format:write:only ./docs/cli.md ./docs/cli/*.md ./docs/manifest.json
|
||||||
yarn run format:write:only ../docs/cli.md ../docs/cli/*.md ../docs/manifest.json
|
|
||||||
|
|
||||||
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
|
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
|
||||||
go run scripts/auditdocgen/main.go
|
go run scripts/auditdocgen/main.go
|
||||||
cd site
|
pnpm run format:write:only ./docs/admin/audit-logs.md
|
||||||
yarn run format:write:only ../docs/admin/audit-logs.md
|
|
||||||
|
|
||||||
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go
|
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go
|
||||||
./scripts/apidocgen/generate.sh
|
./scripts/apidocgen/generate.sh
|
||||||
yarn run --cwd=site format:write:only ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json
|
pnpm run format:write:only ./docs/api ./docs/manifest.json ./coderd/apidoc/swagger.json
|
||||||
|
|
||||||
update-golden-files: cli/testdata/.gen-golden helm/tests/testdata/.gen-golden scripts/ci-report/testdata/.gen-golden enterprise/cli/testdata/.gen-golden
|
update-golden-files: cli/testdata/.gen-golden helm/tests/testdata/.gen-golden scripts/ci-report/testdata/.gen-golden enterprise/cli/testdata/.gen-golden
|
||||||
.PHONY: update-golden-files
|
.PHONY: update-golden-files
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
kubernetes-helm
|
kubernetes-helm
|
||||||
mockgen
|
mockgen
|
||||||
nfpm
|
nfpm
|
||||||
|
nodePackages.pnpm
|
||||||
nodePackages.typescript
|
nodePackages.typescript
|
||||||
nodePackages.typescript-language-server
|
nodePackages.typescript-language-server
|
||||||
nodejs
|
nodejs
|
||||||
|
@ -39,8 +40,8 @@
|
||||||
openssl
|
openssl
|
||||||
pango
|
pango
|
||||||
pixman
|
pixman
|
||||||
postgresql
|
|
||||||
pkg-config
|
pkg-config
|
||||||
|
postgresql
|
||||||
protoc-gen-go
|
protoc-gen-go
|
||||||
ripgrep
|
ripgrep
|
||||||
shellcheck
|
shellcheck
|
||||||
|
@ -48,7 +49,6 @@
|
||||||
sqlc
|
sqlc
|
||||||
terraform
|
terraform
|
||||||
typos
|
typos
|
||||||
yarn
|
|
||||||
yq
|
yq
|
||||||
zip
|
zip
|
||||||
zstd
|
zstd
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
pnpm-debug.log*
|
||||||
yarn-error.log*
|
|
||||||
.pnpm-debug.log*
|
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env*.local
|
.env*.local
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
**/pnpm-lock.yaml
|
|
@ -3,21 +3,22 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "yarn copy-images && next dev",
|
"dev": "pnpm copy-images && next dev",
|
||||||
"build": "next build",
|
"build": "pnpm exec next build",
|
||||||
"start": "next start",
|
"start": "pnpm exec next start",
|
||||||
"export": "yarn copy-images && next build && next export",
|
"export": "pnpm copy-images && next build && next export",
|
||||||
"copy-images": "sh ./scripts/copyImages.sh",
|
"copy-images": "sh ./scripts/copyImages.sh",
|
||||||
"lint": "yarn run lint:types",
|
"lint": "pnpm run lint:types",
|
||||||
"lint:fix": "FIX=true yarn lint",
|
"lint:fix": "FIX=true pnpm lint",
|
||||||
"lint:types": "tsc --noEmit",
|
"lint:types": "pnpm exec tsc --noEmit",
|
||||||
"format:check": "prettier --cache --check './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
"format:check": "pnpm exec prettier --cache --check './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||||
"format:write": "prettier --cache --write './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'"
|
"format:write": "pnpm exec prettier --cache --write './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/react": "2.8.0",
|
"@chakra-ui/react": "2.8.0",
|
||||||
"@emotion/react": "11",
|
"@emotion/react": "11",
|
||||||
"@emotion/styled": "11",
|
"@emotion/styled": "11",
|
||||||
|
"@types/lodash": "4.14.196",
|
||||||
"archiver": "5.3.1",
|
"archiver": "5.3.1",
|
||||||
"framer-motion": "10",
|
"framer-motion": "10",
|
||||||
"front-matter": "4.0.2",
|
"front-matter": "4.0.2",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"format:write:only": "pnpm exec prettier --write"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "3.0.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
devDependencies:
|
||||||
|
prettier:
|
||||||
|
specifier: 3.0.0
|
||||||
|
version: 3.0.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/prettier@3.0.0:
|
||||||
|
resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==}
|
||||||
|
engines: {node: '>=14'}
|
||||||
|
hasBin: true
|
||||||
|
dev: true
|
|
@ -0,0 +1 @@
|
||||||
|
**/pnpm-lock.yaml
|
|
@ -27,12 +27,12 @@ go run github.com/swaggo/swag/cmd/swag@v1.8.9 init \
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd "${APIDOCGEN_DIR}"
|
pushd "${APIDOCGEN_DIR}"
|
||||||
yarn
|
pnpm i
|
||||||
|
|
||||||
# Make sure that widdershins is installed correctly.
|
# Make sure that widdershins is installed correctly.
|
||||||
yarn exec -- widdershins --version
|
pnpm exec -- widdershins --version
|
||||||
# Render the Markdown file.
|
# Render the Markdown file.
|
||||||
yarn exec -- widdershins \
|
pnpm exec -- widdershins \
|
||||||
--user_templates "./markdown-template" \
|
--user_templates "./markdown-template" \
|
||||||
--search false \
|
--search false \
|
||||||
--omitHeader true \
|
--omitHeader true \
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -48,7 +48,7 @@ if [ "${CODER_BUILD_AGPL:-0}" -gt "0" ] && [ "${use_proxy}" -gt "0" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Preflight checks: ensure we have our required dependencies, and make sure nothing is listening on port 3000 or 8080
|
# Preflight checks: ensure we have our required dependencies, and make sure nothing is listening on port 3000 or 8080
|
||||||
dependencies curl git go make yarn
|
dependencies curl git go make pnpm
|
||||||
curl --fail http://127.0.0.1:3000 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1
|
curl --fail http://127.0.0.1:3000 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 3000. Kill it and re-run this script.' && exit 1
|
||||||
curl --fail http://127.0.0.1:8080 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 8080. Kill it and re-run this script.' && exit 1
|
curl --fail http://127.0.0.1:8080 >/dev/null 2>&1 && echo '== ERROR: something is listening on port 8080. Kill it and re-run this script.' && exit 1
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ fatal() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start the frontend once we have a template up and running
|
# Start the frontend once we have a template up and running
|
||||||
CODER_HOST=http://127.0.0.1:3000 start_cmd SITE date yarn --cwd=./site dev --host
|
CODER_HOST=http://127.0.0.1:3000 start_cmd SITE date pnpm --cwd=./site dev --host
|
||||||
|
|
||||||
interfaces=(localhost)
|
interfaces=(localhost)
|
||||||
if command -v ip >/dev/null; then
|
if command -v ip >/dev/null; then
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Run "yarn install" with flags appropriate to the environment (local
|
# Run "pnpm install" with flags appropriate to the environment (local
|
||||||
# development vs build system). The install is always run within the current
|
# development vs build system). The install is always run within the current
|
||||||
# directory.
|
# directory.
|
||||||
#
|
#
|
||||||
# Usage: yarn_install.sh [optional extra flags]
|
# Usage: pnpm_install.sh [optional extra flags]
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
yarn_flags=(
|
pnpm_flags=(
|
||||||
# Do not execute install scripts
|
# Do not execute install scripts
|
||||||
# TODO: check if build works properly with this enabled
|
# TODO: check if build works properly with this enabled
|
||||||
# --ignore-scripts
|
# --ignore-scripts
|
||||||
|
@ -19,19 +19,17 @@ yarn_flags=(
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ -n ${CI:-} ]]; then
|
if [[ -n ${CI:-} ]]; then
|
||||||
yarn_flags+=(
|
pnpm_flags+=(
|
||||||
# Install dependencies from lockfile, ensuring builds are fully
|
# Install dependencies from lockfile, ensuring builds are fully
|
||||||
# reproducible
|
# reproducible
|
||||||
--frozen-lockfile
|
--frozen-lockfile
|
||||||
# Suppress progress information
|
# Disable interactive prompts.
|
||||||
--silent
|
--reporter append-only
|
||||||
# Disable interactive prompts for build
|
|
||||||
--non-interactive
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append whatever is specified on the command line
|
# Append whatever is specified on the command line
|
||||||
yarn_flags+=("$@")
|
pnpm_flags+=("$@")
|
||||||
|
|
||||||
echo "+ yarn install ${yarn_flags[*]}"
|
echo "+ pnpm install ${pnpm_flags[*]}"
|
||||||
yarn install "${yarn_flags[@]}"
|
pnpm install "${pnpm_flags[@]}"
|
|
@ -78,3 +78,5 @@ stats/
|
||||||
|
|
||||||
# Generated files shouldn't be formatted.
|
# Generated files shouldn't be formatted.
|
||||||
e2e/provisionerGenerated.ts
|
e2e/provisionerGenerated.ts
|
||||||
|
|
||||||
|
**/pnpm-lock.yaml
|
||||||
|
|
|
@ -78,3 +78,5 @@ stats/
|
||||||
|
|
||||||
# Generated files shouldn't be formatted.
|
# Generated files shouldn't be formatted.
|
||||||
e2e/provisionerGenerated.ts
|
e2e/provisionerGenerated.ts
|
||||||
|
|
||||||
|
**/pnpm-lock.yaml
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
network-timeout 300000
|
|
|
@ -5,17 +5,17 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "yarn typegen",
|
"postinstall": "pnpm typegen",
|
||||||
"build": "NODE_ENV=production yarn vite build",
|
"build": "NODE_ENV=production pnpm vite build",
|
||||||
"check:all": "yarn format:check && yarn lint && yarn test",
|
"check:all": "pnpm format:check && pnpm lint && pnpm test",
|
||||||
"chromatic": "chromatic",
|
"chromatic": "chromatic",
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"format:check": "prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
"format:check": "pnpm exec prettier --cache --check '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||||
"format:types": "prettier --cache --write 'src/api/typesGenerated.ts'",
|
"format:types": "pnpm exec prettier --cache --write './src/api/typesGenerated.ts'",
|
||||||
"format:write": "prettier --cache --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
"format:write": "pnpm exec prettier --cache --write '../**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
|
||||||
"format:write:only": "prettier --write",
|
"format:write:only": "pnpm exec prettier --write",
|
||||||
"lint": "yarn typegen && yarn run lint:types && jest --selectProjects lint",
|
"lint": "pnpm typegen && pnpm run lint:types && pnpm exec jest --selectProjects lint",
|
||||||
"lint:fix": "FIX=true yarn lint",
|
"lint:fix": "FIX=true pnpm lint",
|
||||||
"lint:types": "tsc --noEmit",
|
"lint:types": "tsc --noEmit",
|
||||||
"playwright:install": "playwright install --with-deps chromium",
|
"playwright:install": "playwright install --with-deps chromium",
|
||||||
"playwright:test": "playwright test --config=e2e/playwright.config.ts",
|
"playwright:test": "playwright test --config=e2e/playwright.config.ts",
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
"test:coverage": "jest --selectProjects test --collectCoverage",
|
"test:coverage": "jest --selectProjects test --collectCoverage",
|
||||||
"test:watch": "jest --selectProjects test --watch",
|
"test:watch": "jest --selectProjects test --watch",
|
||||||
"typegen": "xstate typegen 'src/**/*.ts'",
|
"typegen": "xstate typegen 'src/**/*.ts'",
|
||||||
"stats": "STATS=true yarn build && npx http-server ./stats -p 8081 -c-1",
|
"stats": "STATS=true pnpm build && npx http-server ./stats -p 8081 -c-1",
|
||||||
"deadcode": "ts-prune | grep -v \".stories\\|.typegen\\|.config\\|e2e\\|__mocks__\\|used in module\\|testHelpers\\|typesGenerated\" || echo \"No deadcode found.\""
|
"deadcode": "ts-prune | grep -v \".stories\\|.typegen\\|.config\\|e2e\\|__mocks__\\|used in module\\|testHelpers\\|typesGenerated\" || echo \"No deadcode found.\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -43,9 +43,10 @@
|
||||||
"@mui/lab": "5.0.0-alpha.129",
|
"@mui/lab": "5.0.0-alpha.129",
|
||||||
"@mui/material": "5.14.0",
|
"@mui/material": "5.14.0",
|
||||||
"@mui/styles": "5.14.0",
|
"@mui/styles": "5.14.0",
|
||||||
|
"@mui/system": "5.14.0",
|
||||||
"@tanstack/react-query": "4.32.0",
|
"@tanstack/react-query": "4.32.0",
|
||||||
"@testing-library/react-hooks": "8.0.1",
|
|
||||||
"@types/color-convert": "2.0.0",
|
"@types/color-convert": "2.0.0",
|
||||||
|
"@types/lodash": "4.14.196",
|
||||||
"@types/react-color": "3.0.6",
|
"@types/react-color": "3.0.6",
|
||||||
"@types/semver": "7.5.0",
|
"@types/semver": "7.5.0",
|
||||||
"@vitejs/plugin-react": "4.0.1",
|
"@vitejs/plugin-react": "4.0.1",
|
||||||
|
@ -69,8 +70,6 @@
|
||||||
"front-matter": "4.0.2",
|
"front-matter": "4.0.2",
|
||||||
"i18next": "22.5.0",
|
"i18next": "22.5.0",
|
||||||
"jest-environment-jsdom": "29.5.0",
|
"jest-environment-jsdom": "29.5.0",
|
||||||
"jest-location-mock": "1.0.9",
|
|
||||||
"just-debounce-it": "3.2.0",
|
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"monaco-editor": "0.40.0",
|
"monaco-editor": "0.40.0",
|
||||||
"pretty-bytes": "6.1.0",
|
"pretty-bytes": "6.1.0",
|
||||||
|
@ -112,13 +111,16 @@
|
||||||
"@storybook/addon-essentials": "7.2.0",
|
"@storybook/addon-essentials": "7.2.0",
|
||||||
"@storybook/addon-links": "7.2.0",
|
"@storybook/addon-links": "7.2.0",
|
||||||
"@storybook/addon-mdx-gfm": "7.2.0",
|
"@storybook/addon-mdx-gfm": "7.2.0",
|
||||||
|
"@storybook/react": "7.2.0",
|
||||||
"@storybook/react-vite": "7.2.0",
|
"@storybook/react-vite": "7.2.0",
|
||||||
"@swc/core": "1.3.38",
|
"@swc/core": "1.3.38",
|
||||||
"@swc/jest": "0.2.24",
|
"@swc/jest": "0.2.24",
|
||||||
"@testing-library/jest-dom": "5.17.0",
|
"@testing-library/jest-dom": "5.17.0",
|
||||||
"@testing-library/react": "14.0.0",
|
"@testing-library/react": "14.0.0",
|
||||||
|
"@testing-library/react-hooks": "8.0.1",
|
||||||
"@testing-library/user-event": "14.4.3",
|
"@testing-library/user-event": "14.4.3",
|
||||||
"@types/chroma-js": "2.4.0",
|
"@types/chroma-js": "2.4.0",
|
||||||
|
"@types/express": "4.17.17",
|
||||||
"@types/jest": "29.5.2",
|
"@types/jest": "29.5.2",
|
||||||
"@types/node": "18.17.0",
|
"@types/node": "18.17.0",
|
||||||
"@types/react": "18.2.6",
|
"@types/react": "18.2.6",
|
||||||
|
@ -128,6 +130,7 @@
|
||||||
"@types/react-virtualized-auto-sizer": "1.0.1",
|
"@types/react-virtualized-auto-sizer": "1.0.1",
|
||||||
"@types/react-window": "1.8.5",
|
"@types/react-window": "1.8.5",
|
||||||
"@types/ssh2": "1.11.13",
|
"@types/ssh2": "1.11.13",
|
||||||
|
"@types/testing-library__jest-dom": "5.14.9",
|
||||||
"@types/ua-parser-js": "0.7.36",
|
"@types/ua-parser-js": "0.7.36",
|
||||||
"@types/uuid": "9.0.2",
|
"@types/uuid": "9.0.2",
|
||||||
"@typescript-eslint/eslint-plugin": "6.2.1",
|
"@typescript-eslint/eslint-plugin": "6.2.1",
|
||||||
|
@ -146,19 +149,25 @@
|
||||||
"eslint-plugin-react-hooks": "4.6.0",
|
"eslint-plugin-react-hooks": "4.6.0",
|
||||||
"eslint-plugin-storybook": "0.6.12",
|
"eslint-plugin-storybook": "0.6.12",
|
||||||
"eslint-plugin-unicorn": "48.0.0",
|
"eslint-plugin-unicorn": "48.0.0",
|
||||||
"jest": "29.5.0",
|
"express": "4.18.2",
|
||||||
|
"jest": "29.6.2",
|
||||||
"jest-canvas-mock": "2.4.0",
|
"jest-canvas-mock": "2.4.0",
|
||||||
"jest-fetch-mock": "3.0.3",
|
"jest-fetch-mock": "3.0.3",
|
||||||
|
"jest-location-mock": "1.0.9",
|
||||||
"jest-runner-eslint": "2.1.0",
|
"jest-runner-eslint": "2.1.0",
|
||||||
"jest-websocket-mock": "2.4.0",
|
"jest-websocket-mock": "2.4.0",
|
||||||
"jest_workaround": "0.1.14",
|
"jest_workaround": "0.1.14",
|
||||||
|
"just-debounce-it": "3.2.0",
|
||||||
"msw": "1.2.2",
|
"msw": "1.2.2",
|
||||||
"prettier": "3.0.0",
|
"prettier": "3.0.0",
|
||||||
|
"protobufjs": "7.2.4",
|
||||||
"resize-observer": "1.0.4",
|
"resize-observer": "1.0.4",
|
||||||
|
"rxjs": "7.8.1",
|
||||||
"ssh2": "1.14.0",
|
"ssh2": "1.14.0",
|
||||||
"storybook": "7.2.0",
|
"storybook": "7.2.0",
|
||||||
"storybook-addon-react-router-v6": "1.0.2",
|
"storybook-addon-react-router-v6": "1.0.2",
|
||||||
"storybook-react-context": "0.6.0",
|
"storybook-react-context": "0.6.0",
|
||||||
|
"ts-node": "10.9.1",
|
||||||
"ts-proto": "1.156.0",
|
"ts-proto": "1.156.0",
|
||||||
"typescript": "5.1.6",
|
"typescript": "5.1.6",
|
||||||
"vite-plugin-checker": "0.6.0"
|
"vite-plugin-checker": "0.6.0"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,6 @@
|
||||||
import { useAuth } from "components/AuthProvider/AuthProvider"
|
import { useAuth } from "components/AuthProvider/AuthProvider"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Navigate, useLocation } from "react-router"
|
import { Outlet, Navigate, useLocation } from "react-router-dom"
|
||||||
import { Outlet } from "react-router-dom"
|
|
||||||
import { embedRedirect } from "../../utils/redirect"
|
import { embedRedirect } from "../../utils/redirect"
|
||||||
import { FullScreenLoader } from "../Loader/FullScreenLoader"
|
import { FullScreenLoader } from "../Loader/FullScreenLoader"
|
||||||
import { DashboardProvider } from "components/Dashboard/DashboardProvider"
|
import { DashboardProvider } from "components/Dashboard/DashboardProvider"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Navigate } from "react-router"
|
import { Navigate } from "react-router-dom"
|
||||||
|
|
||||||
export interface RequirePermissionProps {
|
export interface RequirePermissionProps {
|
||||||
children: JSX.Element
|
children: JSX.Element
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { useMachine } from "@xstate/react"
|
||||||
import { useOrganizationId } from "hooks/useOrganizationId"
|
import { useOrganizationId } from "hooks/useOrganizationId"
|
||||||
import { FC } from "react"
|
import { FC } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { useNavigate } from "react-router"
|
import { useNavigate } from "react-router-dom"
|
||||||
import { createUserMachine } from "xServices/users/createUserXService"
|
import { createUserMachine } from "xServices/users/createUserXService"
|
||||||
import * as TypesGen from "../../../api/typesGenerated"
|
import * as TypesGen from "../../../api/typesGenerated"
|
||||||
import { CreateUserForm } from "../../../components/CreateUserForm/CreateUserForm"
|
import { CreateUserForm } from "../../../components/CreateUserForm/CreateUserForm"
|
||||||
|
|
|
@ -9,8 +9,7 @@ import { useMe } from "hooks/useMe"
|
||||||
import { usePermissions } from "hooks/usePermissions"
|
import { usePermissions } from "hooks/usePermissions"
|
||||||
import { FC, ReactNode, useEffect } from "react"
|
import { FC, ReactNode, useEffect } from "react"
|
||||||
import { Helmet } from "react-helmet-async"
|
import { Helmet } from "react-helmet-async"
|
||||||
import { useNavigate } from "react-router"
|
import { useSearchParams, useNavigate } from "react-router-dom"
|
||||||
import { useSearchParams } from "react-router-dom"
|
|
||||||
import { siteRolesMachine } from "xServices/roles/siteRolesXService"
|
import { siteRolesMachine } from "xServices/roles/siteRolesXService"
|
||||||
import { usersMachine } from "xServices/users/usersXService"
|
import { usersMachine } from "xServices/users/usersXService"
|
||||||
import { ConfirmDialog } from "../../components/Dialogs/ConfirmDialog/ConfirmDialog"
|
import { ConfirmDialog } from "../../components/Dialogs/ConfirmDialog/ConfirmDialog"
|
||||||
|
|
|
@ -17,5 +17,6 @@
|
||||||
"baseUrl": "./src"
|
"baseUrl": "./src"
|
||||||
},
|
},
|
||||||
"include": ["**/*.ts", "**/*.tsx"],
|
"include": ["**/*.ts", "**/*.tsx"],
|
||||||
"exclude": ["node_modules", "_jest"]
|
"exclude": ["node_modules", "_jest"],
|
||||||
|
"types": ["node", "jest", "@testing-library/jest-dom"]
|
||||||
}
|
}
|
||||||
|
|
12225
site/yarn.lock
12225
site/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue