tailwindcss-config 1.1.5 → 1.1.6-next.0
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/dist/index.cjs +52 -78
- package/dist/index.d.ts +4 -7
- package/dist/index.mjs +37 -0
- package/dist/utils.d.ts +1 -0
- package/package.json +4 -3
- package/dist/index.d.cts +0 -15
- package/dist/index.js +0 -50
package/dist/index.cjs
CHANGED
|
@@ -1,88 +1,62 @@
|
|
|
1
|
-
"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
9
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
|
|
37
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.0__@swc+core@1.15.21_@swc+_5ebcbf8346fe43415c2ec13051ebcdfe/node_modules/tsup/assets/cjs_shims.js
|
|
38
|
-
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
39
|
-
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
40
|
-
|
|
41
|
-
// src/index.ts
|
|
42
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
43
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
44
|
-
var import_jiti = require("jiti");
|
|
45
|
-
var import_lilconfig = require("lilconfig");
|
|
46
|
-
|
|
47
|
-
// src/utils.ts
|
|
48
|
-
var import_shared = require("@weapp-tailwindcss/shared");
|
|
49
|
-
|
|
50
|
-
// src/index.ts
|
|
51
|
-
var jiti = (0, import_jiti.createJiti)(importMetaUrl);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
let node_path = require("node:path");
|
|
25
|
+
node_path = __toESM(node_path, 1);
|
|
26
|
+
let node_process = require("node:process");
|
|
27
|
+
node_process = __toESM(node_process, 1);
|
|
28
|
+
let jiti = require("jiti");
|
|
29
|
+
let lilconfig = require("lilconfig");
|
|
30
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
31
|
+
//#region src/index.ts
|
|
32
|
+
const jiti$1 = (0, jiti.createJiti)(require("url").pathToFileURL(__filename).href);
|
|
52
33
|
async function loadConfig(options) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const configPath = import_node_path.default.isAbsolute(config) ? config : import_node_path.default.resolve(cwd, config);
|
|
80
|
-
return await searcher.load(configPath);
|
|
81
|
-
} else {
|
|
82
|
-
return await searcher.search(cwd);
|
|
83
|
-
}
|
|
34
|
+
const { config, cwd, moduleName } = (0, _weapp_tailwindcss_shared.defuOverrideArray)(options, {
|
|
35
|
+
cwd: node_process.default.cwd(),
|
|
36
|
+
moduleName: "tailwind"
|
|
37
|
+
});
|
|
38
|
+
const searcher = (0, lilconfig.lilconfig)("tailwindcss", {
|
|
39
|
+
searchPlaces: [
|
|
40
|
+
`${moduleName}.config.js`,
|
|
41
|
+
`${moduleName}.config.cjs`,
|
|
42
|
+
`${moduleName}.config.mjs`,
|
|
43
|
+
`${moduleName}.config.ts`,
|
|
44
|
+
`${moduleName}.config.cts`,
|
|
45
|
+
`${moduleName}.config.mts`
|
|
46
|
+
],
|
|
47
|
+
loaders: {
|
|
48
|
+
".js": jiti$1,
|
|
49
|
+
".cjs": jiti$1,
|
|
50
|
+
".mjs": jiti$1,
|
|
51
|
+
".ts": jiti$1,
|
|
52
|
+
".cts": jiti$1,
|
|
53
|
+
".mts": jiti$1
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (typeof config === "string" && config) {
|
|
57
|
+
const configPath = node_path.default.isAbsolute(config) ? config : node_path.default.resolve(cwd, config);
|
|
58
|
+
return await searcher.load(configPath);
|
|
59
|
+
} else return await searcher.search(cwd);
|
|
84
60
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
loadConfig
|
|
88
|
-
});
|
|
61
|
+
//#endregion
|
|
62
|
+
exports.loadConfig = loadConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { Config } from 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
interface LoadConfigOptions {
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
export interface LoadConfigOptions {
|
|
4
3
|
cwd: string;
|
|
5
4
|
config: string;
|
|
6
5
|
moduleName: string;
|
|
7
6
|
}
|
|
8
|
-
type LoadConfigResult = null | {
|
|
7
|
+
export type LoadConfigResult = null | {
|
|
9
8
|
filepath: string;
|
|
10
9
|
config: Config;
|
|
11
10
|
isEmpty?: boolean;
|
|
12
11
|
};
|
|
13
|
-
declare function loadConfig(options?: Partial<LoadConfigOptions>): Promise<LoadConfigResult>;
|
|
14
|
-
|
|
15
|
-
export { type LoadConfigOptions, type LoadConfigResult, loadConfig };
|
|
12
|
+
export declare function loadConfig(options?: Partial<LoadConfigOptions>): Promise<LoadConfigResult>;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import { createJiti } from "jiti";
|
|
4
|
+
import { lilconfig } from "lilconfig";
|
|
5
|
+
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
const jiti = createJiti(import.meta.url);
|
|
8
|
+
async function loadConfig(options) {
|
|
9
|
+
const { config, cwd, moduleName } = defuOverrideArray(options, {
|
|
10
|
+
cwd: process.cwd(),
|
|
11
|
+
moduleName: "tailwind"
|
|
12
|
+
});
|
|
13
|
+
const searcher = lilconfig("tailwindcss", {
|
|
14
|
+
searchPlaces: [
|
|
15
|
+
`${moduleName}.config.js`,
|
|
16
|
+
`${moduleName}.config.cjs`,
|
|
17
|
+
`${moduleName}.config.mjs`,
|
|
18
|
+
`${moduleName}.config.ts`,
|
|
19
|
+
`${moduleName}.config.cts`,
|
|
20
|
+
`${moduleName}.config.mts`
|
|
21
|
+
],
|
|
22
|
+
loaders: {
|
|
23
|
+
".js": jiti,
|
|
24
|
+
".cjs": jiti,
|
|
25
|
+
".mjs": jiti,
|
|
26
|
+
".ts": jiti,
|
|
27
|
+
".cts": jiti,
|
|
28
|
+
".mts": jiti
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
if (typeof config === "string" && config) {
|
|
32
|
+
const configPath = path.isAbsolute(config) ? config : path.resolve(cwd, config);
|
|
33
|
+
return await searcher.load(configPath);
|
|
34
|
+
} else return await searcher.search(cwd);
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { loadConfig };
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defu, defuOverrideArray, } from '@weapp-tailwindcss/shared';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.6-next.0",
|
|
5
5
|
"description": "load tailwindcss config function",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
"@weapp-tailwindcss/shared": "1.1.3"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
|
-
"dev": "
|
|
46
|
-
"build": "
|
|
45
|
+
"dev": "tsdown --watch --sourcemap",
|
|
46
|
+
"build": "tsdown && pnpm run build:types",
|
|
47
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
47
48
|
"test": "vitest run",
|
|
48
49
|
"test:dev": "vitest",
|
|
49
50
|
"release": "pnpm publish",
|
package/dist/index.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Config } from 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
interface LoadConfigOptions {
|
|
4
|
-
cwd: string;
|
|
5
|
-
config: string;
|
|
6
|
-
moduleName: string;
|
|
7
|
-
}
|
|
8
|
-
type LoadConfigResult = null | {
|
|
9
|
-
filepath: string;
|
|
10
|
-
config: Config;
|
|
11
|
-
isEmpty?: boolean;
|
|
12
|
-
};
|
|
13
|
-
declare function loadConfig(options?: Partial<LoadConfigOptions>): Promise<LoadConfigResult>;
|
|
14
|
-
|
|
15
|
-
export { type LoadConfigOptions, type LoadConfigResult, loadConfig };
|
package/dist/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
|
-
import path from "path";
|
|
3
|
-
import process from "process";
|
|
4
|
-
import { createJiti } from "jiti";
|
|
5
|
-
import { lilconfig } from "lilconfig";
|
|
6
|
-
|
|
7
|
-
// src/utils.ts
|
|
8
|
-
import {
|
|
9
|
-
defu,
|
|
10
|
-
defuOverrideArray
|
|
11
|
-
} from "@weapp-tailwindcss/shared";
|
|
12
|
-
|
|
13
|
-
// src/index.ts
|
|
14
|
-
var jiti = createJiti(import.meta.url);
|
|
15
|
-
async function loadConfig(options) {
|
|
16
|
-
const { config, cwd, moduleName } = defuOverrideArray(
|
|
17
|
-
options,
|
|
18
|
-
{
|
|
19
|
-
cwd: process.cwd(),
|
|
20
|
-
moduleName: "tailwind"
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
const searcher = lilconfig("tailwindcss", {
|
|
24
|
-
searchPlaces: [
|
|
25
|
-
`${moduleName}.config.js`,
|
|
26
|
-
`${moduleName}.config.cjs`,
|
|
27
|
-
`${moduleName}.config.mjs`,
|
|
28
|
-
`${moduleName}.config.ts`,
|
|
29
|
-
`${moduleName}.config.cts`,
|
|
30
|
-
`${moduleName}.config.mts`
|
|
31
|
-
],
|
|
32
|
-
loaders: {
|
|
33
|
-
".js": jiti,
|
|
34
|
-
".cjs": jiti,
|
|
35
|
-
".mjs": jiti,
|
|
36
|
-
".ts": jiti,
|
|
37
|
-
".cts": jiti,
|
|
38
|
-
".mts": jiti
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
if (typeof config === "string" && config) {
|
|
42
|
-
const configPath = path.isAbsolute(config) ? config : path.resolve(cwd, config);
|
|
43
|
-
return await searcher.load(configPath);
|
|
44
|
-
} else {
|
|
45
|
-
return await searcher.search(cwd);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
loadConfig
|
|
50
|
-
};
|