Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add vue2 package from npm/vue/v2 branch #21026

Merged
merged 20 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ cli/types
# cli/react, cli/vue, and cli/mount-utils are all copied from dist'd builds
cli/react
cli/vue
cli/vue2
cli/mount-utils

# packages/example is not linted (think about changing this)
Expand Down Expand Up @@ -69,6 +70,9 @@ npm/cypress-schematic/src/**/*.js
/npm/create-cypress-tests/initial-template
/npm/create-cypress-tests/**/*.template.*

# The global eslint configuration is not set up to parse vue@2 files
/npm/vue2/**/*.vue

packages/data-context/test/unit/codegen/files

# community templates we test against, no need to lint
Expand Down
1 change: 1 addition & 0 deletions .releaserc.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ module.exports = {
],
extends: 'semantic-release-monorepo',
branches: [
'master',
],
}
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ commands:
command: ls -la types
working_directory: cli/build
- run:
command: ls -la vue mount-utils react
command: ls -la vue vue2 mount-utils react
working_directory: cli/build
- unless:
condition:
Expand Down
3 changes: 2 additions & 1 deletion cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ build
# ignore packages synced at build-time via
# the sync-exported-npm-with-cli.js script
vue
vue2
react
mount-utils
mount-utils
7 changes: 6 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
"types/net-stubbing.ts",
"mount-utils",
"vue",
"react"
"react",
"vue2"
],
"bin": {
"cypress": "bin/cypress"
Expand All @@ -124,6 +125,10 @@
"import": "./vue/dist/cypress-vue.esm-bundler.js",
"require": "./vue/dist/cypress-vue.cjs.js"
},
"./vue2": {
"import": "./vue2/dist/cypress-vue2.esm-bundler.js",
"require": "./vue2/dist/cypress-vue2.cjs.js"
},
"./package.json": {
"import": "./package.json",
"require": "./package.json"
Expand Down
1 change: 1 addition & 0 deletions cli/scripts/post-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const npmModulesToCopy = [
'mount-utils',
'react',
'vue',
'vue2',
]

npmModulesToCopy.forEach((folder) => {
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/post-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ shell.set('-e') // any error is fatal
fs.ensureDirSync(join(__dirname, '..', 'types'))

includeTypes.forEach((folder) => {
const source = resolvePkg(`@types/${folder}`, { cwd: join(__dirname, '..', '..') })
const source = resolvePkg(`@types/${folder}`, { cwd: __dirname })

fs.copySync(source, join(__dirname, '..', 'types', folder))
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('init component tests script', () => {
}) as any)

await initComponentTesting({ config: {}, cypressConfigPath, useYarn: true })
expect(execStub).to.be.calledWith('yarn add @cypress/vue@3 --dev')
expect(execStub).to.be.calledWith('yarn add @cypress/vue --dev')
})

it('suggest the right instruction based on user template choice', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ type InstallAdapterOptions = {
useYarn: boolean
}

const frameworkDependencies = {
react: '@cypress/react',
'vue@2': '@cypress/vue2',
'vue@3': '@cypress/vue',
}

export async function installFrameworkAdapter (cwd: string, options: InstallAdapterOptions) {
const framework = await guessOrAskForFramework(cwd)

await installDependency(`@cypress/${framework}`, options)
await installDependency(frameworkDependencies[framework], options)

return framework
}
4 changes: 2 additions & 2 deletions npm/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "Browser-based Component Testing for Vue.js with Cypress.io ✌️🌲",
"main": "dist/cypress-vue.cjs.js",
"scripts": {
"build": "rimraf dist && rollup -c rollup.config.js",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"cy:open": "node ../../scripts/cypress.js open --component --project ${PWD}",
"cy:run": "node ../../scripts/cypress.js run --component --project ${PWD}",
"build": "rimraf dist && rollup -c rollup.config.js",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"typecheck": "vue-tsc --noEmit",
"test": "yarn cy:run",
"watch": "yarn build --watch --watch.exclude ./dist/**/*",
Expand Down
17 changes: 17 additions & 0 deletions npm/vue2/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"plugins": [
"cypress"
],
"extends": [
"plugin:@cypress/dev/tests"
],
"env": {
"cypress/globals": true
},
"rules": {
"mocha/no-global-tests": "off",
"no-unused-vars": "off",
"no-console": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
4 changes: 4 additions & 0 deletions npm/vue2/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
registry=http://registry.npmjs.org/
save-exact=true
progress=false
package-lock=true
7 changes: 7 additions & 0 deletions npm/vue2/.releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
...require('../../.releaserc.base'),
branches: [
// this one releases v3 on master on the latest channel
'master',
],
}
5 changes: 5 additions & 0 deletions npm/vue2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @cypress/vue2-v1.0.0 (2021-06-17)

### Features

* Split out as separate package from `@cypress/vue`, based on the `npm/vue/v2` branch.
Loading