Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 2c9e594

Browse files
committed
fix: linting changes
1 parent 38312c7 commit 2c9e594

File tree

11 files changed

+569
-135
lines changed

11 files changed

+569
-135
lines changed

.changeset/ten-eels-film.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'vue-cli-plugin-chakra-ui': minor
3+
'nuxt-js': patch
4+
'@chakra-ui/vue': patch
5+
'@chakra-ui/nuxt': patch
6+
'@chakra-ui/theme-vue': patch
7+
'chakra-ui-docs': patch
8+
---
9+
10+
feat: create version symlinking for vue-cli-plugin-chakra-ui

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ sw.js
55
**/lib/plugin.js
66
**/.nuxt
77
**/coverage
8-
node_modules
8+
node_modules
9+
**/vue-cli-plugin/generator/template

examples/nuxt-js/nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as icons from './utils/icons'
22

33
export default {
4+
ssr: true,
45
// Target: https://go.nuxtjs.dev/config-target
56
target: 'static',
67

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@commitlint/cli": "^8.3.5",
6969
"@commitlint/config-conventional": "^8.3.4",
7070
"@emotion/babel-plugin": "^11.1.2",
71-
"@emotion/css": "^11.1.3",
71+
"@emotion/css": "^11.0.0",
7272
"@emotion/eslint-plugin": "^11.0.0",
7373
"@emotion/jest": "^11.3.0",
7474
"@manypkg/cli": "^0.18.0",
@@ -152,7 +152,7 @@
152152
"mdx-vue": "^1.0.2",
153153
"mdx-vue-loader": "^1.0.2",
154154
"node-fetch": "^2.6.0",
155-
"nuxt": "^2.15.7",
155+
"nuxt": "2.13.3",
156156
"portal-vue": "^2.1.6",
157157
"prettier": "^1.19.1",
158158
"prismjs": "^1.19.0",
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const fs = require('fs');
2-
module.exports = function addChakraLoaderConfig(api) {
3-
let content = "const { ChakraLoaderPlugin } = require('chakra-loader')\n\n";
4-
content += "module.exports = {\n";
5-
content += "\tconfigureWebpack: {\n";
6-
content += "\t\tplugins: [\n";
7-
content += "\t\t\tnew ChakraLoaderPlugin()\n";
8-
content += "\t\t]\n";
9-
content += "\t}\n";
10-
content += "}\n"
11-
fs.appendFileSync("vue.config.js", content);
1+
const fs = require('fs')
2+
module.exports = function addChakraLoaderConfig (api) {
3+
let content = "const { ChakraLoaderPlugin } = require('chakra-loader')\n\n"
4+
content += 'module.exports = {\n'
5+
content += '\tconfigureWebpack: {\n'
6+
content += '\t\tplugins: [\n'
7+
content += '\t\t\tnew ChakraLoaderPlugin()\n'
8+
content += '\t\t]\n'
9+
content += '\t}\n'
10+
content += '}\n'
11+
fs.appendFileSync('vue.config.js', content)
1212

13-
api.exitLog('Auto import setup completed 🔥');
14-
api.exitLog('You can use Chakra UI components without importing and registering them now')
15-
}
13+
api.exitLog('Auto import setup completed 🔥')
14+
api.exitLog('You can use Chakra UI components without importing and registering them now')
15+
}
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
module.exports = function registerChakraVuePlugin(api) {
2-
let vueUseLine = `\n\nVue.use(Chakra)`;
1+
module.exports = function registerChakraVuePlugin (api) {
2+
const vueUseLine = '\n\nVue.use(Chakra)'
33

4-
const fs = require('fs');
4+
const fs = require('fs')
55

6-
let contentMain = fs.readFileSync(api.entryFile, { encoding: 'utf-8' });
6+
let contentMain = fs.readFileSync(api.entryFile, { encoding: 'utf-8' })
77

8-
const lines = contentMain.split(/\r?\n/g).reverse();
8+
const lines = contentMain.split(/\r?\n/g).reverse()
99

10-
const lastImportIndex = lines.findIndex((line) => line.match(/^import/));
10+
// eslint-disable-next-line
11+
const lastImportIndex = lines.findIndex(line => line.match(/^import/))
1112

12-
lines[lastImportIndex] += vueUseLine;
13+
lines[lastImportIndex] += vueUseLine
1314

14-
// modify app
15-
contentMain = lines.reverse().join('\n');
15+
// modify app
16+
contentMain = lines.reverse().join('\n')
1617

17-
fs.writeFileSync(api.entryFile, contentMain, { encoding: 'utf-8' });
18-
}
18+
fs.writeFileSync(api.entryFile, contentMain, { encoding: 'utf-8' })
19+
}
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
const addChakraLoaderConfig = require('./helpers/add-chakra-loader-config');
2-
const registerChakraVuePlugin = require('./helpers/register-chakra-vue-plugin');
31
const chakraPkg = require('@chakra-ui/vue/package.json')
42
const emotionPkg = require('@emotion/css/package.json')
53
const chakraLoaderPkg = require('chakra-loader/package.json')
4+
const registerChakraVuePlugin = require('./helpers/register-chakra-vue-plugin')
5+
const addChakraLoaderConfig = require('./helpers/add-chakra-loader-config')
66

77
module.exports = (api, options) => {
88
api.extendPackage({
99
dependencies: {
1010
'@chakra-ui/vue': `^${chakraPkg.version}`,
11-
'@emotion/css': `^${emotionPkg.version}`,
12-
},
13-
});
11+
'@emotion/css': `^${emotionPkg.version}`
12+
}
13+
})
1414

