Skip to content

Commit c48b8f9

Browse files
committed
feat: migrate from nuxt-template-ts
1 parent 5dd4d23 commit c48b8f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2779
-33
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
API_URL=

.nuxtignore

Whitespace-only changes.

.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierrc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
arrowParens: 'always',
3+
bracketSpacing: true,
4+
endOfLine: 'lf',
5+
htmlWhitespaceSensitivity: 'strict',
6+
jsxBracketSameLine: false,
7+
jsxSingleQuote: true,
8+
printWidth: 80,
9+
proseWrap: 'never',
10+
quoteProps: 'as-needed',
11+
semi: false,
12+
singleQuote: true,
13+
tabWidth: 2,
14+
trailingComma: 'es5',
15+
useTabs: false,
16+
vueIndentScriptAndStyle: false,
17+
}

.stylelintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*.min.css
2+
**/static

_start.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// From vue-enterprise-template
2+
// See repo: https://github.com/chrisvfritz/vue-enterprise-boilerplate
3+
require('./aliases.config.js');

aliases.config.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// From vue-enterprise-template
2+
// See repo: https://github.com/chrisvfritz/vue-enterprise-boilerplate
3+
const path = require('path');
4+
const fs = require('fs');
5+
const prettier = require('prettier');
6+
7+
const aliases = {
8+
'@': '.',
9+
'~': '.',
10+
'@@': '.',
11+
'~~': '.',
12+
'@core': './core',
13+
'@services': './services',
14+
'@components': './components',
15+
'@constants': './constants',
16+
'@store': './store',
17+
'@apis': './core/apis',
18+
'@mixins': './core/mixins',
19+
'@utils': './core/utils',
20+
};
21+
22+
module.exports = {
23+
webpack: {},
24+
jsconfig: {},
25+
};
26+
27+
for (const alias in aliases) {
28+
const aliasTo = aliases[alias];
29+
module.exports.webpack[alias] = resolveSrc(aliasTo);
30+
module.exports.jsconfig[alias + '/*'] = [aliasTo + '/*'];
31+
module.exports.jsconfig[alias] = aliasTo.includes('/index.')
32+
? [aliasTo]
33+
: [
34+
aliasTo + '/index.js',
35+
aliasTo + '/index.json',
36+
aliasTo + '/index.vue',
37+
aliasTo + '/index.scss',
38+
aliasTo + '/index.css',
39+
];
40+
}
41+
42+
const jsconfigTemplate = require('./jsconfig.template');
43+
const jsconfigPath = path.resolve(__dirname, 'jsconfig.json');
44+
45+
function writeConfigFile(configPath, configTemplate, configFileName) {
46+
fs.writeFile(
47+
configPath,
48+
prettier.format(
49+
JSON.stringify({
50+
...configTemplate,
51+
compilerOptions: {
52+
...(configTemplate.compilerOptions || {}),
53+
paths: module.exports[configFileName],
54+
},
55+
}),
56+
{
57+
...require('./.prettierrc'),
58+
parser: 'json',
59+
},
60+
),
61+
(error) => {
62+
if (error) {
63+
// eslint-disable-next-line no-console
64+
console.error('Error while creating tsconfig.json from aliases.config.js.');
65+
throw error;
66+
}
67+
},
68+
);
69+
}
70+
71+
writeConfigFile(jsconfigPath, jsconfigTemplate, 'jsconfig');
72+
73+
function resolveSrc(_path) {
74+
return path.resolve(__dirname, _path);
75+
}

app.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html {{ HTML_ATTRS }}>
3+
<head>
4+
{{ HEAD }}
5+
</head>
6+
<body {{ BODY_ATTRS }}>
7+
{{ APP }}
8+
</body>
9+
</html>

components/base/ExampleBase.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div>A base component sample</div>
3+
</template>
4+
5+
<script>
6+
import { defineComponent } from '@nuxtjs/composition-api';
7+
8+
export default defineComponent({
9+
name: '',
10+
props: {},
11+
setup() {},
12+
});
13+
</script>
File renamed without changes.

0 commit comments

Comments
 (0)