Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: fix initial installation on windows (#18241)
  • Loading branch information
userquin committed Sep 25, 2021
1 parent a5356b8 commit 853a6f5
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 17 deletions.
4 changes: 3 additions & 1 deletion npm/create-cypress-tests/package.json
Expand Up @@ -5,9 +5,10 @@
"private": false,
"main": "index.js",
"scripts": {
"build": "yarn prepare-example && tsc -p ./tsconfig.json && node scripts/example copy-to ./dist/initial-template && yarn copy \"./src/**/*.template.js\" \"./dist/src\"",
"build": "yarn prepare-example && tsc -p ./tsconfig.json && node scripts/example copy-to ./dist/initial-template && yarn prepare-copy-templates",
"build-prod": "yarn build",
"prepare-example": "node scripts/example copy-to ./initial-template",
"prepare-copy-templates": "node scripts/copy-templates copy-to ./dist/src",
"test": "cross-env TS_NODE_PROJECT=./tsconfig.test.json mocha --config .mocharc.json './src/**/*.test.ts'",
"test:watch": "yarn test -w"
},
Expand All @@ -20,6 +21,7 @@
"chalk": "4.1.0",
"cli-highlight": "2.1.10",
"commander": "6.1.0",
"fast-glob": "3.2.7",
"find-up": "5.0.0",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
Expand Down
40 changes: 40 additions & 0 deletions npm/create-cypress-tests/scripts/copy-templates.js
@@ -0,0 +1,40 @@
const fg = require('fast-glob')
const fs = require('fs-extra')
const chalk = require('chalk')
const path = require('path')
const program = require('commander')

program
.command('copy-to [destination]')
.description('copy ./src/**/*.template.js into destination')
.action(async (destination) => {
const srcPath = path.resolve(__dirname, '..', 'src')
const destinationPath = path.resolve(process.cwd(), destination)

const templates = await fg('**/*.template.js', {
cwd: srcPath,
onlyFiles: true,
unique: true,
})

const srcOuput = './src/'
let destinationOuput = destination.replace('/\\/g', '/')

if (!destinationOuput.endsWith('/')) {
destinationOuput += '/'
}

const relOutput = (template, forSource) => {
return `${forSource ? srcOuput : destinationOuput}${template}`
}

const result = await Promise.all(templates.map(async (template) => {
await fs.copy(path.join(srcPath, template), path.join(destinationPath, template))

return () => console.log(`✅ ${relOutput(template, true)} successfully copied to ${chalk.cyan(relOutput(template, false))}`)
}))

result.forEach((r) => r())
})

program.parse(process.argv)
2 changes: 1 addition & 1 deletion npm/design-system/package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Styles, standards, and components used throughout Cypress",
"main": "dist/index.js",
"scripts": {
"build": "rimraf dist && yarn rollup -c rollup.config.js",
"build": "rimraf dist && rollup -c rollup.config.js",
"build-prod": "yarn build",
"build-storybook": "build-storybook",
"build-style-types": "tsm \"src/css/derived/*.scss\" --nameFormat none --exportType default",
Expand Down
2 changes: 1 addition & 1 deletion npm/react/package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Test React components using Cypress",
"main": "dist/cypress-react.cjs.js",
"scripts": {
"build": "rimraf dist && yarn transpile-plugins && yarn rollup -c rollup.config.js",
"build": "rimraf dist && yarn transpile-plugins && rollup -c rollup.config.js",
"build-prod": "yarn build",
"cy:open": "node ../../scripts/cypress.js open-ct",
"cy:open:debug": "node --inspect-brk ../../scripts/start.js --component-testing --run-project ${PWD}",
Expand Down
2 changes: 1 addition & 1 deletion npm/vue/package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Browser-based Component Testing for Vue.js with Cypress.io ✌️🌲",
"main": "dist/cypress-vue.cjs.js",
"scripts": {
"build": "rimraf dist && yarn rollup -c rollup.config.js",
"build": "rimraf dist && rollup -c rollup.config.js",
"build-prod": "yarn build",
"cy:open": "node ../../scripts/cypress.js open-ct --project ${PWD}",
"cy:run": "node ../../scripts/cypress.js run-ct --project ${PWD}",
Expand Down
25 changes: 12 additions & 13 deletions yarn.lock
Expand Up @@ -18875,6 +18875,17 @@ fast-glob@3.1.1:
merge2 "^1.3.0"
micromatch "^4.0.2"

fast-glob@3.2.7, fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.4:
version "3.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^2.0.2, fast-glob@^2.2.6:
version "2.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d"
Expand All @@ -18887,18 +18898,6 @@ fast-glob@^2.0.2, fast-glob@^2.2.6:
merge2 "^1.2.3"
micromatch "^3.1.10"

fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.4:
version "3.2.5"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661"
integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.0"
merge2 "^1.3.0"
micromatch "^4.0.2"
picomatch "^2.2.1"

fast-json-parse@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d"
Expand Down Expand Up @@ -20397,7 +20396,7 @@ glob-parent@^3.1.0:
is-glob "^3.1.0"
path-dirname "^1.0.0"

glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0, glob-parent@~5.1.2:
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
Expand Down

4 comments on commit 853a6f5

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 853a6f5 Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.5.0/circle-develop-853a6f5a332433971e451290b3aa961139d40793/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 853a6f5 Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.5.0/appveyor-develop-853a6f5a332433971e451290b3aa961139d40793/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 853a6f5 Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.5.0/appveyor-develop-853a6f5a332433971e451290b3aa961139d40793/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 853a6f5 Sep 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.5.0/circle-develop-853a6f5a332433971e451290b3aa961139d40793/cypress.tgz

Please sign in to comment.