mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-24 07:59:03 -06:00
* update example build scripts * remove old scaffolding relics * update * Fix some issues with scaffolding * Correctly fix issues with scaffolding * Replace old onboarding with new banner * Add ability to remove scaffolded files * Add banner for new users * Update tests for new scaffolding * Compare file sizes before removing * Add tests for remove file * Save when user opened cypress rather than boolean * Update intro link and add tets for banners * fix small issue * Update design and copy of onboarding banners * Update style of new spec file button * Improve outline button active statE * Update design of new project a bit more * Fix specs list tests * Update banner copy and layout * Update banner copy and layout * Switch to docs style alerts * Fix testing logic * Update banner styles a bit * Update banners * Add confirmation modal for delete specs * Update tests and fix states * Upgrade kitchensink dep * Upgrade kitchen sink version and fix unit tests * Update integration scaffolding test * Add further description to warning modal * Update test for new user and new project case * Remove check to file tree when removing files * Update kitchensink version * Fix edge case where banner could appear when no files have been scaffolded * Fix tests * Update styling for 'note' when deleting files * fix issue with path on windows * Change remove command * Fix rm dir * Fix for windows * Try to use appveyor to test * appveyor please * getting some feedback * Why doesn't this work * more info * I have a feeling this works * maybe its the other path * please * this is the one * this is it * this should work * try reverting that change that might not be needed * remove appveyor testing scaffolding Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
52 lines
1.4 KiB
JavaScript
Executable File
52 lines
1.4 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
/* eslint-disable quotes */
|
|
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
const glob = require('glob')
|
|
|
|
const eslintRe = /\/. eslint.+\s+/g
|
|
|
|
function replaceStringsIn (file) {
|
|
fs.readFile(file, 'utf8', function (err, str) {
|
|
if (err) throw err
|
|
|
|
const replace = function (source, dest) {
|
|
str = str.split(source).join(dest)
|
|
}
|
|
|
|
replace('http://localhost:8080', 'https://example.cypress.io')
|
|
replace("to.eq('localhost:8080')", "to.eq('example.cypress.io')")
|
|
replace("to.eq('localhost')", "to.eq('example.cypress.io')")
|
|
replace("to.eq('8080')", "to.eq('')")
|
|
replace("to.eq('http:')", "to.eq('https:')")
|
|
replace(eslintRe, "")
|
|
replace("imgSrcToDataURL('/assets", "imgSrcToDataURL('https://example.cypress.io/assets")
|
|
|
|
// temporary for 5.0.0
|
|
// TODO: remove this
|
|
replace("whitelist: 'session_id'", "preserve: 'session_id'")
|
|
replace("server.whitelist", "server.ignore")
|
|
|
|
fs.writeFile(file, str, function (err) {
|
|
if (err) throw err
|
|
|
|
// eslint-disable-next-line no-console
|
|
console.log(`Converted ${path.relative(process.cwd(), file)} successfully.`)
|
|
})
|
|
})
|
|
}
|
|
|
|
glob('./app/**/*.html', { realpath: true }, (err, htmlFiles) => {
|
|
if (err) throw err
|
|
|
|
glob('./cypress/integration/**/*.js', { realpath: true }, (err, specFiles) => {
|
|
if (err) throw err
|
|
|
|
htmlFiles.concat(specFiles).forEach(function (file) {
|
|
return replaceStringsIn(file)
|
|
})
|
|
})
|
|
})
|