text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|><|fim_prefix|>module.exports = {
presets: [`<|fim_middle|>@vue/app`]
}
<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = {
presets: ['@<|fim_suffix|>el/preset']
}
<|fim_middle|>vue/cli-plugin-bab<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>g')
defineTest(__dirname, 'usePluginPreset', null, 'require')
defineTest(__dirname, 'usePluginPreset', null, 'templateLiteral')
<|fim_prefix|>jest.autoMockOff()
const { defineTest } = require('jscodeshift/dist/testUtils')
defineTest(__dirname, 'usePluginPrese<|fim_middle|>t', null, 'default')
defineTest... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>rals
.find(j.TemplateElement, {
value: {
cooked: '@vue/app'
}
})
.closest(j.TemplateLiteral)
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
templateLiterals
.find(j.TemplateElement, {
value: {
cooked: '@vue/babel-preset-app'
}
... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = api => {
// Most likely you want to overwrite the whole config to ensure it's working
// without conflicts, e.g. for a project that used Jest without Babel.
// It should be rare for the user to have their own special babel config
// without using the Babel plugin already.
delete... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const path = require('path')
const babel = require('@babel/core')
const { isWindows } = require('@vue/cli-shared-utils')
function getDepPathRegex (dependencies) {
const deps = dependencies.map(dep => {
if (typeof dep === 'string') {
const depPath = path.join('node_modules', dep, '/')
re... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>may have been changed.
For more complete changelog, see https://github.com/zloirock/core-js/blob/master/CHANGELOG.md#300---20190319`)
}
}
<|fim_prefix|>const { chalk } = require('@vue/cli-shared-utils')
module.exports = api => {
api.transformScript(
'babel.config.js',
<|fim_middle|> require('.... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>rts = require('@vue/babel-preset-app')
<|fim_prefix|>mo<|fim_middle|>dule.expo<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000)
const create = require('@vue/cli-test-utils/createTestProject')
test('should work', async () => {
const project = await create('e2e-cypress', {
plugins: {
'@vue/cli-plugin-babel': {},
'@vue/cli-pl<|fim_suffix|>const config = JSON.p... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = api => {
api.render('./template', {
hasTS: api.hasPlugin('typescript'),
hasESLint: api.hasPlugin('eslint')
})
api.extendPackage(<|fim_suffix|>).devDependencies.cypress
},
scripts: {
'test:e2e': 'vue-cli-service test:e2e'
}
})
}
<|fim_middle|>{
devDep... | fim | vuejs/vue-cli | javascript |
<%_ if (hasESLint) { _%>
module.exports = {
plugins: [
'cypress'
],
env: {
mocha: true,
'cypress/globals': true
},
rules: {
strict: 'off'
}
}
<%_ } _%>
<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>ions: require('@vue/cli-service/webpack.config'),
// watchOptions: {}
// }))
return Object.assign({}, config, {
fixturesFolder: 'tests/e2e/fixtures',
integrationFolder: 'tests/e2e/specs',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
supportFile:... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>h1', 'Welcome to Your Vue.js <%- hasTS ? '+ TypeScript ' : '' %>App')
})
})
<|fim_prefix|>// https://docs.cypress.io/api/table-of-contents
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
<|fim_middle|> cy.contains('<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing<|fim_suffix|>subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subje... | fim | vuejs/vue-cli | javascript |
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// au... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>s a specific spec file. defaults to "all"'
},
details:
`All Cypress CLI options are also supported:\n` +
chalk.yellow(`https://docs.cypress.io/guides/guides/command-line.html#cypress-run`)
}, async (args, rawArgs) => {
removeArg(rawArgs, 'mode')
removeArg(rawArgs, 'url')
... | fim | vuejs/vue-cli | javascript |
module.exports = api => {
api.extendPackage(pkg => {
const allDeps = {
...pkg.dependencies,
...pkg.devDependencies,
...pkg.optionalDependencies
}
if (!allDeps.cypress) {
return {
devDependencies: {
cypress: require('../package.json').devDependencies.cypress
... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = api => {
api.describeTask({
match: /vue-cli-service test:e2e/,
description: 'org.vue.cypress.tasks.test.description',
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-cypress#injected-commands',
prompts: [
{
name: 'headless',
... | fim | vuejs/vue-cli | javascript |
/**
* This file is copied during the firefox test inside the project folder and used to inspect the results
*/
const fs = require('fs')
module.exports = {
reporter (results, cb) {
fs.writeFile('test_results_gecko.json', JSON.stringify(results), cb)
}
}
<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>/**
* This file is copied during the test inside the project folder<|fim_suffix|>rowser, cb) {
fs.writeFile('test_settings.json', JSON.stringify(browser.options), cb)
},
reporter (results, cb) {
fs.writeFile('test_results.json', JSON.stringify(results), cb)
}
}
<|fim_middle|> and used to i... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>/**
* This file is copied during t<|fim_suffix|>ath: './tests/e2e/globals-gecko.js'
}
<|fim_middle|>he test inside the project folder
*/
module.exports = {
globals_p<|endoftext|> | fim | vuejs/vue-cli | javascript |
jest.setTimeout(process.env.APPVEYOR ? 300000 : 120000)
const fs = require('fs-extra')
const path = require('path')
const create = require('@vue/cli-test-utils/createTestProject')
const createServer = require('@vue/cli-test-utils/createServer')
describe('nightwatch e2e plugin', () => {
let project
beforeAll(asyn... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const { installedBrowsers } = require('@vue/cli-shared-utils')
module.exports = (api, { webdrivers }) => {
api.render('./template', {
hasTS: api.hasPlugin('typescript'),
hasESLint: api.hasPlugin('eslint')
})
const devDependencies = {}
// Use devDependencies to store latest version numbe... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|><%_ if (hasESLint) { _%>
module.exports = {
rules: {
<%_ if (hasTS) { _%>
'@typescript-eslint/no-var-requires': 'off',
<%_ } _%>
'no-unused-expressions': 'off'
<|fim_suffix|>%_ } _%>
<|fim_middle|>}
}
<<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>/**
* A custom Nightwatch assertion. The assertion name is the filename.
*
* Example usage:
* browser.assert.elementCount(selector, count)
*
* For more information on custom assertions see:
* https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-assertions
*
*
* @param {string|... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>
return this
}
<|fim_prefix|>/**
* A very basic Nightwatch custom command. The command name is the filename and the
* exported "command" function is the command.
*
* Example usage:
* browser.customExecute(function() {
* console.log('Hello from the browser window')
* });
*
* For more i... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>/**
* A basic Nightwatch custom command
* which demonstrates usage of ES6 async/await instead of using callbacks.
* The command name is the filename and the exported "command" function is the command.
*
* Example usage:
* browser.openHomepage();
*
* For more information on writing custom comma... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>/**
* A class-based Nightwatch custom command which is a variation of the openHomepage.js command.
* The command name is the filename and class needs to contain a "command" method.
*
* Example usage:
* browser.openHomepageClass();
*
* For more information on w<|fim_suffix|>htwatchjs.org/guide/ex... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>/////////////////////////////////////////<|fim_suffix|>obal afterEach')
cb();
});
},
*/
/**
* executed after the test run has finished
*/
/*
after(cb) {
//console.log('global after')
cb();
},
*/
/////////////////////////////////////////////////////////////////
/... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>
}
}
<|fim_prefix|>/**
* A Nightwatch page object. The page object name is the fil<|fim_middle|>ename.
*
* Example usage:
* browser.page.homepage.navigate()
*
* For more information on working with page objects see:
* https://nightwatchjs.org/guide/working-with-page-objects/
*
*/
module.ex... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>////////////////////////////////////////////////////////////////
// For authoring Nightwatch tests, see
// https://nightwatchjs.org/guide
//
// For more information on working with page objects see:
// https://nightwatchjs.org/guide/working-with-page-objects/
////////////////////////////////////////////... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>// For aut<|fim_suffix|> 1)
.end()
},
'example e2e test using a custom command': browser => {
browser
.openHomepage()
.assert.elementPresent('.hello')
.end()
}
}
<|fim_middle|>horing Nightwatch tests, see
// https://nightwatchjs.org/guide
module.exports = {
'default e... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>))
if (i > -1) {
rawArgs.splice(i, offset + (equalRE.test(rawArgs[i]) ? 0 : 1))
}
}
<|fim_prefix|>const fs = require('fs')
const { installedBrowsers, info, warn, error, chalk, execa } = require('@vue/cli-shared-utils')
module.exports = (api, options) => {
api.registerCommand('test:e2e', {
d... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>ties: {
browserName: 'firefox'
}
},
/// ///////////////////////////////////////////////////////////////////////////////
// Configuration for when using the Selenium service, either locally or remote, |
// like Selenium Grid ... | fim | vuejs/vue-cli | javascript |
const { installedBrowsers } = require('@vue/cli-shared-utils')
module.exports = [
{
name: 'webdrivers',
type: `checkbox`,
message: `Pick browsers to run end-to-end test on`,
choices: [
{
name: `Chrome`,
value: 'chrome',
checked: true
},
{
name: 'Firef... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>--env', answers.env)
}
})
}
<|fim_prefix|>module.exports = api => {
api.describeTask({
match: /vue-cli-service test<|fim_middle|>:e2e/,
description: 'org.vue.nightwatch.tasks.test.description',
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-nightwatch#i... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000)
const create = require('@vue/cli-test-utils/createTestProject')
test('should add types to existing tsconfig.json', async () => {
const { dir, read, write } = await create('e2e-webdriverio-tsconfig', {
plugins: {
'@vue/cli-plugin-typescri... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(process.env.APPVEYOR ? 120000 : 60000)
const create = require('@vue/cli-test-utils/createTestProject')
test('should work', async () => {
const project = await create('e2e-webdriverio', {
plugins: {
'@vue/cli-plugin-babel': {},
'@vue/cli-plugin-e2e-webdriverio': {
... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>i.hasPlugin('typescript')) {
applyTS(api, invoking)
}
}
<|fim_prefix|>const { installedBrowsers } = require('@vue/cli-shared-utils')
const applyTS = module.exports.applyTS = (api, invoking) => {
api.extendPackage({
devDependencies: {
'@types/mocha': require('../package.json').dependenci... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>
}
<%_ } _%>
<|fim_prefix|><%_ if (hasESLint) { _%>
module.exports = {
plugins: ['wdio'],
extends: 'plugin:wdio/recommended',
env: {
mocha: true
},
rules: {
'class-methods-use-this': 'off',
<|fim_middle|> 'max-len': 'off',
strict: 'off'
}<|endoftext|> | fim | vuejs/vue-cli | javascript |
class App {
/**
* elements
*/
get heading () { return $('h1') }
/**
* methods
*/
async open (path = '/') {
await browser.url(path)
}
}
<%- hasTS ? 'export default new App()' : 'module.exports = new App()' %>
<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|><%- hasTS ? 'import App from \'../pageobjects/app.page\'' : 'const App = require(\'../pageobjects/app.page\')' %>
describe('Vue.js app', () => {
it('should open and render', async () => {
await App.open()
await expect(App.heading).toHaveText('Welcome to Your V<|fim_suffix|> ' : '' %>App')
})
... | fim | vuejs/vue-cli | javascript |
<%- hasTS ? 'const { config } = require(\'./wdio.shared.conf.ts\')' : 'const { config } = require(\'./wdio.shared.conf\')' %>
exports.config = {
/**
* base config
*/
...config,
/**
* config for local testing
*/
maxInstances: 1,
services: [<%- options.webdrivers.includes('chrome') ?(options.webdri... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|><%- hasTS ? 'import { config } from \'./wdio.shared.conf.ts\'' : 'const { config } = require(\'./wdio.shared.conf\')' %>
const BUILD_ID = Math.ceil(Date.now() / 1000)
exports.config = {
/**
* base config
*/
...config,
/**
* config for testing on Sauce Labs
*/
user: process.env.SAUCE_... | fim | vuejs/vue-cli | javascript |
/* eslint-disable no-unused-vars, max-len */
const path = require('path')
exports.config = {
// ==================
// Specify Test Files
// ==================
// Define which test specs should run. The pattern is relative to the directory
// from which `wdio` was called. Notice that, if you are calling `wdio... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>}`)
}
const isTS = fs.existsSync(path.join(api.getCwd(), 'tsconfig.json'))
const configFile = !args.remote
? path.join(api.getCwd(), 'wdio.local.conf.' + (isTS ? 'ts' : 'js'))
: path.join(api.getCwd(), 'wdio.sauce.conf.' + (isTS ? 'ts' : 'js'))
const wdioBinPath = ... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = (api) => {
if (api.fromVersion('<= 5.0.0-alpha.4')) {
api.render((files) => {
if (!files['tsconfig.json']) {
return
}
files['tsconfig.json'] = files['tsconfig.json'].replace(
'"@wdio/sync"',
'"webdriverio/sync"'
)
if (!/"expect-... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const { installedBrowsers } = require('@vue/cli-shared-utils')
module.exports = [
{
name: 'webdrivers',
type: `checkbox`,
message: `Pick browsers to run end-to-end test on`,
choices: [
<|fim_suffix|> 'chrome',
checked: true
},
{
name: 'Firefox',
... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = api => {
api.describeTask<|fim_suffix|>js/vue-cli',
prompts: [],
onBeforeRun: () => {}
})
}
<|fim_middle|>({
match: /vue-cli-service test:e2e/,
description: 'org.vue.webdriverio.tasks.test.description',
link: 'https://github.com/vue<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(300000)
const createOutside = require('@vue/cli-test-utils/createUpgradableProject')
// This test must be run in the E2E environment (with a local registry).
// Because the installation of ESLint v8 will break the test environment of the project
test(`should work with eslint v8`, async (... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(35000)
const generateWithPlugin = require('@vue/cli-test-utils/generateWithPlugin')
const create = require('@vue/cli-test-utils/createTestProject')
test('base', async () => {
const { pkg } = await generateWithPlugin({
id: 'eslint',
apply: require('../generator'),
options: {... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>@vue/cli-plugin-babel': {
version: '3.12.1',
config: 'airbnb'
}
}
})
const pkg = JSON.parse(await project.read('package.json'))
pkg.devDependencies['@babel/core'] = localBabelCoreVersion
await project.write('package.json', JSON.stringify(pkg, null, 2))
await project.u... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>cli-service serve')
server.stdout.on('data', data => {
data = data.toString()
if (data.match(/Compiled successfully/)) {
server.stdin.write('close')
done()
}
})
await donePromise
expect(has('node_modules/.cache/eslint/cache.json')).toBe(true)
})
test.skip(`should use fo... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>ome to Your Vue.js App"/>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'App',
components: {
HelloWorld
}
}
</script>
`)
await run('vue-cli-service lint')
})
<|fim_prefix|>jest.setTimeout(300000)
const generateWithPlugin = require('@vue/cl... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>on: 'Lorem description',
url: 'http://test.com/lorem'
}
}
},
'ipsum': {
meta: {
docs: {
category: 'recommended',
description: 'Ipsum description',
url: 'http://test.com/ipsum'
}
}
},
'dolor': {
meta: {
... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const DEPS_MAP = {
base: {
eslint: '^7.32.0',
'eslint-plugin-vue': '^8.0.3'
},
airbnb: {
'@vue/eslint-config-airbnb': '^6.0.0',
'eslint-plugin-import': '^2.25.3',
'eslint-plugin-vuejs-accessibility': '^1.1.0'
},
<|fim_suffix|>
})
}
return deps
}
<|fim_middle|> prettie... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|> stringification
// output when extracting configs into standalone files
function makeJSOnlyValue (str) {
const fn = () => {}
fn.__expression = str
return fn
}
const baseExtensions = ['.js', '.jsx', '.vue']
exports.extensions = api => api.hasPlugin('typescript')
? baseExtensions.concat('.ts', '.t... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const fs = require('fs')
const path = require('path')
module.exports = (api, { config, lintOn = [] },<|fim_suffix|>h, 'utf-8')
files['.editorconfig'] += `\n${editorconfig}`
})
} else {
api.render(`./template/${config}`)
}
}
if (typeof lintOn === 'string') {
lintOn = l... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const path = require('path')
const eslintWebpackPlugin = require('eslint-webpack-plugin')
/** @type {import('@vue/cli-service').ServicePlugin} */
module.exports = (api, options) => {
if (options.lintOnSave) {
const extensions = require('./eslintOptions').extensions(api)
// Use loadModule to all... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|> applyConfig(renamedArgs[key], args[key])
} else if (key !== '_') {
config[camelize(key)] = args[key]
}
}
return config
function applyConfig ([...keyPaths], value) {
let targetConfig = config
const lastKey = keyPaths.pop()
for (const k of keyPaths) {
targetConfig = t... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|> getDeps(api, 'prettier'))
}
const fields = { devDependencies: newDeps }
if (newDeps['@babel/core'] && newDeps['@babel/eslint-parser']) {
Reflect.deleteProperty(api.generator.pkg.devDependencies, 'babel-eslint')
const minSupportedBabelCoreVersion = '>=7.2.0'
const localBabelCoreVersio... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>// these prompts are used if the plugin is late-installed into an existing
// project and invoked by `vue invoke`.
const { chalk, hasGit } = require('@vue/cli-shared-utils')
module.exports = [
{
name: 'config',
type: 'list',
message: `Pick an ESLint config:`,
choices: [
{
... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>.config.eslint.rules.label',
prompts: getEslintPrompts(data, rules)
}
]
}
}
async function onWrite ({ data, api, prompts }) {
const eslintData = { ...data.eslint }
const vueData = {}
for (const prompt of prompts) {
// eslintrc
if (prompt.id === 'config') {
if (esli... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const configDescriptor = require('./configDescriptor')
const taskDescriptor = require('./taskDescriptor')
const CONFIG = 'org.vue.eslintrc'
const OPEN_ESLINTRC = 'org.vue.esli<|fim_suffix|>
label: 'org.vue.eslint.suggestions.open-eslintrc.label',
handler () {
const file = config... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|> if (answers.noFix) args.push('--no-fix')
}
}
module.exports = {
task
}
<|fim_prefix|>const task = {
match: /vue-cli-service lint/,
description: 'org.vue.eslint.tasks.lint.description',
link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint#injected-commands',
pr... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const generateWithPlugin = require('@vue/cli-test-utils/generateWit<|fim_suffix|>= await generateWithPlugin([
{
id: 'core',
apply: require('@vue/cli-service/generator'),
options: {}
},
{
id: 'typescript',
apply: require('@vue/cli-plugin-typescript/generator'),
... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>served from cache by a service worker/))).toBe(true)
})
afterAll(async () => {
if (browser) {
await browser.close()
}
if (server) {
server.close()
}
})
<|fim_prefix|>jest.setTimeout(50000)
const path = require('path')
const portfinder = require('portfinder')
const createServer = require(... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>e */
const convertFiles = require('@vue/cli-plugin-typescript/generator/convert')
convertFiles(api)
}
}
<|fim_prefix|>module.exports = api => {
api.extendPackage({
dependencies: <|fim_middle|>{
'register-service-worker': '^1.7.2'
}
})
api.injectImports(api.entryFile, `import ... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>updatefound () {
console.log('New content is downloading.')
},
updated () {
console.log('New content is available; please refresh.')
},
offline () {
console.log('No internet connection found. App is running in offline mode.')
},
error (error) {
console.error... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>
? { cacheId: name }
: {}
const workBoxConfig = Object.assign(defaultOptions, defaultGenerateSWOptions, userOptions.workboxOptions)
webpackConfig
.plugin('workbox')
.use(workboxWebpackModule[workboxPluginMode], [workBoxConfig])
}
})
// install dev ser... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>'PROCESS_ASSETS_STAGE_ADDITIONS' },
assets => { assets[manifestPath] = manifestAsset }
)
})
}
}
}
function makeTag (tagName, attributes, voidTag = true) {
return {
tagName,
voidTag,
attributes
}
}
function getTagHref (publicPath, href, assetsVersionStr) {
... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>refresh, so that they have a chance to load the
// fresh navigation response from the local dev server.
windowClient.navigate(windowClient.url)
}
})
})
<|fim_prefix|>/* eslint-disable-next-line no-redeclare */
/* global self */<|fim_middle|>
// This service worker file is effectively a ... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>dule.exports = function createNoopServiceWorkerMiddleware () {
return function noopServiceWorkerMiddleware (req, res, next) {
if (req.url === '/service-worker.js') {
res.setHeader('Content-Type', 'text/javascript')
res.send(resetScript)
} else {
next()
}
}
}
<|fim_prefix|... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>e)
return {
keep: true
}
}
})
} else {
api.removeSuggestion(OPEN_VUE)
}
if (config.foundFiles.manifest) {
api.addSuggestion({
id: OPEN_MANIFEST,
type: 'action',
label: 'org.vue.pwa.sugge... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>)
})
test('use with Vue 3', async () => {
const { files, pkg } = await generateWithPlugin([
{
id: '@vue/cli-service',
apply: require('@vue/cli-service/generator'),
options: {
vueVersion: '3'
}
},
{
id: '@vue/cli-plugin-router',
apply: require('../... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = (api, options = {}, rootOptions = {}) => {
const isVue3 = (rootOptions.vueVersion === '3')
api.injectImports(api.entryFile, `import router from './router'`)
if (isVue3) {
api.transformScript(api.entryFile, require('./injectUseRouter'))
api.extendPackage({
dependencie... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.ex<|fim_suffix|>ession(
j.memberExpression(createAppCall, j.identifier('use')),
[j.identifier('router')]
)
})
return root.toSource()
}
<|fim_middle|>ports = (file, api) => {
const j = api.jscodeshift
const root = j(file.source)
const appRoots = root.find(j.CallExpression... | fim | vuejs/vue-cli | javascript |
import Vue from 'vue'
<%_ if (hasTypeScript) { _%>
import VueRouter, { RouteConfig } from 'vue-router'
<%_ } else { _%>
import VueRouter from 'vue-router'
<%_ } _%>
import HomeView from '../views/HomeView.vue'
Vue.use(VueRouter)
<%_ if (hasTypeScript) { _%>
const routes: Array<RouteConfig> = [
<%_ } else { _%>
const ... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|> default router
<|fim_prefix|>import { createRouter<%
if (historyMode) {
%>, createWebHistory<%
} else {
%>, createWebHashHistory<%
}
if (hasTypeScript) {
%>, RouteRecordRaw<%
}
%> } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const routes<% if (hasTypeScript) ... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>module.exports = (api, options<|fim_suffix|> => {}
<|fim_middle|> = {})<|endoftext|> | fim | vuejs/vue-cli | javascript |
// these prompts are used if the plugin is late-installed into an existing
// project and invoked by `vue invoke`.
const { chalk } = require('@vue/cli-shared-utils')
module.exports = [
{
name: 'historyMode',
type: 'confirm',
message: `Use history mode for router? ${chalk.yellow(`(Requires proper server ... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const generateWith<|fim_suffix|>/cli-plugin-router': {},
'@vue/cli-plugin-typescript': {}
}
}
},
{
id: '@vue/cli-plugin-typescript',
apply: tsApply,
options: {}
},
{
id: '@vue/cli-plugin-router',
apply: require('@vue/cli-plugin-router/g... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>ct.run(`vue-cli-service test:unit`)
})
<|fim_prefix|>jest.setTimeout(300000)
const create = require('@vue/cli-test-utils/create<|fim_middle|>UpgradableProject')
test('mocha', async () => {
const project = await create('ts-unit-mocha', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>)
const launched = await launchPuppeteer(`http://localhost:${port}/`)
browser = launched.browser
page = launched.page
const h1Text = await page.evaluate(() => {
return document.querySelector('h1').textContent
})
expect(h1Text).toMatch('Welcome to Your Vue.js + TypeScript A... | fim | vuejs/vue-cli | javascript |
jest.setTimeout(30000)
const Service = require('@vue/cli-service/lib/Service')
const create = require('@vue/cli-test-utils/createTestProject')
const { assertServe, assertBuild } = require('./tsPlugin.helper')
test('using correct loader', async () => {
const service = new Service('/', {
pkg: {},
plugins: [
... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>'ts-class-serve', options)
assertBuild('ts-class-build', options, async (project) => {
const app = await project.read('src/App.vue')
expect(app).toMatch(`export default class App extends Vue {`)
})
<|fim_prefix|>j<|fim_middle|>est.setTimeout(30000)
const { assertServe, assertBuild } = require('./tsPl... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(30000)
const { assertServe, assertBuild } = require('./tsPlugin.helper')
const options = {
plugins: {
<|fim_suffix|>
assertServe('ts-default-serve', options)
assertBuild('ts-default-build', options)
<|fim_middle|> '@vue/cli-plugin-typescript': {}
}
}
<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(process.env.APPVE<|fim_suffix|>= await create('ts-e2e-nightwatch', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cli-plugin-e2e-nightwatch': {}
}
})
await project.run(`vue-cli-service test:e2e`)
})
}
<|fim_middle|>YOR ? 850000 : 50000)
const cr... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeou<|fim_suffix|>ons
const updatedMain = main.replace(/;/g, '')
await write('src/main.ts', updatedMain)
// for Vue file, only remove semis in script section
const updatedApp = app.replace(/<script(.|\n)*\/script>/, $ => {
return $.replace(/;/g, '')
})
await write('src/App.vue', ... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(40000)
const create = require('@vue/cli-test-utils/createTestProject')
test('jest', async () => {
const project = await create('ts<|fim_suffix|>l', async () => {
const project = await create('ts-unit-jest-babel', {
plugins: {
'@vue/cli-plugin-typescript': {},
'@vue/cl... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>jest.setTimeout(300000)
const { assertServe, assertBuild } = require('./tsPlugin.helper')
const options = {
vueVersion: '3',
plugins: {
'@<|fim_suffix|>e)
<|fim_middle|>vue/cli-plugin-typescript': {}
}
}
assertServe('ts-vue-3-serve', options, true)
assertBuild('ts-vue-3-build', options, undef... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>f defineComponent>;
export default component;
}
<|fim_prefix|>declare m<|fim_middle|>odule '*.vue' {
import { defineComponent } from 'vue';
const component: ReturnType<typeo<|endoftext|> | fim | vuejs/vue-cli | typescript |
<|fim_suffix|> } from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}
<|fim_prefix|>decla<|fim_middle|>re module '*.vue' {
import { DefineComponent<|endoftext|> | fim | vuejs/vue-cli | typescript |
<|fim_suffix|> { parser: 'ts' })
<|fim_prefix|>jest.autoMockOff()
const { defineTest } = require('jscodesh<|fim_middle|>ift/dist/testUtils')
defineTest(__dirname, 'migrateComponentType', null, 'shims-vue',<|endoftext|> | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>// `shims-vue.d.ts` for Vue 3, generated by CLI 4.5.0-4.5.6, uses the following declaration:
// `component: ReturnType<typeof defineComponent>`
// So needs to update to:
// `component: DefineComponent`
module.exports = function migrateComponentType (file, api) {
const j = api.jscodeshift
const root ... | fim | vuejs/vue-cli | javascript |
<|fim_suffix|>]
}
})
}
<|fim_prefix|>module.exports = (api, { convertJsToTs = true } = {}) => {
const jsRE = /\.js$/
let excludeRE = /^tests\/e2e\/|(\.config|rc)\.js$/
if (api.hasPlugin('e2e-webdriverio')) {
excludeRE = /(\.config|rc)\.js$/
}
api.postProcessFiles((files) => {
if (convertJsToTs)... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>const pluginDevDeps = require('../package.json').devDependencies
module.exports = (
api,
{ classComponent, skipLibCheck = true, convertJsToTs, allowJs },
rootOptions,
invoking
) => {
const isVue3 = rootOptions && root<|fim_suffix|>e/no-extraneous-require
require('@vue/cli-plugin-unit-jest... | fim | vuejs/vue-cli | javascript |
<|fim_prefix|>import Vue, { VNode } from 'vue'
declare global {
namespace JSX {
interface Ele<|fim_suffix|> extends Vue {}
interface IntrinsicElements {
[elem: string]: any
}
}
}
<|fim_middle|>ment extends VNode {}
interface ElementClass<|endoftext|> | fim | vuejs/vue-cli | typescript |
<|fim_suffix|>fault Vue
}
<|fim_prefix|>declar<|fim_middle|>e module '*.vue' {
import Vue from 'vue'
export de<|endoftext|> | fim | vuejs/vue-cli | typescript |
<|fim_suffix|> import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
<|fim_prefix|>/* eslint-disable */
declare module '*.<|fim_middle|>vue' {
<|endoftext|> | fim | vuejs/vue-cli | typescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.