@zubyjs/tailwind 1.0.79 → 1.0.81
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/examples/js/tailwind.config.mjs +5 -5
- package/examples/ts/tailwind.config.ts +5 -5
- package/index.d.ts +1 -1
- package/index.js +4 -6
- package/package.json +43 -42
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -16,14 +16,14 @@ export default ({ configFile, nesting = false } = {}) => ({
|
|
|
16
16
|
name: 'zuby-tailwind-plugin',
|
|
17
17
|
description: 'Adds Tailwind CSS to your Zuby.js application',
|
|
18
18
|
hooks: {
|
|
19
|
-
'zuby:config:setup': async ({ config,
|
|
19
|
+
'zuby:config:setup': async ({ config, logger }) => {
|
|
20
20
|
const { srcDir = './' } = config;
|
|
21
21
|
configFile = configFile || findTailwindConfig(srcDir) || createTailwindConfig(srcDir);
|
|
22
22
|
config.vite = config.vite || {};
|
|
23
23
|
config.vite.css = config.vite?.css || {};
|
|
24
24
|
config.vite.css.postcss = config.vite.css.postcss || {};
|
|
25
25
|
if (typeof config.vite.css.postcss === 'string') {
|
|
26
|
-
|
|
26
|
+
logger?.error(`[zuby-tailwind-plugin] Invalid configuration for 'vite.css.postcss'. Expected an object, but got a string.`);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
config.vite.css.postcss.plugins = config.vite.css.postcss.plugins || [];
|
|
@@ -37,9 +37,7 @@ export default ({ configFile, nesting = false } = {}) => ({
|
|
|
37
37
|
});
|
|
38
38
|
export function createTailwindConfig(srcDir) {
|
|
39
39
|
const isTs = existsSync(resolve(srcDir, 'tsconfig.json'));
|
|
40
|
-
const configFile = isTs
|
|
41
|
-
? TAILWIND_CONFIG_FILE.replace('.js', '.ts')
|
|
42
|
-
: TAILWIND_CONFIG_FILE.replace('.js', '.mjs');
|
|
40
|
+
const configFile = isTs ? TAILWIND_CONFIG_FILE.replace('.js', '.ts') : TAILWIND_CONFIG_FILE.replace('.js', '.mjs');
|
|
43
41
|
copyFileSync(resolve(__dirname, 'examples', isTs ? 'ts' : 'js', configFile), resolve(srcDir, configFile));
|
|
44
42
|
return configFile;
|
|
45
43
|
}
|
|
@@ -49,5 +47,5 @@ export function findTailwindConfig(srcDir) {
|
|
|
49
47
|
resolve(srcDir, TAILWIND_CONFIG_FILE.replace('.js', '.mjs')),
|
|
50
48
|
resolve(srcDir, TAILWIND_CONFIG_FILE.replace('.js', '.cjs')),
|
|
51
49
|
resolve(srcDir, TAILWIND_CONFIG_FILE.replace('.js', '.ts')),
|
|
52
|
-
].find(file => existsSync(file));
|
|
50
|
+
].find((file) => existsSync(file));
|
|
53
51
|
}
|
package/package.json
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
2
|
+
"name": "@zubyjs/tailwind",
|
|
3
|
+
"version": "1.0.81",
|
|
4
|
+
"description": "Zuby.js tailwind plugin",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"release": "cd ./dist && npm publish --access public && cd ..",
|
|
9
|
+
"bump-version": "npm version patch",
|
|
10
|
+
"build": "rm -rf dist/ stage/ && mkdir dist && tsc && cp -rf package.json README.md src/examples stage/tailwind/src/* dist/ && rm -rf stage/",
|
|
11
|
+
"push-build": "npm run build && cd dist && yalc push --force && cd ..",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:coverage": "vitest run --coverage"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"directory": "dist",
|
|
17
|
+
"linkDirectory": true
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"autoprefixer": "10.4.19",
|
|
21
|
+
"tailwindcss": "3.4.3"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"zuby": "^1.0.0"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://gitlab.com/futrou/zuby.js/-/issues",
|
|
28
|
+
"email": "zuby@futrou.com"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://gitlab.com/futrou/zuby.js.git"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://zubyjs.com",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"zuby-plugin",
|
|
38
|
+
"zuby",
|
|
39
|
+
"tailwind",
|
|
40
|
+
"css"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
}
|
|
44
45
|
}
|