@vueless/nuxt 0.0.1
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/LICENSE +21 -0
- package/README.md +39 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +5 -0
- package/dist/module.d.ts +5 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +69 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +16 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/package.json +86 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 vuelessjs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Vueless Nuxt Module
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
+
[![License][license-src]][license-href]
|
|
6
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
+
|
|
8
|
+
## Quick Setup
|
|
9
|
+
|
|
10
|
+
1. Add `@vueless/module-nuxt` dependency to your project
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx nuxi@latest module add vueless
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
2. Add `@vueless/module-nuxt` to the `modules` section of `nuxt.config.{ts,js}`
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
{
|
|
20
|
+
modules: [
|
|
21
|
+
'@vueless/module-nuxt'
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That's it! You can now use `@vueless/module-nuxt` in your Nuxt app ✨
|
|
27
|
+
|
|
28
|
+
<!-- Badges -->
|
|
29
|
+
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
30
|
+
[npm-version-href]: https://npmjs.com/package/my-module
|
|
31
|
+
|
|
32
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
|
33
|
+
[npm-downloads-href]: https://npmjs.com/package/my-module
|
|
34
|
+
|
|
35
|
+
[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
|
36
|
+
[license-href]: https://npmjs.com/package/my-module
|
|
37
|
+
|
|
38
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
|
|
39
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.cjs
ADDED
package/dist/module.d.ts
ADDED
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { addTemplate, installModule, useNuxt, defineNuxtModule, createResolver, addPlugin, addComponent, addImportsDir } from '@nuxt/kit';
|
|
2
|
+
import { COMPONENTS } from 'vueless/constants.js';
|
|
3
|
+
import { Vueless } from 'vueless/plugin-vite.js';
|
|
4
|
+
import { createTailwindSafelist } from 'vueless/utils/node/tailwindSafelist.js';
|
|
5
|
+
import { getNuxtFiles } from 'vueless/utils/node/helper.js';
|
|
6
|
+
import { join } from 'pathe';
|
|
7
|
+
import { defu } from 'defu';
|
|
8
|
+
|
|
9
|
+
async function installTailwind(_nuxt = useNuxt()) {
|
|
10
|
+
await createTailwindSafelist({
|
|
11
|
+
targetFiles: getNuxtFiles()
|
|
12
|
+
});
|
|
13
|
+
const vuelessConfigFile = addTemplate({
|
|
14
|
+
filename: "vueless-tailwind.config.mjs",
|
|
15
|
+
write: true,
|
|
16
|
+
getContents: async () => `
|
|
17
|
+
import forms from "@tailwindcss/forms";
|
|
18
|
+
import { getSafelist, vuelessTailwindConfig } from "vueless/preset-tailwind.js";
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
plugins: [forms],
|
|
22
|
+
safelist: getSafelist(),
|
|
23
|
+
...vuelessTailwindConfig,
|
|
24
|
+
}
|
|
25
|
+
`
|
|
26
|
+
});
|
|
27
|
+
const configPaths = [vuelessConfigFile.dst, join(_nuxt.options.rootDir, "tailwind.config")];
|
|
28
|
+
const { configPath: userConfigPath = [], ...twModuleConfig } = _nuxt.options.tailwindcss ?? {};
|
|
29
|
+
if (typeof userConfigPath === "string") {
|
|
30
|
+
configPaths.push(userConfigPath);
|
|
31
|
+
} else {
|
|
32
|
+
configPaths.push(...userConfigPath);
|
|
33
|
+
}
|
|
34
|
+
await installModule("@nuxtjs/tailwindcss", defu({
|
|
35
|
+
exposeConfig: true,
|
|
36
|
+
configPath: configPaths
|
|
37
|
+
}, twModuleConfig));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const module = defineNuxtModule({
|
|
41
|
+
meta: {
|
|
42
|
+
name: "@vueless/nuxt",
|
|
43
|
+
configKey: "vueless",
|
|
44
|
+
compatibility: {
|
|
45
|
+
nuxt: ">=3.13.0"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
defaults: {},
|
|
49
|
+
async setup(_options, _nuxt) {
|
|
50
|
+
const { resolve } = createResolver(import.meta.url);
|
|
51
|
+
_nuxt.options.build.transpile.push("vueless", "tailwindcss");
|
|
52
|
+
_nuxt.hook("vite:extendConfig", (config) => {
|
|
53
|
+
config.plugins = config.plugins || [];
|
|
54
|
+
config.plugins.push(Vueless({ mode: "nuxt-module" }));
|
|
55
|
+
});
|
|
56
|
+
await installTailwind(_nuxt);
|
|
57
|
+
addPlugin(resolve("./runtime/plugin"));
|
|
58
|
+
for (const componentName in COMPONENTS) {
|
|
59
|
+
await addComponent({
|
|
60
|
+
name: componentName,
|
|
61
|
+
filePath: `vueless/${COMPONENTS[componentName]}/${componentName}.vue`
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
addImportsDir("vueless/composables");
|
|
65
|
+
addImportsDir("vueless/utils");
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export { module as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createVueless, setTheme } from "vueless";
|
|
2
|
+
import vClickOutside from "vueless/directives/clickOutside/vClickOutside";
|
|
3
|
+
import vTooltip from "vueless/directives/tooltip/vTooltip";
|
|
4
|
+
import { defineNuxtPlugin } from "#app";
|
|
5
|
+
export default defineNuxtPlugin((_nuxtApp) => {
|
|
6
|
+
const vueless = createVueless();
|
|
7
|
+
_nuxtApp.vueApp.use(vueless, {});
|
|
8
|
+
_nuxtApp.vueApp.directive("clickOutside", vClickOutside);
|
|
9
|
+
_nuxtApp.vueApp.directive("tooltip", vTooltip);
|
|
10
|
+
if (import.meta.server) {
|
|
11
|
+
const themeRootVariables = setTheme();
|
|
12
|
+
_nuxtApp.ssrContext?.head.push({
|
|
13
|
+
style: [{ innerHTML: themeRootVariables }]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
package/dist/types.d.mts
ADDED
package/dist/types.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vueless/nuxt",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"vueless",
|
|
8
|
+
"nuxt",
|
|
9
|
+
"nuxt.js",
|
|
10
|
+
"nuxt3",
|
|
11
|
+
"ui library",
|
|
12
|
+
"component library",
|
|
13
|
+
"nuxt framework",
|
|
14
|
+
"design system",
|
|
15
|
+
"tailwind",
|
|
16
|
+
"tailwindcss",
|
|
17
|
+
"unstyled",
|
|
18
|
+
"styleless",
|
|
19
|
+
"headlessui",
|
|
20
|
+
"ui"
|
|
21
|
+
],
|
|
22
|
+
"homepage": "https://vueless.com",
|
|
23
|
+
"author": "Johnny Grid",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/types.d.ts",
|
|
31
|
+
"import": "./dist/module.mjs",
|
|
32
|
+
"require": "./dist/module.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"main": "./dist/module.cjs",
|
|
36
|
+
"types": "./dist/types.d.ts",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "nuxi dev playground",
|
|
42
|
+
"dev:build": "nuxi build playground",
|
|
43
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
44
|
+
"prepack": "nuxt-module-build build",
|
|
45
|
+
"release:patch": "release-it patch --ci --npm.publish",
|
|
46
|
+
"release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
|
|
47
|
+
"release:major": "release-it major --ci --npm.publish --git.tag --github.release",
|
|
48
|
+
"lint": "eslint .",
|
|
49
|
+
"lint:ci": "eslint --no-fix --max-warnings=0",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest watch",
|
|
52
|
+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
53
|
+
"install": "npx nuxi prepare"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@nuxt/kit": "^3.13.1",
|
|
57
|
+
"@nuxtjs/tailwindcss": "^6.12.1",
|
|
58
|
+
"defu": "^6.1.4",
|
|
59
|
+
"pathe": "^1.1.2",
|
|
60
|
+
"vueless": "^0.0.481"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@material-symbols/svg-500": "^0.25.0",
|
|
64
|
+
"@nuxt/devtools": "^1.4.1",
|
|
65
|
+
"@nuxt/eslint-config": "^0.5.7",
|
|
66
|
+
"@nuxt/module-builder": "^0.8.4",
|
|
67
|
+
"@nuxt/schema": "^3.13.2",
|
|
68
|
+
"@nuxt/test-utils": "^3.14.1",
|
|
69
|
+
"@types/node": "latest",
|
|
70
|
+
"changelogen": "^0.5.5",
|
|
71
|
+
"eslint": "^9.12.0",
|
|
72
|
+
"nuxt": "^3.13.2",
|
|
73
|
+
"release-it": "^17.6.0",
|
|
74
|
+
"typescript": "latest",
|
|
75
|
+
"vitest": "^2.0.5",
|
|
76
|
+
"vue-tsc": "^2.1.6"
|
|
77
|
+
},
|
|
78
|
+
"repository": {
|
|
79
|
+
"type": "git",
|
|
80
|
+
"url": "git+https://github.com/vuelessjs/vueless-module-nuxt.git"
|
|
81
|
+
},
|
|
82
|
+
"bugs": {
|
|
83
|
+
"url": "https://github.com/vuelessjs/vueless-module-nuxt/issues"
|
|
84
|
+
},
|
|
85
|
+
"web-types": "./node_modules/vueless/web-types.json"
|
|
86
|
+
}
|