cls-extended 1.0.0 → 1.1.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.
@@ -1,4 +1,4 @@
1
- import unplugin from "../index.js";
1
+ import unplugin from "../unplugin-factory.js";
2
2
 
3
3
  //#region src/adapters/vite.ts
4
4
  const vitePlugin = unplugin.vite;
@@ -1,4 +1,4 @@
1
- import unplugin from "../index.js";
1
+ import unplugin from "../unplugin-factory.js";
2
2
 
3
3
  //#region src/adapters/webpack.d.ts
4
4
  declare const _default: typeof unplugin.webpack;
@@ -1,4 +1,4 @@
1
- import unplugin from "../index.js";
1
+ import unplugin from "../unplugin-factory.js";
2
2
 
3
3
  //#region src/adapters/webpack.ts
4
4
  var webpack_default = unplugin.webpack;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,3 @@
1
1
  import { Options } from "./core/options.js";
2
- import { UnpluginInstance } from "unplugin";
3
-
4
- //#region src/index.d.ts
5
- declare const unplugin: UnpluginInstance<Options | undefined, false>;
6
- //#endregion
7
- export { type Options, unplugin as default };
2
+ import { cls } from "./api.js";
3
+ export { type Options, cls };
package/dist/index.js CHANGED
@@ -1,24 +1,3 @@
1
- import { resolveOptions } from "./core/options.js";
2
- import { transformClsCalls } from "./core/transform.js";
3
- import { createUnplugin } from "unplugin";
1
+ import { cls } from "./api.js";
4
2
 
5
- //#region src/index.ts
6
- const unplugin = createUnplugin((rawOptions = {}) => {
7
- const options = resolveOptions(rawOptions);
8
- return {
9
- name: "cls-extended",
10
- transform: {
11
- filter: { id: {
12
- include: options.include,
13
- exclude: options.exclude
14
- } },
15
- handler(code, id) {
16
- if (!code.includes("tw(")) return null;
17
- return transformClsCalls(code, id, options);
18
- }
19
- }
20
- };
21
- });
22
-
23
- //#endregion
24
- export { unplugin as default };
3
+ export { cls };
@@ -0,0 +1,7 @@
1
+ import { Options } from "./core/options.js";
2
+ import { UnpluginInstance } from "unplugin";
3
+
4
+ //#region src/unplugin-factory.d.ts
5
+ declare const unplugin: UnpluginInstance<Options | undefined, false>;
6
+ //#endregion
7
+ export { type Options, unplugin as default };
@@ -0,0 +1,24 @@
1
+ import { resolveOptions } from "./core/options.js";
2
+ import { transformClsCalls } from "./core/transform.js";
3
+ import { createUnplugin } from "unplugin";
4
+
5
+ //#region src/unplugin-factory.ts
6
+ const unplugin = createUnplugin((rawOptions = {}) => {
7
+ const options = resolveOptions(rawOptions);
8
+ return {
9
+ name: "cls-extended",
10
+ transform: {
11
+ filter: { id: {
12
+ include: options.include,
13
+ exclude: options.exclude
14
+ } },
15
+ handler(code, id) {
16
+ if (!code.includes("tw(")) return null;
17
+ return transformClsCalls(code, id, options);
18
+ }
19
+ }
20
+ };
21
+ });
22
+
23
+ //#endregion
24
+ export { unplugin as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cls-extended",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.1.1",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
7
7
  "./adapters/vite": "./dist/adapters/vite.js",
@@ -10,6 +10,7 @@
10
10
  "./core/options": "./dist/core/options.js",
11
11
  "./core/parser": "./dist/core/parser.js",
12
12
  "./core/transform": "./dist/core/transform.js",
13
+ "./unplugin-factory": "./dist/unplugin-factory.js",
13
14
  "./package.json": "./package.json"
14
15
  },
15
16
  "typesVersions": {
@@ -26,6 +27,10 @@
26
27
  "publishConfig": {
27
28
  "access": "public"
28
29
  },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/yeasin2002/cls-extended"
33
+ },
29
34
  "engines": {
30
35
  "node": ">=20.19.0"
31
36
  },
@@ -36,7 +41,8 @@
36
41
  "dev": "tsdown --watch",
37
42
  "test": "vitest",
38
43
  "typecheck": "tsc --noEmit",
39
- "prepublishOnly": "pnpm run build"
44
+ "prepublishOnly": "pnpm run build",
45
+ "release": "release-it"
40
46
  },
41
47
  "dependencies": {
42
48
  "@babel/parser": "^7.29.0",
@@ -46,15 +52,18 @@
46
52
  "devDependencies": {
47
53
  "@babel/types": "^7.29.0",
48
54
  "@eslint/js": "^9.39.2",
55
+ "@release-it/conventional-changelog": "^8.0.2",
49
56
  "@sxzz/eslint-config": "^7.6.0",
50
57
  "@sxzz/prettier-config": "^2.3.1",
51
58
  "@sxzz/test-utils": "^0.5.15",
52
59
  "@types/node": "^25.2.0",
60
+ "auto-changelog": "^2.5.0",
53
61
  "bumpp": "^10.4.0",
54
62
  "eslint": "^9.39.2",
55
63
  "globals": "^16.5.0",
56
64
  "jiti": "^2.6.1",
57
65
  "prettier": "^3.8.1",
66
+ "release-it": "^17.10.0",
58
67
  "tsdown": "^0.20.1",
59
68
  "tsdown-preset-sxzz": "^0.3.1",
60
69
  "typescript": "^5.9.3",