From 8a3a7cfe920a5936378a7261dc3520989cc9fbac Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 7 Apr 2021 17:38:49 +0100 Subject: [PATCH 1/3] Update all scripts to use yarn rather than npm --- package.json | 6 +++--- packages/builder/README.md | 6 +++--- packages/server/package.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 8a0c629d94..b2f572d202 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,9 @@ "initialise": "lerna run initialise", "publishdev": "lerna run publishdev", "publishnpm": "yarn build && lerna publish --force-publish", - "restore": "npm run clean && npm run bootstrap && npm run build", - "nuke": "npm run nuke:packages && npm run nuke:docker", - "nuke:packages": "npm run restore", + "restore": "yarn run clean && yarn run bootstrap && yarn run build", + "nuke": "yarn run nuke:packages && yarn run nuke:docker", + "nuke:packages": "yarn run restore", "nuke:docker": "lerna run --parallel dev:stack:nuke", "clean": "lerna clean", "kill-port": "kill-port 4001", diff --git a/packages/builder/README.md b/packages/builder/README.md index 7256dfd00d..c1dd8b7871 100644 --- a/packages/builder/README.md +++ b/packages/builder/README.md @@ -1,6 +1,6 @@ ## Get Started -`npm install` +`yarn install` -Webpack dev server (port 8080): `npm run dev` -Build `npm run build` +Vite dev server (port 3000): `yarn run dev` +Build `yarn run build` diff --git a/packages/server/package.json b/packages/server/package.json index 36cd215423..e7a26fa875 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -32,14 +32,14 @@ } }, "scripts": { - "test": "jest --testPathIgnorePatterns=routes && npm run test:integration", + "test": "jest --testPathIgnorePatterns=routes && yarn run test:integration", "test:integration": "jest --coverage --detectOpenHandles", "test:watch": "jest --watch", "run:docker": "node src/index", "dev:stack:up": "node scripts/dev/manage.js up", "dev:stack:down": "node scripts/dev/manage.js down", "dev:stack:nuke": "node scripts/dev/manage.js nuke", - "dev:builder": "npm run dev:stack:up && nodemon src/index.js", + "dev:builder": "yarn run dev:stack:up && nodemon src/index.js", "electron": "electron src/electron.js", "build:electron": "electron-builder --dir", "publish:electron": "electron-builder -mwl --publish always", From 0f49868de83b580e3bc42b2625e00aef339d0583 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Apr 2021 17:52:22 +0100 Subject: [PATCH 2/3] Updating to make sure the envoy generated dev file is very obviously not to be edited. --- .gitignore | 2 +- hosting/docker-compose.dev.yaml | 2 +- packages/server/scripts/dev/manage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 418c28d981..111263f9f1 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,7 @@ typings/ # dotenv environment variables file .env !hosting/.env -hosting/generated-envoy.dev.yaml +hosting/.generated-envoy.dev.yaml # parcel-bundler cache (https://parceljs.org/) .cache diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index 5c6947a3e9..9b4c353981 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -27,7 +27,7 @@ services: restart: always image: envoyproxy/envoy:v1.16-latest volumes: - - ./generated-envoy.dev.yaml:/etc/envoy/envoy.yaml + - ./.generated-envoy.dev.yaml:/etc/envoy/envoy.yaml ports: - "${MAIN_PORT}:10000" depends_on: diff --git a/packages/server/scripts/dev/manage.js b/packages/server/scripts/dev/manage.js index 88967eb0b3..7a318ff6ff 100644 --- a/packages/server/scripts/dev/manage.js +++ b/packages/server/scripts/dev/manage.js @@ -25,7 +25,7 @@ async function init() { // generate envoy file, always do this incase it has changed const hostingPath = path.join(process.cwd(), "..", "..", "hosting") const envoyHbsPath = path.join(hostingPath, "envoy.dev.yaml.hbs") - const envoyOutputPath = path.join(hostingPath, "generated-envoy.dev.yaml") + const envoyOutputPath = path.join(hostingPath, ".generated-envoy.dev.yaml") const contents = fs.readFileSync(envoyHbsPath, "utf8") const config = { address: isLinux() ? "172.17.0.1" : "host.docker.internal", From 6d5b13632f9547658c48be530149fca69cbcc6bc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Apr 2021 20:19:25 +0100 Subject: [PATCH 3/3] Adding a wait for authentication in cypress tests.# --- packages/builder/cypress/support/commands.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 7ac317142d..9cebfd81dc 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -26,6 +26,8 @@ Cypress.Commands.add("createApp", name => { cy.visit(`localhost:${Cypress.env("PORT")}/builder`) + // wait for init API calls on visit + cy.wait(100) cy.contains("Create New Web App").click() cy.get("body") .then($body => {