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 CHANGED
@@ -1,88 +1,62 @@
1
- "use strict";
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
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
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
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- loadConfig: () => loadConfig
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
- const { config, cwd, moduleName } = (0, import_shared.defuOverrideArray)(
54
- options,
55
- {
56
- cwd: import_node_process.default.cwd(),
57
- moduleName: "tailwind"
58
- }
59
- );
60
- const searcher = (0, import_lilconfig.lilconfig)("tailwindcss", {
61
- searchPlaces: [
62
- `${moduleName}.config.js`,
63
- `${moduleName}.config.cjs`,
64
- `${moduleName}.config.mjs`,
65
- `${moduleName}.config.ts`,
66
- `${moduleName}.config.cts`,
67
- `${moduleName}.config.mts`
68
- ],
69
- loaders: {
70
- ".js": jiti,
71
- ".cjs": jiti,
72
- ".mjs": jiti,
73
- ".ts": jiti,
74
- ".cts": jiti,
75
- ".mts": jiti
76
- }
77
- });
78
- if (typeof config === "string" && config) {
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
- // Annotate the CommonJS export names for ESM import in node:
86
- 0 && (module.exports = {
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 };
@@ -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.5",
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": "tsup --watch --sourcemap",
46
- "build": "tsup",
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
- };