Skip to content

Commit

Permalink
chore: upgrade to yarn v4
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Jun 4, 2024
1 parent 048d604 commit 5ff70b2
Show file tree
Hide file tree
Showing 37 changed files with 42,299 additions and 27,783 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
node-version: 20.x
cache: 'yarn'
- run: yarn install --frozen-lockfile --ignore-scripts
- run: yarn install --immutable
- run: yarn lint
- run: yarn build:backend
- run: yarn run test:report # This adds test results as github check to the workflow
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_frontend_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: yarn --immutable
- run: yarn run lint:material:icons
- run: yarn --frozen-lockfile
- run: yarn run lint:check
- run: yarn run test
- run: yarn run ts:check # TODO: optimize
4 changes: 2 additions & 2 deletions .github/workflows/gradual-strict-null-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
YARN_1="yarn --mutex network --cwd ./current"
YARN_2="yarn --mutex network --cwd ./main"
$YARN_1 install --ignore-scripts &> /dev/null && $YARN_1 build:backend --strictNullChecks true 2> .stderr-current > .out-current &
$YARN_1 install &> /dev/null && $YARN_1 build:backend --strictNullChecks true 2> .stderr-current > .out-current &
pid1=$!
$YARN_2 install --ignore-scripts &> /dev/null && $YARN_2 build:backend --strictNullChecks true 2> .stderr-main > .out-main &
$YARN_2 install &> /dev/null && $YARN_2 build:backend --strictNullChecks true 2> .stderr-main > .out-main &
pid2=$!
# wait for the processes that are expected to fail
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify_enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Build static assets
run: |
cd frontend
yarn install --frozen-lockfile
yarn install --immutable
yarn build
- uses: aws-actions/configure-aws-credentials@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-new-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
else
echo "No changes to CHANGELOG.md"
fi
- run: yarn install --frozen-lockfile --ignore-scripts
- run: yarn install --immutable
- name: npm version
run: |
npm version ${{ github.event.inputs.version }} --ignore-scripts
npm version ${{ github.event.inputs.version }}
git push origin ${{ github.ref_name }}
git push --tags
env:
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
mv package.json.tmp package.json
- name: lint
run: |
yarn install --frozen-lockfile --ignore-scripts
yarn install --immutable
yarn lint:fix
- name: push changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: 'yarn'
- name: Build
run: |
yarn install --frozen-lockfile
yarn install --immutable
- name: Publish to npm
run: |
LATEST=$(npm show unleash-server version)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
DATABASE_URL: postgres://postgres:unleash@localhost:5432/unleash
DATABASE_SSL: false
run: |
yarn install --frozen-lockfile --ignore-scripts
yarn install --immutable
yarn db-migrate up
# run ui tests against previous version of Unleash
- name: Run Cypress
Expand Down
Binary file added .yarn/install-state.gz
Binary file not shown.
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ WORKDIR /unleash

COPY . /unleash

RUN yarn config set network-timeout 300000
RUN corepack enable

RUN yarn install --frozen-lockfile --ignore-scripts && yarn prepare:backend && yarn local:package
RUN yarn install --immutable && yarn prepare:backend && yarn local:package

# frontend/build should already exist (it needs to be built in the local filesystem but in case of a fresh build we'll build it here)
RUN yarn build:frontend:if-needed
RUN yarn build:frontend

RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build

WORKDIR /unleash/docker

RUN yarn install --frozen-lockfile --production=true
RUN yarn install

FROM node:$NODE_VERSION

