Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/leafygreen-ui/icon-b…
Browse files Browse the repository at this point in the history
…utton-15.0.22
  • Loading branch information
khelif96 committed Jun 27, 2024
2 parents 32cad93 + a77f6fa commit 55c3592
Show file tree
Hide file tree
Showing 91 changed files with 1,425 additions and 472 deletions.
4 changes: 2 additions & 2 deletions .evergreen/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ functions:
SPRUCE_SENTRY_AUTH_TOKEN: ${SPRUCE_SENTRY_AUTH_TOKEN}
script: |
${PREPARE_SHELL}
PWD=$(pwd) yarn ts-node -e "import {setupCredentials} from '@evg-ui/deploy-utils'; setupCredentials(\"$PWD\", \"${target}\");"
yarn node-loader-ts-node ../../.evergreen/scripts/setup-credentials.js ${target}
deploy:
command: shell.exec
Expand All @@ -31,7 +31,7 @@ functions:
AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
script: |
${PREPARE_SHELL}
yarn env-cmd -e ${target} ts-node -e "import {deployRemote} from '@evg-ui/deploy-utils'; deployRemote();"
env-cmd -e ${target} yarn node-loader-ts-node ../../.evergreen/scripts/deploy-target.js
tasks:
- name: deploy-parsley-staging
Expand Down
10 changes: 5 additions & 5 deletions .evergreen/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ buildvariants:
mongodb_tools_url: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.8.0.tgz
mongodb_url_2204: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.2.tgz
mongosh_url_2204: https://downloads.mongodb.com/compass/mongosh-2.0.2-linux-x64.tgz
node_version: 20.10.0
node_version: 20.11.0
modules:
- evergreen
- logkeeper
Expand All @@ -75,7 +75,7 @@ buildvariants:
mongodb_tools_url: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.8.0.tgz
mongodb_url_2204: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.2.tgz
mongosh_url_2204: https://downloads.mongodb.com/compass/mongosh-2.0.2-linux-x64.tgz
node_version: 20.10.0
node_version: 20.11.0
run_on:
- ubuntu2204-large
- ubuntu2204-small
Expand Down Expand Up @@ -104,7 +104,7 @@ buildvariants:
mongodb_tools_url: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.8.0.tgz
mongodb_url_2204: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.2.tgz
mongosh_url_2204: https://downloads.mongodb.com/compass/mongosh-2.0.2-linux-x64.tgz
node_version: 20.10.0
node_version: 20.11.0
run_on:
- ubuntu2204-large
- ubuntu2204-small
Expand All @@ -123,7 +123,7 @@ buildvariants:
mongodb_tools_url: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.8.0.tgz
mongodb_url_2204: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.2.tgz
mongosh_url_2204: https://downloads.mongodb.com/compass/mongosh-2.0.2-linux-x64.tgz
node_version: 20.10.0
node_version: 20.11.0
run_on:
- ubuntu2204-large
- ubuntu2204-small
Expand All @@ -145,7 +145,7 @@ buildvariants:
display_name: Deploys
allowed_requesters: ["patch"]
expansions:
node_version: 20.10.0
node_version: 20.11.0
run_on:
- ubuntu2204-large
tasks:
Expand Down
3 changes: 3 additions & 0 deletions .evergreen/scripts/deploy-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { deployRemote } from "@evg-ui/deploy-utils";

deployRemote();
8 changes: 4 additions & 4 deletions .evergreen/scripts/generate-tasks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { execSync } = require("child_process");
const { writeFileSync } = require("fs");
const { join, parse } = require("path");
import { execSync } from "child_process";
import { writeFileSync } from "fs";
import { join, parse } from "path";

// This file is written in plain JS because it makes the generator super fast. No need to install TypeScript.

Expand Down Expand Up @@ -49,7 +49,7 @@ const TASK_MAPPING = {
};

const APPS_DIR = "apps";
const fileDestPath = join(__dirname, "../", "generate-tasks.json");
const fileDestPath = join(process.cwd(), "/.evergreen", "generate-tasks.json");