1515
if (options.addChakraLoader) {
1616
api.extendPackage({
1717
devDependencies: {
18-
'chakra-loader': `^${chakraLoaderPkg.version}`,
19-
},
20-
});
18+
'chakra-loader': `^${chakraLoaderPkg.version}`
19+
}
20+
})
2121
}
2222

23-
api.injectImports(api.entryFile, `import Chakra from '@chakra-ui/vue'`);
23+
api.injectImports(api.entryFile, 'import Chakra from \'@chakra-ui/vue\'')
2424

2525
api.render('./template', {
2626
hasVueRouter: options.hasVueRouter,
27-
hasChakraLoader: options.addChakraLoader,
28-
});
27+
hasChakraLoader: options.addChakraLoader
28+
})
2929
api.onCreateComplete(() => {
30-
registerChakraVuePlugin(api);
30+
registerChakraVuePlugin(api)
3131

3232
if (options.addChakraLoader) {
33-
addChakraLoaderConfig(api);
33+
addChakraLoaderConfig(api)
3434
}
35-
});
35+
})
3636

37-
api.exitLog('Chakra UI Vue is ready');
38-
api.exitLog('Join the community on Discord - https://discord.gg/Tv8Jca');
39-
};
37+
api.exitLog('Chakra UI Vue is ready')
38+
api.exitLog('Join the community on Discord - https://discord.gg/Tv8Jca')
39+
}

packages/vue-cli-plugin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = (api, options) => { }
1+
module.exports = (api, options) => { }

packages/vue-cli-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-cli-plugin-chakra-ui",
33
"version": "1.0.3",
4-
"description": "vue-cli plugin to add Chakra UI Vue",
4+
"description": "Vue CLI plugin to add Chakra UI Vue",
55
"main": "index.js",
66
"scripts": {
77
"test": "null"
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module.exports = [
2-
{
3-
name: 'addChakraLoader',
4-
type: 'confirm',
5-
message: 'Auto import Chakra components?',
6-
description: 'This will allow you to use Chakra components without manually importing and registering them.',
7-
default: false,
8-
validate: input => !!input
9-
},
10-
{
11-
name: 'hasVueRouter',
12-
type: 'confirm',
13-
message: 'Is your project already setup with Vue Router?',
14-
description: 'This will affect how App.vue is setup for you',
15-
default: false,
16-
validate: input => !!input
17-
}
18-
]
2+
{
3+
name: 'addChakraLoader',
4+
type: 'confirm',
5+
message: 'Auto import Chakra components?',
6+
description: 'This will allow you to use Chakra components without manually importing and registering them.',
7+
default: false,
8+
validate: input => !!input
9+
},
10+
{
11+
name: 'hasVueRouter',
12+
type: 'confirm',
13+
message: 'Is your project already setup with Vue Router?',
14+
description: 'This will affect how App.vue is setup for you',
15+
default: false,
16+
validate: input => !!input
17+
}
18+
]

0 commit comments

Comments
 (0)