Skip to content

Commit f26dd2a

Browse files
committed
first beta considered working
1 parent d764dbe commit f26dd2a

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"lint-staged": "^6.0.1",
4141
"memfs": "^2.6.0",
4242
"mocha-webpack": "^1.1.0",
43+
"rimraf":"^2.6.2",
4344
"ts-jest": "^22.4.2",
4445
"vue": "^2.5.16",
4546
"vue-property-decorator": "^6.0.0",

packages/core/__tests__/invoke.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const create = require('@vue/cli-test-utils/createTestProject')
44
const path = require('path')
55
const cwd = path.resolve(__dirname, '../../../test')
66

7-
async function createAndInstall(name, options) {
7+
async function createAndInstall (name, options) {
88
const project = await create(
99
name,
1010
{
@@ -29,7 +29,7 @@ describe('invoke', () => {
2929
expect(JSON.parse(await project.read('tsconfig.json')).include).toBeUndefined()
3030
})
3131

32-
xtest('HelloWorld.vue should become HelloWorld/index.ts', async () => {
32+
test('HelloWorld.vue should become HelloWorld/index.ts', async () => {
3333
const project = await createAndInstall(`invoke-vuefile`, {})
3434
expect(project.has('src/components/HelloWorld.vue')).toBe(true)
3535
await project.run(`${require.resolve('@vue/cli/bin/vue')} invoke vue-cli-plugin-template-loader`)

packages/core/generator/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const extractParts = require('../lib/sfcSplitter')
2+
const path = require('path')
3+
const rimraf = require('rimraf')
24

35
module.exports = api => {
46
// transform .vue files into a folder with the same name containing
@@ -51,6 +53,9 @@ module.exports = api => {
5153
}
5254
}
5355
})
54-
56+
const pathSource = path.resolve('./src')
57+
rimraf.sync(pathSource)
58+
const testsSource = path.resolve('./tests/unit')
59+
rimraf.sync(testsSource)
5560
api.render('./template')
5661
}

packages/core/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-cli-plugin-template-loader",
3-
"version": "0.5.1",
3+
"version": "1.0.0",
44
"description": "vue-template-loader plugin for @vue/cli 3.0",
55
"main": "index.js",
66
"repository": {
@@ -25,6 +25,7 @@
2525
"access": "public"
2626
},
2727
"dependencies": {
28-
"vue-template-loader": "^0.3.0"
28+
"vue-template-loader": "^0.3.0",
29+
"rimraf": "^2.6.2"
2930
}
3031
}

0 commit comments

Comments
 (0)