Skip to content

Commit

Permalink
feat(scripts): defined common nuxt scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Jul 26, 2020
1 parent fd6ab59 commit 64e18f5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/scaffold-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@ suite('scaffold', () => {
test('that nuxt dependencies are defined', async () => {
const projectRoot = any.string();

const {dependencies, devDependencies} = await scaffold({projectRoot});
const {dependencies, devDependencies, scripts} = await scaffold({projectRoot});

assert.calledWith(config.default, {projectRoot});
assert.deepEqual(dependencies, ['nuxt']);
assert.deepEqual(devDependencies, ['@vue/test-utils']);
assert.deepEqual(
scripts,
{
dev: 'nuxt',
build: 'nuxt build',
start: 'nuxt start',
export: 'nuxt export',
serve: 'nuxt serve'
}
);
});
});
7 changes: 7 additions & 0 deletions src/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ export default async function ({projectRoot}) {
await scaffoldConfig({projectRoot});

return {
scripts: {
dev: 'nuxt',
build: 'nuxt build',
start: 'nuxt start',
export: 'nuxt export',
serve: 'nuxt serve'
},
dependencies: ['nuxt'],
devDependencies: ['@vue/test-utils']
};
Expand Down

0 comments on commit 64e18f5

Please sign in to comment.