@jant/core 0.2.8 → 0.2.9

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.
@@ -0,0 +1,3 @@
1
+ import type { Config } from "tailwindcss";
2
+ export declare const jantPlugin: NonNullable<Config["plugins"]>[number];
3
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAiB1C,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAO7D,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,20 @@
1
+ import plugin from "tailwindcss/plugin";
2
+ import path from "path";
3
+ import { createRequire } from "module";
4
+ // Get require method (ESM compatible)
5
+ const require = createRequire(import.meta.url);
6
+ // ---------------------------------------------------------
7
+ // Core Logic: Dynamically resolve absolute path
8
+ // ---------------------------------------------------------
9
+ // 1. Penetrate pnpm symlinks, find the real physical location of package.json
10
+ const pathRoot = path.dirname(require.resolve("@jant/core/package.json"));
11
+ // 2. Construct the absolute path to the source directory
12
+ // Tailwind v4 scans absolute paths reliably, no extra config needed
13
+ const contentPath = path.join(pathRoot, "src/**/*.{ts,tsx}");
14
+ export const jantPlugin = plugin(// Plugin body: can add styles via addBase/addComponents here
15
+ ()=>{}, {
16
+ // Key: Auto-inject core library source path into user's content config
17
+ content: [
18
+ contentPath
19
+ ]
20
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jant/core",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "A modern, open-source microblogging platform built on Cloudflare Workers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,11 +15,9 @@
15
15
  "types": "./dist/theme/index.d.ts",
16
16
  "default": "./dist/theme/index.js"
17
17
  },
18
+ "./plugin": "./src/plugin.ts",
18
19
  "./preset.css": "./src/preset.css",
19
- "./client": {
20
- "types": "./dist/client.d.ts",
21
- "default": "./dist/client.js"
22
- },
20
+ "./client": "./dist/client.js",
23
21
  "./*": "./*"
24
22
  },
25
23
  "files": [
@@ -47,7 +45,6 @@
47
45
  "tailwindcss": "^4.0.0"
48
46
  },
49
47
  "devDependencies": {
50
- "@cloudflare/vite-plugin": "^1.22.1",
51
48
  "@cloudflare/workers-types": "^4.20260131.0",
52
49
  "@eslint/js": "^9.39.2",
53
50
  "@lingui/cli": "^5.9.0",
@@ -55,11 +52,9 @@
55
52
  "@lingui/swc-plugin": "^5.10.1",
56
53
  "@swc/cli": "^0.6.0",
57
54
  "@swc/core": "^1.15.11",
58
- "@tailwindcss/postcss": "^4.1.18",
59
55
  "@types/node": "^25.1.0",
60
56
  "@typescript-eslint/eslint-plugin": "^8.54.0",
61
57
  "@typescript-eslint/parser": "^8.54.0",
62
- "autoprefixer": "^10.4.24",
63
58
  "basecoat-css": "^0.3.10",
64
59
  "drizzle-kit": "^0.31.8",
65
60
  "eslint": "^9.39.2",
@@ -67,15 +62,10 @@
67
62
  "glob": "^13.0.0",
68
63
  "husky": "^9.1.7",
69
64
  "lint-staged": "^16.2.7",
70
- "postcss": "^8.5.6",
71
65
  "prettier": "^3.8.1",
72
66
  "tailwindcss": "^4.1.18",
73
67
  "tsx": "^4.21.0",
74
- "typescript": "^5.9.3",
75
- "unplugin-swc": "^1.5.9",
76
- "vite": "^7.3.1",
77
- "vite-ssr-components": "^0.5.2",
78
- "wrangler": "^4.61.1"
68
+ "typescript": "^5.9.3"
79
69
  },
80
70
  "repository": {
81
71
  "type": "git",
@@ -101,20 +91,13 @@
101
91
  "node": ">=24.0.0"
102
92
  },
103
93
  "scripts": {
104
- "dev": "pnpm db:migrate:local && vite dev",
105
- "dev:debug": "pnpm db:migrate:local && vite dev --port 19019",
106
- "build": "vite build",
107
94
  "build:lib": "swc src -d dist --strip-leading-paths && pnpm build:types",
108
95
  "build:types": "tsc -p tsconfig.build.json",
109
- "deploy": "pnpm build && wrangler deploy",
110
- "preview": "vite preview",
111
96
  "typecheck": "tsc --noEmit && tsc -p tsconfig.client.json",
112
97
  "lint": "eslint src/",
113
98
  "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
114
99
  "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
115
100
  "db:generate": "drizzle-kit generate",
116
- "db:migrate:local": "wrangler d1 migrations apply DB --local",
117
- "db:migrate:remote": "wrangler d1 migrations apply DB --remote",
118
101
  "i18n:extract": "lingui extract",
119
102
  "i18n:compile": "lingui compile --typescript",
120
103
  "i18n:build": "pnpm i18n:extract && pnpm i18n:compile"
package/src/plugin.ts ADDED
@@ -0,0 +1,26 @@
1
+ import plugin from "tailwindcss/plugin";
2
+ import type { Config } from "tailwindcss";
3
+ import path from "path";
4
+ import { createRequire } from "module";
5
+
6
+ // Get require method (ESM compatible)
7
+ const require = createRequire(import.meta.url);
8
+
9
+ // ---------------------------------------------------------
10
+ // Core Logic: Dynamically resolve absolute path
11
+ // ---------------------------------------------------------
12
+ // 1. Penetrate pnpm symlinks, find the real physical location of package.json
13
+ const pathRoot = path.dirname(require.resolve("@jant/core/package.json"));
14
+
15
+ // 2. Construct the absolute path to the source directory
16
+ // Tailwind v4 scans absolute paths reliably, no extra config needed
17
+ const contentPath = path.join(pathRoot, "src/**/*.{ts,tsx}");
18
+
19
+ export const jantPlugin: NonNullable<Config["plugins"]>[number] = plugin(
20
+ // Plugin body: can add styles via addBase/addComponents here
21
+ () => {},
22
+ {
23
+ // Key: Auto-inject core library source path into user's content config
24
+ content: [contentPath],
25
+ }
26
+ );