@jant/core 0.2.8 → 0.2.10

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
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tailwind CSS content path helper for @jant/core
3
+ *
4
+ * This helper resolves the absolute path to @jant/core source files,
5
+ * working correctly with pnpm symlinks and npm installations.
6
+ */
7
+ /**
8
+ * Returns the absolute glob path to scan @jant/core source files for Tailwind classes.
9
+ * Uses require.resolve to penetrate pnpm symlinks.
10
+ */
11
+ export declare function jantContent(): string;
12
+ //# sourceMappingURL=tailwind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../src/tailwind.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAGpC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tailwind CSS content path helper for @jant/core
3
+ *
4
+ * This helper resolves the absolute path to @jant/core source files,
5
+ * working correctly with pnpm symlinks and npm installations.
6
+ */ import path from "path";
7
+ import { createRequire } from "module";
8
+ const require = createRequire(import.meta.url);
9
+ /**
10
+ * Returns the absolute glob path to scan @jant/core source files for Tailwind classes.
11
+ * Uses require.resolve to penetrate pnpm symlinks.
12
+ */ export function jantContent() {
13
+ const root = path.dirname(require.resolve("@jant/core/package.json"));
14
+ return path.join(root, "src/**/*.{ts,tsx}");
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jant/core",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "A modern, open-source microblogging platform built on Cloudflare Workers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,11 +15,12 @@
15
15
  "types": "./dist/theme/index.d.ts",
16
16
  "default": "./dist/theme/index.js"
17
17
  },
18
- "./preset.css": "./src/preset.css",
19
- "./client": {
20
- "types": "./dist/client.d.ts",
21
- "default": "./dist/client.js"
18
+ "./tailwind": {
19
+ "types": "./dist/tailwind.d.ts",
20
+ "default": "./dist/tailwind.js"
22
21
  },
22
+ "./preset.css": "./src/preset.css",
23
+ "./client": "./dist/client.js",
23
24
  "./*": "./*"
24
25
  },
25
26
  "files": [
@@ -47,7 +48,6 @@
47
48
  "tailwindcss": "^4.0.0"
48
49
  },
49
50
  "devDependencies": {
50
- "@cloudflare/vite-plugin": "^1.22.1",
51
51
  "@cloudflare/workers-types": "^4.20260131.0",
52
52
  "@eslint/js": "^9.39.2",
53
53
  "@lingui/cli": "^5.9.0",
@@ -55,11 +55,9 @@
55
55
  "@lingui/swc-plugin": "^5.10.1",
56
56
  "@swc/cli": "^0.6.0",
57
57
  "@swc/core": "^1.15.11",
58
- "@tailwindcss/postcss": "^4.1.18",
59
58
  "@types/node": "^25.1.0",
60
59
  "@typescript-eslint/eslint-plugin": "^8.54.0",
61
60
  "@typescript-eslint/parser": "^8.54.0",
62
- "autoprefixer": "^10.4.24",
63
61
  "basecoat-css": "^0.3.10",
64
62
  "drizzle-kit": "^0.31.8",
65
63
  "eslint": "^9.39.2",
@@ -67,15 +65,10 @@
67
65
  "glob": "^13.0.0",
68
66
  "husky": "^9.1.7",
69
67
  "lint-staged": "^16.2.7",
70
- "postcss": "^8.5.6",
71
68
  "prettier": "^3.8.1",
72
69
  "tailwindcss": "^4.1.18",
73
70
  "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"
71
+ "typescript": "^5.9.3"
79
72
  },
80
73
  "repository": {
81
74
  "type": "git",
@@ -101,20 +94,13 @@
101
94
  "node": ">=24.0.0"
102
95
  },
103
96
  "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
97
  "build:lib": "swc src -d dist --strip-leading-paths && pnpm build:types",
108
98
  "build:types": "tsc -p tsconfig.build.json",
109
- "deploy": "pnpm build && wrangler deploy",
110
- "preview": "vite preview",
111
99
  "typecheck": "tsc --noEmit && tsc -p tsconfig.client.json",
112
100
  "lint": "eslint src/",
113
101
  "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
114
102
  "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
115
103
  "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
104
  "i18n:extract": "lingui extract",
119
105
  "i18n:compile": "lingui compile --typescript",
120
106
  "i18n:build": "pnpm i18n:extract && pnpm i18n:compile"
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tailwind CSS content path helper for @jant/core
3
+ *
4
+ * This helper resolves the absolute path to @jant/core source files,
5
+ * working correctly with pnpm symlinks and npm installations.
6
+ */
7
+
8
+ import path from "path";
9
+ import { createRequire } from "module";
10
+
11
+ const require = createRequire(import.meta.url);
12
+
13
+ /**
14
+ * Returns the absolute glob path to scan @jant/core source files for Tailwind classes.
15
+ * Uses require.resolve to penetrate pnpm symlinks.
16
+ */
17
+ export function jantContent(): string {
18
+ const root = path.dirname(require.resolve("@jant/core/package.json"));
19
+ return path.join(root, "src/**/*.{ts,tsx}");
20
+ }