@jant/core 0.2.9 → 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,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.9",
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,7 +15,10 @@
15
15
  "types": "./dist/theme/index.d.ts",
16
16
  "default": "./dist/theme/index.js"
17
17
  },
18
- "./plugin": "./src/plugin.ts",
18
+ "./tailwind": {
19
+ "types": "./dist/tailwind.d.ts",
20
+ "default": "./dist/tailwind.js"
21
+ },
19
22
  "./preset.css": "./src/preset.css",
20
23
  "./client": "./dist/client.js",
21
24
  "./*": "./*"
@@ -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
+ }
package/src/plugin.ts DELETED
@@ -1,26 +0,0 @@
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
- );