const getMergeBase = () => {
try {
Expand Down
6 changes: 6 additions & 0 deletions .evergreen/scripts/setup-credentials.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { setupCredentials } from "@evg-ui/deploy-utils";

const dirname = process.cwd()
const target = process.argv[2]

setupCredentials(dirname, target);
1 change: 1 addition & 0 deletions .evergreen/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ functions:
sleep 10
done
npm install -g yarn
npm install -g env-cmd
symlink:
command: shell.exec
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion apps/parsley/config/injectVariablesInHTML.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { sync } from "replace-in-file";
import pkg from "replace-in-file";
const { sync } = pkg;

type InjectVariablesInHTMLConfig = {
files: string | string[];
Expand Down
4 changes: 2 additions & 2 deletions apps/parsley/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const baseConfig = require("@evg-ui/lint-staged");
import baseConfig from "@evg-ui/lint-staged";

module.exports = baseConfig;
export default baseConfig;
20 changes: 11 additions & 9 deletions apps/parsley/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "parsley",
"version": "2.1.25",
"private": true,
"version": "2.1.24",
"type": "module",
"scripts": {
"bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh",
"build": "tsc && GIT_SHA=`git rev-parse HEAD` APP_VERSION=$npm_package_version vite build",
Expand All @@ -16,7 +17,7 @@
"cy:run": "cypress run",
"deploy:beta": "yarn build:beta && env-cmd -e beta yarn deploy:do-not-use",
"deploy:staging": "yarn build:staging && env-cmd -e staging yarn deploy:do-not-use",
"deploy:prod": "env-cmd -e production ts-node scripts/deploy/run-deploy",
"deploy:prod": "env-cmd -e production yarn node-loader-ts-node scripts/deploy/run-deploy",
"deploy:do-not-use": ". ./scripts/deploy/deploy.sh",
"dev": "env-cmd -e devLocal -r .env-cmdrc.local.json vite",
"evg-db-ops": "../../scripts/evg-db-ops.sh",
Expand All @@ -33,7 +34,8 @@
"storybook": "storybook dev -p 6007",
"storybook:build": "env-cmd -e local -r .env-cmdrc.local.json storybook build",
"test": "vitest --typecheck=false --exclude=src/snapshot.test.ts",
"postversion": "scripts/push-version.sh"
"postversion": "scripts/push-version.sh",
"node-loader-ts-node": "node --no-warnings=ExperimentalWarning --loader ts-node/esm"
},
"dependencies": {
"@apollo/client": "3.10.4",
Expand Down Expand Up @@ -66,8 +68,8 @@
"@leafygreen-ui/toggle": "10.0.4",
"@leafygreen-ui/tooltip": "10.0.10",
"@leafygreen-ui/typography": "19.0.0",
"@sentry/react": "8.10.0",
"@sentry/types": "8.10.0",
"@sentry/react": "8.11.0",
"@sentry/types": "8.11.0",
"ansi_up": "6.0.2",
"graphql": "16.8.1",
"html-react-parser": "3.0.6",
Expand All @@ -93,14 +95,14 @@
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/typescript": "4.0.7",
"@graphql-codegen/typescript-operations": "4.2.1",
"@sentry/vite-plugin": "2.19.0",
"@sentry/vite-plugin": "2.20.0",
"@storybook/addon-actions": "8.1.10",
"@storybook/react": "8.1.10",
"@storybook/react-vite": "8.1.10",
"@storybook/testing-library": "0.2.2",
"@styled/typescript-styled-plugin": "1.0.1",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.7",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@types/js-cookie": "3.0.6",
"@types/lodash.debounce": "4.0.7",
Expand Down Expand Up @@ -133,6 +135,6 @@
"vitest": "1.6.0"
},
"engines": {
"node": ">=20.10.0"
"node": ">=20.11.0"
}
}
5 changes: 4 additions & 1 deletion apps/parsley/scripts/deploy/utils/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ const getCommitMessages = (currentlyDeployedCommit: string) => {
* @returns - the currently deployed commit
*/
const getCurrentlyDeployedCommit = () => {
const filePath = resolve(__dirname, "../../get-current-deployed-commit.sh");
const filePath = resolve(
import.meta.dirname,
"../../get-current-deployed-commit.sh",
);
const currentlyDeployedCommit = execSync(`bash ${filePath}`, {
encoding: "utf-8",
})
Expand Down
6 changes: 3 additions & 3 deletions apps/parsley/scripts/setup-credentials.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require("fs");
const path = require("path");
import fs from "fs";
import path from "path";

const file = path.join(__dirname, "../", ".env-cmdrc.json");
const file = path.join(process.cwd(), ".env-cmdrc.json");
const production = {
BUCKET: process.env.BUCKET,
DEPLOYS_EMAIL: process.env.DEPLOYS_EMAIL,
Expand Down
2 changes: 2 additions & 0 deletions apps/parsley/src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ export type PatchTriggerAlias = {
alias: Scalars["String"]["output"];
childProjectId: Scalars["String"]["output"];
childProjectIdentifier: Scalars["String"]["output"];
downstreamRevision?: Maybe<Scalars["String"]["output"]>;
parentAsModule?: Maybe<Scalars["String"]["output"]>;
status?: Maybe<Scalars["String"]["output"]>;
taskSpecifiers?: Maybe<Array<TaskSpecifier>>;
Expand All @@ -1511,6 +1512,7 @@ export type PatchTriggerAlias = {
export type PatchTriggerAliasInput = {
alias: Scalars["String"]["input"];
childProjectIdentifier: Scalars["String"]["input"];
downstreamRevision?: InputMaybe<Scalars["String"]["input"]>;
parentAsModule?: InputMaybe<Scalars["String"]["input"]>;
status?: InputMaybe<Scalars["String"]["input"]>;
taskSpecifiers: Array<TaskSpecifierInput>;
Expand Down
1 change: 0 additions & 1 deletion apps/parsley/src/snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const compose = (

const getAllStoryFiles = () => {
const storyFiles = Object.entries(
// @ts-expect-error
import.meta.glob<StoryFile>("./**/*.stories.tsx", {
eager: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion apps/parsley/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseUrl": "src",
"paths": {
"@evg-ui/lib/*": ["../../../packages/lib/src/*"]
}
},
},
"include": [
"src",
Expand Down
2 changes: 1 addition & 1 deletion apps/parsley/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"composite": true,
"module": "CommonJS",
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions apps/spruce/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getConfig = ({
generatedFileName: string;
} & Pick<CodegenConfig, "silent">): CodegenConfig => ({
documents: ["./src/**/*.ts", "./src/**/*.graphql", "./src/**/*.gql"].map(
(d) => resolve(__dirname, d),
(d) => resolve(process.cwd(), d),
),
generates: {
[generatedFileName]: {
Expand All @@ -26,7 +26,7 @@ export const getConfig = ({
},
hooks: {
afterAllFileWrite: [
`${resolve(__dirname, "./node_modules/.bin/prettier")} --write`,
`${resolve(process.cwd(), "./node_modules/.bin/prettier")} --write`,
],
},
overwrite: true,
Expand All @@ -35,7 +35,7 @@ export const getConfig = ({
});

export const generatedFileName = resolve(
__dirname,
process.cwd(),
"./src/gql/generated/types.ts",
);

Expand Down
8 changes: 5 additions & 3 deletions apps/spruce/config/injectVariablesInHTML.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { sync } from "replace-in-file";
import pkg from "replace-in-file";

const { sync } = pkg;

type InjectVariablesInHTMLConfig = {
files: string | string[];
variables: string[];
}
};
export default (options: InjectVariablesInHTMLConfig) => {
const from = options.variables.map((v) => new RegExp(v, "g"));
const to = options.variables.map((v) => process.env[v.replace(/%/g, "")]);
Expand All @@ -14,7 +16,7 @@ export default (options: InjectVariablesInHTMLConfig) => {
sync({
files: options.files,
from,
to
to,
});
} catch (error) {
console.error("Error occurred:", error);
Expand Down
2 changes: 1 addition & 1 deletion apps/spruce/cypress/integration/myPatches/my_patches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("My Patches Page", () => {
it("Searching for a nonexistent patch shows 'No patches found'", () => {
cy.visit(MY_PATCHES_ROUTE);
cy.dataCy("patch-description-input").type("satenarstharienht");
cy.dataCy("no-patches-found").contains("No patches found");
cy.contains("No patches found");
});

it("Grouped task status icon should link to version page with appropriate filters", () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/spruce/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const baseConfig = require("@evg-ui/lint-staged");
import baseConfig from "@evg-ui/lint-staged";

module.exports = {
export default {
...baseConfig,
"*.{ts,tsx}": () => ["yarn check-types", "yarn check-schema-and-codegen"], // For TypeScript files, run tsc, and gql schema check
};
25 changes: 14 additions & 11 deletions apps/spruce/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "spruce",
"version": "4.1.37",
"version": "4.1.39",
"private": true,
"type": "module",
"scripts": {
"bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh",
"build:beta": "env-cmd -e beta yarn build",
Expand All @@ -11,16 +12,16 @@
"build": "GIT_SHA=`git rev-parse HEAD` APP_VERSION=$npm_package_version vite build",
"check-types": "tsc -p tsconfig.json --noEmit",
"clean": "rm -rf node_modules && rm -rf dist && yarn install",
"codegen": "graphql-codegen --config codegen.ts",
"codegen": "graphql-codegen-esm --config codegen.ts",
"cy:open": "yarn evg-db-ops --reseed-and-dump; cypress open",
"cy:run": "cypress run",
"cy:test": "cypress run --spec",
"deploy:beta": "yarn build:beta && env-cmd -e beta yarn deploy:do-not-use",
"deploy:staging": "yarn build:staging && env-cmd -e staging yarn deploy:do-not-use",
"deploy:prod": "env-cmd -e production ts-node scripts/deploy/run-deploy",
"deploy:prod": "env-cmd -e production yarn node-loader-ts-node scripts/deploy/run-deploy",
"deploy:do-not-use": ". ./scripts/deploy/deploy.sh",
"dev": "env-cmd -e devLocal -r .env-cmdrc.local.json yarn start",
"check-schema-and-codegen": "ts-node scripts/check-schema-and-codegen/script.ts",
"check-schema-and-codegen": "yarn node-loader-ts-node scripts/check-schema-and-codegen/script.ts",
"eslint:fix": "yarn eslint:strict --fix",
"eslint:staged": "STRICT=1 eslint",
"eslint:strict": "STRICT=1 eslint .",
Expand All @@ -35,7 +36,8 @@
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build",
"test": "vitest --typecheck=false --exclude=src/snapshot.test.ts",
"postversion": "scripts/push-version.sh"
"postversion": "scripts/push-version.sh",
"node-loader-ts-node": "node --no-warnings=ExperimentalWarning --loader ts-node/esm"
},
"browserslist": {
"production": [
Expand Down Expand Up @@ -68,6 +70,7 @@
"@leafygreen-ui/date-picker": "1.1.3",
"@leafygreen-ui/date-utils": "0.1.2",
"@leafygreen-ui/emotion": "4.0.7",
"@leafygreen-ui/empty-state": "1.0.17",
"@leafygreen-ui/expandable-card": "3.1.0",
"@leafygreen-ui/guide-cue": "5.0.8",
"@leafygreen-ui/icon": "11.26.0",
Expand Down Expand Up @@ -100,8 +103,8 @@
"@leafygreen-ui/tooltip": "10.0.10",
"@leafygreen-ui/typography": "19.0.0",
"@rjsf/core": "4.2.3",
"@sentry/react": "8.10.0",
"@sentry/types": "8.10.0",
"@sentry/react": "8.11.0",
"@sentry/types": "8.11.0",
"ansi_up": "6.0.2",
"antd": "4.20.0",
"date-fns": "3.6.0",
Expand Down Expand Up @@ -136,13 +139,13 @@
"@graphql-codegen/typescript": "4.0.7",
"@graphql-codegen/typescript-operations": "4.2.1",
"@originjs/vite-plugin-commonjs": "1.0.3",
"@sentry/vite-plugin": "2.19.0",
"@sentry/vite-plugin": "2.20.0",
"@storybook/addon-actions": "8.1.10",
"@storybook/react": "8.1.10",
"@storybook/react-vite": "8.1.10",
"@styled/typescript-styled-plugin": "1.0.1",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.7",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@types/js-cookie": "^3.0.6",
"@types/lodash.debounce": "4.0.7",
Expand Down Expand Up @@ -187,6 +190,6 @@
"has-symbols": "^1.0.2"
},
"engines": {
"node": ">=20.10.0"
"node": ">=20.11.0"
}
}
Loading

0 comments on commit 55c3592

Please sign in to comment.