Expand Down
10 changes: 7 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnsafeOptionalChaining": "off",
"useExhaustiveDependencies": "off",
"noUnusedImports": "warn"
"noUnusedImports": "warn",
"useJsxKeyInIterable": "off"
},
"complexity": {
"noBannedTypes": "off",
Expand All @@ -31,7 +32,8 @@
"noPrototypeBuiltins": "off",
"noConfusingVoidType": "off",
"noArrayIndexKey": "off",
"noThenProperty": "off"
"noThenProperty": "off",
"noExportsInTest": "off"
},
"performance": {
"noAccumulatingSpread": "off",
Expand All @@ -40,6 +42,7 @@
},
"ignore": [
"node_modules",
"package.json",
"docker",
"bundle.js",
"website/build",
Expand All @@ -61,6 +64,7 @@
"indentStyle": "space",
"ignore": [
"node_modules",
"package.json",
"docker",
"bundle.js",
"setupJest.js",
Expand Down
894 changes: 894 additions & 0 deletions docker/.yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docker/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-4.2.2.cjs
2 changes: 2 additions & 0 deletions docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@
"json-schema": "^0.4.0",
"semver": "^7.5.3"
}
"version": "5.12.4",
"packageManager": "[email protected]"
}
Binary file added frontend/.yarn/install-state.gz
Binary file not shown.
894 changes: 894 additions & 0 deletions frontend/.yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-4.2.2.cjs
11 changes: 6 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"start:demo2": "UNLEASH_API=https://sandbox.getunleash.io/ UNLEASH_BASE_PATH=/demo2/ yarn run start",
"start:enterprise": "UNLEASH_API=https://unleash.herokuapp.com VITE_TEST_REDIRECT=true yarn run start",
"start:demo": "UNLEASH_BASE_PATH=/demo/ UNLEASH_API=https://app.unleash-hosted.com/ yarn run start",
"test": "NODE_OPTIONS=\"${NODE_OPTIONS} --no-experimental-fetch\" vitest run",
"test:snapshot": "NODE_OPTIONS=\"${NODE_OPTIONS} --no-experimental-fetch\" yarn test -u",
"test:watch": "NODE_OPTIONS=\"${NODE_OPTIONS} --no-experimental-fetch\" vitest watch",
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:-0} --no-experimental-fetch\" vitest run",
"test:snapshot": "NODE_OPTIONS=\"${NODE_OPTIONS:-0} --no-experimental-fetch\" yarn test -u",
"test:watch": "NODE_OPTIONS=\"${NODE_OPTIONS:-0} --no-experimental-fetch\" vitest watch",
"lint:material:icons": "./check-imports.rc",
"lint": "biome lint src --apply",
"lint:check": "biome check src",
Expand All @@ -34,7 +34,7 @@
"gen:api:clean": "yarn gen:api && rm -rf src/openapi/apis && sed -i.bak '1q' src/openapi/index.ts && rm src/openapi/index.ts.bak"
},
"devDependencies": {
"@biomejs/biome": "1.6.4",
"@biomejs/biome": "1.7.3",
"@codemirror/lang-json": "6.0.1",
"@emotion/react": "11.11.4",
"@emotion/styled": "11.11.5",
Expand Down Expand Up @@ -152,5 +152,6 @@
"last 1 firefox version",
"last 1 safari version"
]
}
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export const FlagsProjectChart: VFC<IFlagsProjectChartProps> = ({

const data = useProjectChartData(projectFlagTrends);
const notEnoughData = useMemo(
() =>
!isLoading &&
(data.datasets.some((d) => d.data.length > 1) ? false : true),
() => !isLoading && !data.datasets.some((d) => d.data.length > 1),
[data, isLoading],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ export const ProjectHealthChart: VFC<IProjectHealthChartProps> = ({
: projectsData;
const notEnoughData = useMemo(
() =>
!isLoading &&
(projectsData.datasets.some((d) => d.data.length > 1)
? false
: true),
!isLoading && !projectsData.datasets.some((d) => d.data.length > 1),
[projectsData, isLoading],
);
const data =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export const UsersPerProjectChart: VFC<IUsersPerProjectChartProps> = ({

const data = useProjectChartData(projectFlagTrends);
const notEnoughData = useMemo(
() =>
!isLoading &&
(data.datasets.some((d) => d.data.length > 1) ? false : true),
() => !isLoading && !data.datasets.some((d) => d.data.length > 1),
[data, isLoading],
);

Expand Down
12 changes: 6 additions & 6 deletions frontend/src/component/insights/hooks/usePlaceholderData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ export const usePlaceholderData = (
data:
type === 'rising'
? [
3, 5, 15, 17, 25, 40, 47, 48, 55,
65, 62, 72, 75, 73, 80,
]
3, 5, 15, 17, 25, 40, 47, 48, 55,
65, 62, 72, 75, 73, 80,
]
: [
54, 52, 53, 49, 54, 50, 47, 46,
51, 51, 50, 51, 49, 49, 51,
],
54, 52, 53, 49, 54, 50, 47, 46, 51,
51, 50, 51, 49, 49, 51,
],
borderColor: theme.palette.primary.light,
backgroundColor: fill
? fillGradientPrimary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SingleSelectConfigButton: FC<SingleSelectConfigButtonProps> = ({
const handleChange = (value: any) => {
onChange(value);
setAnchorEl(null);
props.onClose && props.onClose();
props.onClose?.();

setRecentlyClosed(true);
// this is a hack to prevent the button from being
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ const useResetPassword = (options: SWRConfiguration = {}) => {
setLoading(!error && !data);
}, [data, error]);

const isValidToken =
const isValidToken = !(
(!loading && data?.name === INVALID_TOKEN_ERROR) ||
data?.name === USED_TOKEN_ERROR
? false
: true;
);

return {
token,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/hooks/useSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export const getColumnValues = (column: any, row: any) => {
? column.accessor(row)
: column.accessor.includes('.')
? column.accessor
.split('.')
.reduce((object: any, key: string) => object?.[key], row)
.split('.')
.reduce((object: any, key: string) => object?.[key], row)
: row[column.accessor];

if (column.filterParsing) {
Expand Down
Loading

0 comments on commit 5ff70b2

Please sign in to comment.