nuxt-charts 0.1.0-beta.1 → 0.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/dist/module.d.mts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +3 -3
- package/dist/module.mjs +20 -10
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# nuxt-charts
|
|
2
2
|
|
|
3
3
|
[![npm version][npm-version-src]][npm-version-href]
|
|
4
4
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
# npm
|
|
19
|
-
npm install
|
|
19
|
+
npm install nuxt-charts
|
|
20
20
|
|
|
21
21
|
# yarn
|
|
22
|
-
yarn add
|
|
22
|
+
yarn add nuxt-charts
|
|
23
23
|
|
|
24
24
|
# pnpm
|
|
25
|
-
pnpm add
|
|
25
|
+
pnpm add nuxt-charts
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
@@ -32,23 +32,23 @@ Add the module to your Nuxt config:
|
|
|
32
32
|
```ts
|
|
33
33
|
// nuxt.config.ts
|
|
34
34
|
export default defineNuxtConfig({
|
|
35
|
-
modules: [
|
|
36
|
-
|
|
35
|
+
modules: ["nuxt-charts"],
|
|
36
|
+
|
|
37
37
|
// Optional configuration
|
|
38
38
|
vueChrts: {
|
|
39
39
|
// Add prefix to component names (default: 'Chrt')
|
|
40
|
-
prefix:
|
|
41
|
-
|
|
40
|
+
prefix: "Chrt",
|
|
41
|
+
|
|
42
42
|
// Make components globally available (default: true)
|
|
43
43
|
global: true,
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
// Only include specific components (default: all components)
|
|
46
|
-
include: [
|
|
47
|
-
|
|
46
|
+
include: ["AreaChart", "LineChart"],
|
|
47
|
+
|
|
48
48
|
// Enable auto-imports (default: true)
|
|
49
|
-
autoImports: true
|
|
50
|
-
}
|
|
51
|
-
})
|
|
49
|
+
autoImports: true,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Then use the components in your Nuxt application:
|
|
@@ -56,11 +56,11 @@ Then use the components in your Nuxt application:
|
|
|
56
56
|
```vue
|
|
57
57
|
<template>
|
|
58
58
|
<div class="chart-wrapper">
|
|
59
|
-
<ChrtLineChart
|
|
60
|
-
:data="data"
|
|
59
|
+
<ChrtLineChart
|
|
60
|
+
:data="data"
|
|
61
61
|
:height="300"
|
|
62
62
|
:accessor="accessor"
|
|
63
|
-
:x-axis-title="xAxisTitle"
|
|
63
|
+
:x-axis-title="xAxisTitle"
|
|
64
64
|
/>
|
|
65
65
|
</div>
|
|
66
66
|
</template>
|
|
@@ -68,13 +68,13 @@ Then use the components in your Nuxt application:
|
|
|
68
68
|
<script setup>
|
|
69
69
|
// The types are auto-imported
|
|
70
70
|
const data = ref([
|
|
71
|
-
{ date:
|
|
72
|
-
{ date:
|
|
73
|
-
{ date:
|
|
74
|
-
])
|
|
71
|
+
{ date: "2023-01", value: 100 },
|
|
72
|
+
{ date: "2023-02", value: 200 },
|
|
73
|
+
{ date: "2023-03", value: 150 },
|
|
74
|
+
]);
|
|
75
75
|
|
|
76
|
-
const accessor = (d) => d.value
|
|
77
|
-
const xAxisTitle =
|
|
76
|
+
const accessor = (d) => d.value;
|
|
77
|
+
const xAxisTitle = "Month";
|
|
78
78
|
</script>
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -100,8 +100,8 @@ The following types are auto-imported:
|
|
|
100
100
|
MIT
|
|
101
101
|
|
|
102
102
|
<!-- Badges -->
|
|
103
|
-
[npm-version-src]: https://img.shields.io/npm/v/@vue-chrts/nuxt/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
104
|
-
[npm-version-href]: https://npmjs.com/package/@vue-chrts/nuxt
|
|
105
103
|
|
|
106
|
-
[npm-
|
|
107
|
-
[npm-
|
|
104
|
+
[npm-version-src]: https://img.shields.io/npm/v/nuxt-charts/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
105
|
+
[npm-version-href]: https://npmjs.com/package/nuxt-charts
|
|
106
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-charts.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
107
|
+
[npm-downloads-href]: https://npmjs.com/package/nuxt-charts
|
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"configKey": "
|
|
2
|
+
"name": "nuxt-charts",
|
|
3
|
+
"configKey": "nuxtCharts",
|
|
4
4
|
"compatibility": {
|
|
5
5
|
"nuxt": "^3.0.0"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.1.0-beta.
|
|
7
|
+
"version": "0.1.0-beta.4",
|
|
8
8
|
"builder": {
|
|
9
9
|
"@nuxt/module-builder": "0.8.4",
|
|
10
10
|
"unbuild": "unknown"
|
package/dist/module.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { addComponent, addImportsSources, defineNuxtModule, createResolver } from '@nuxt/kit';
|
|
2
2
|
|
|
3
3
|
const resolveComponents = (config, filePath) => {
|
|
4
|
-
const {
|
|
5
|
-
const allComponents = [
|
|
4
|
+
const { prefix } = config;
|
|
5
|
+
const allComponents = [
|
|
6
|
+
"AreaChart",
|
|
7
|
+
"AreaStackedChart",
|
|
8
|
+
"LineChart",
|
|
9
|
+
"BarChart",
|
|
10
|
+
"DonutChart"
|
|
11
|
+
];
|
|
6
12
|
allComponents.forEach((component) => {
|
|
7
|
-
console.log(component, "component");
|
|
8
13
|
if (typeof component === "string") {
|
|
9
14
|
addComponent({
|
|
10
15
|
export: component,
|
|
@@ -21,20 +26,24 @@ const resolveComponents = (config, filePath) => {
|
|
|
21
26
|
});
|
|
22
27
|
};
|
|
23
28
|
|
|
24
|
-
const resolveImports = (
|
|
25
|
-
const
|
|
26
|
-
const allImports = imports ? imports : ["BulletLegendItemInterface"];
|
|
29
|
+
const resolveImports = (_, filePath) => {
|
|
30
|
+
const allTypes = ["BulletLegendItemInterface"];
|
|
27
31
|
addImportsSources({
|
|
28
32
|
from: filePath,
|
|
29
33
|
type: true,
|
|
34
|
+
imports: [...allTypes]
|
|
35
|
+
});
|
|
36
|
+
const allImports = ["CurveType", "LegendPosition", "Orientation"];
|
|
37
|
+
addImportsSources({
|
|
38
|
+
from: filePath,
|
|
30
39
|
imports: [...allImports]
|
|
31
40
|
});
|
|
32
41
|
};
|
|
33
42
|
|
|
34
43
|
const module = defineNuxtModule({
|
|
35
44
|
meta: {
|
|
36
|
-
name: "
|
|
37
|
-
configKey: "
|
|
45
|
+
name: "nuxt-charts",
|
|
46
|
+
configKey: "nuxtCharts",
|
|
38
47
|
compatibility: {
|
|
39
48
|
nuxt: "^3.0.0"
|
|
40
49
|
}
|
|
@@ -45,8 +54,9 @@ const module = defineNuxtModule({
|
|
|
45
54
|
autoImports: true,
|
|
46
55
|
include: []
|
|
47
56
|
},
|
|
48
|
-
async setup(options
|
|
49
|
-
const
|
|
57
|
+
async setup(options) {
|
|
58
|
+
const { resolve } = createResolver(import.meta.url);
|
|
59
|
+
const runtimePath = resolve("./runtime/vue-chrts");
|
|
50
60
|
resolveImports(options, runtimePath);
|
|
51
61
|
resolveComponents(options, runtimePath);
|
|
52
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-charts",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
4
|
"description": "Nuxt module for vue-chrts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dev": "nuxi dev playground",
|
|
21
21
|
"dev:build": "nuxi build playground",
|
|
22
22
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
23
|
-
"release": "npm run lint && npm run
|
|
23
|
+
"release": "npm run lint && npm run prepack && npm publish && git push --follow-tags",
|
|
24
24
|
"lint": "eslint .",
|
|
25
25
|
"test": "vitest run",
|
|
26
26
|
"test:watch": "vitest watch",
|
|
@@ -28,14 +28,16 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nuxt/kit": "^3.11.1",
|
|
31
|
-
"@unovis/vue": "^1.5.1",
|
|
32
31
|
"vue-chrts": "0.1.0"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
34
|
+
"@nuxt/eslint": "1.3.0",
|
|
35
35
|
"@nuxt/eslint-config": "^0.2.0",
|
|
36
36
|
"@nuxt/module-builder": "^0.8.0",
|
|
37
37
|
"@nuxt/schema": "^3.11.1",
|
|
38
38
|
"@types/node": "^20.12.10",
|
|
39
|
+
"changelogen": "^0.6.1",
|
|
40
|
+
"vitest": "^3.1.1",
|
|
39
41
|
"eslint": "^8.57.0",
|
|
40
42
|
"nuxt": "^3.11.1",
|
|
41
43
|
"typescript": "^5.4.5"
|