@kiln-ssg/tailwindcss 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/compiler.mjs +10 -4
  2. package/package.json +10 -2
package/compiler.mjs CHANGED
@@ -1,21 +1,26 @@
1
1
  #!/usr/bin/env node
2
+
2
3
  import { readFile } from 'node:fs/promises';
3
- import { delimiter, dirname, join } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
4
+ import { createRequire } from 'node:module';
5
+ import { delimiter, dirname } from 'node:path';
6
+
7
+ const modules = createRequire(import.meta.url).resolve.paths('@tailwindcss/node');
8
+ process.env.NODE_PATH = [process.env.NODE_PATH, ...modules].filter(Boolean).join(delimiter);
5
9
 
6
- const modules = join(dirname(fileURLToPath(import.meta.url)), 'node_modules');
7
- process.env.NODE_PATH = [process.env.NODE_PATH, modules].filter(Boolean).join(delimiter);
10
+ // Tailwind captures NODE_PATH when its resolver module loads.
8
11
  const { compile } = await import('@tailwindcss/node');
9
12
  const { Scanner } = await import('@tailwindcss/oxide');
10
13
 
11
14
  const [input] = process.argv.slice(2);
12
15
  const base = dirname(input);
16
+
13
17
  const compiler = await compile(await readFile(input, 'utf8'), {
14
18
  base,
15
19
  from: input,
16
20
  onDependency() {},
17
21
  shouldRewriteUrls: true,
18
22
  });
23
+
19
24
  const sources = [...compiler.sources];
20
25
  if (compiler.root !== 'none') {
21
26
  sources.push({
@@ -23,5 +28,6 @@ if (compiler.root !== 'none') {
23
28
  negated: false,
24
29
  });
25
30
  }
31
+
26
32
  const scanner = new Scanner({ sources });
27
33
  process.stdout.write(compiler.build(scanner.scan()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiln-ssg/tailwindcss",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Tailwind CSS processor for kiln static sites",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "lint": "npm run lint:md && npm run lint:js",
37
37
  "lint:js": "eslint .",
38
38
  "lint:md": "markdownlint-cli2 \"*.md\"",
39
- "spellcheck": "cspell --no-progress \"**/*\"",
39
+ "spellcheck": "cspell --dot --no-progress \"**/*\"",
40
40
  "test": "node --test"
41
41
  },
42
42
  "devDependencies": {
@@ -47,5 +47,13 @@
47
47
  "globals": "^17.12.0",
48
48
  "markdownlint-cli2": "^0.23.3",
49
49
  "prettier": "^3.9.9"
50
+ },
51
+ "overrides": {
52
+ "markdownlint-cli2": {
53
+ "smol-toml": "1.9.0"
54
+ },
55
+ "micromark-extension-math": {
56
+ "katex": "0.19.0"
57
+ }
50
58
  }
51
59
  }