]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
ci: fix testing failures caused by node_module
authorHaoqun Jiang <haoqunjiang@gmail.com>
Sun, 26 Dec 2021 05:03:29 +0000 (13:03 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Sun, 26 Dec 2021 05:03:29 +0000 (13:03 +0800)
18 files changed:
.github/workflows/ci.yml
playground/jsx-pinia-with-tests/cypress/plugins/index.js
playground/jsx-router-pinia-with-tests/cypress/plugins/index.js
playground/jsx-router-with-tests/cypress/plugins/index.js
playground/jsx-with-tests/cypress/plugins/index.js
playground/pinia-with-tests/cypress/plugins/index.js
playground/router-pinia-with-tests/cypress/plugins/index.js
playground/router-with-tests/cypress/plugins/index.js
playground/typescript-jsx-pinia-with-tests/cypress/plugins/index.ts
playground/typescript-jsx-router-pinia-with-tests/cypress/plugins/index.ts
playground/typescript-jsx-router-with-tests/cypress/plugins/index.ts
playground/typescript-jsx-with-tests/cypress/plugins/index.ts
playground/typescript-pinia-with-tests/cypress/plugins/index.ts
playground/typescript-router-pinia-with-tests/cypress/plugins/index.ts
playground/typescript-router-with-tests/cypress/plugins/index.ts
playground/typescript-with-tests/cypress/plugins/index.ts
playground/with-tests/cypress/plugins/index.js
utils/renderTemplate.js

index 7981ee2dab52420909e531fa7f05558dab6231fc..5d9bdcb6de201f31d354fdbb1bf8f96014439e1f 100644 (file)
@@ -36,4 +36,6 @@ jobs:
           cache: 'pnpm'
       - run: pnpm install
       - run: pnpm pretest
+      # Rerun install to ensure the dependencies in the playground apps are resolved correctly
+      - run: pnpm install
       - run: pnpm test
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..640496bae05172aee2a78bca9210714587658378 100644 (file)
@@ -1,8 +1,8 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
+/// <reference types="node" />
 /// <reference types="cypress" />
 // ***********************************************************
-// This example plugins/index.js can be used to load plugins
+// This example plugins/index.ts can be used to load plugins
 //
 // You can change the location of this file or turn off loading
 // the plugins file with the 'pluginsFile' configuration option.
 // This function is called when a project is opened or re-opened (e.g. due to
 // the project's config changing)
 
-const { startDevServer } = require('@cypress/vite-dev-server')
+import { startDevServer } from '@cypress/vite-dev-server'
 
-/**
- * @type {Cypress.PluginConfig}
- */
-// eslint-disable-next-line no-unused-vars
-module.exports = (on, config) => {
+export default ((on, config) => {
   // `on` is used to hook into various events Cypress emits
   // `config` is the resolved Cypress config
   on('dev-server:start', (options) => {
     return startDevServer({ options })
   })
   return config
-}
+}) as Cypress.PluginConfig
index 932b68e3710623aaa66a72199aabc3d9e61fe8da..db04a79b144a296fc35399b9fa3fc083e3e5c57f 100644 (file)
@@ -1,5 +1,4 @@
 /* eslint-env node */
-/* eslint-disable @typescript-eslint/no-var-requires */
 /// <reference types="cypress" />
 // ***********************************************************
 // This example plugins/index.js can be used to load plugins
index 3423f3a1954fbb64a03eab4d4f7c9c67fdb1c6b8..9d7c7070c4db6346bfd514b1f30ca646dbaaf5e0 100644 (file)
@@ -17,6 +17,11 @@ function renderTemplate(src, dest) {
   const stats = fs.statSync(src)
 
   if (stats.isDirectory()) {
+    // skip node_module
+    if (path.basename(src) === 'node_modules') {
+      return
+    }
+
     // if it's a directory, render its subdirectories and files recursively
     fs.mkdirSync(dest, { recursive: true })
     for (const file of fs.readdirSync(src)) {