@fullstacked/tailwindcss 4.3.2-patch.1 → 4.3.2-patch.3

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 (3) hide show
  1. package/index.js +4 -7
  2. package/index.ts +7 -13
  3. package/package.json +3 -2
package/index.js CHANGED
@@ -15,7 +15,6 @@ export function initialize(opts) {
15
15
  oxide: oxide(fs.promises.readFile(oxidePath)),
16
16
  lightningcss: lightningcss(lightningcssPath),
17
17
  tailwindcss: tailwindcssPath,
18
- baseDirectory: opts?.baseDirectory || process.cwd(),
19
18
  skipLightning: opts?.skipLightning
20
19
  };
21
20
  await Promise.all([locations.oxide, locations.lightningcss]);
@@ -69,12 +68,9 @@ async function loadStylesheet(id, base) {
69
68
  throw new Error(`The browser build does not support @import for "${id}"`);
70
69
  }
71
70
  async function compileTailwind(entryfile, files) {
72
- entryfile = path.join(init.baseDirectory, entryfile);
73
71
  const entry = await fs.promises.readFile(entryfile, "utf-8");
74
72
  const contents = await Promise.all(
75
- files.map(
76
- (file) => fs.promises.readFile(path.join(init.baseDirectory, file), "utf-8")
77
- )
73
+ files.map((file) => fs.promises.readFile(file, "utf-8"))
78
74
  );
79
75
  const candidate = contents.map((content) => extract(content)).flat();
80
76
  const compiler = await compile(entry, { loadStylesheet });
@@ -91,8 +87,9 @@ async function tailwindBuilder(params) {
91
87
  }
92
88
  const sources = params.sources.filter((s) => !s.endsWith(".css"));
93
89
  await initialize(params.initializeOptions);
94
- const css = await compileTailwind(params.resolved.at(0).importer, sources);
95
- const basename = path.basename(params.resolved.at(0).importer);
90
+ const entryfile = params.resolved.at(0).importer;
91
+ const css = await compileTailwind(entryfile, sources);
92
+ const basename = path.basename(entryfile);
96
93
  return [
97
94
  {
98
95
  outputName: basename + ".tailwind.css",
package/index.ts CHANGED
@@ -8,7 +8,6 @@ let init: {
8
8
  oxide: Promise<void>;
9
9
  lightningcss: Promise<void>;
10
10
  tailwindcss: string;
11
- baseDirectory: string;
12
11
  skipLightning: boolean;
13
12
  } = null;
14
13
  let initPromise: Promise<void> = null;
@@ -17,7 +16,6 @@ type InitializeOpts = {
17
16
  oxide?: string;
18
17
  tailwindcss?: string;
19
18
  lightningcss?: string;
20
- baseDirectory?: string;
21
19
  skipLightning?: boolean;
22
20
  };
23
21
 
@@ -36,7 +34,6 @@ export function initialize(opts?: InitializeOpts) {
36
34
  oxide: oxide(fs.promises.readFile(oxidePath)),
37
35
  lightningcss: lightningcss(lightningcssPath),
38
36
  tailwindcss: tailwindcssPath,
39
- baseDirectory: opts?.baseDirectory || process.cwd(),
40
37
  skipLightning: opts?.skipLightning
41
38
  };
42
39
 
@@ -112,13 +109,9 @@ async function compileTailwind(
112
109
  entryfile: string,
113
110
  files: string[]
114
111
  ): Promise<string> {
115
- entryfile = path.join(init.baseDirectory, entryfile);
116
-
117
112
  const entry = await fs.promises.readFile(entryfile, "utf-8");
118
113
  const contents = await Promise.all(
119
- files.map((file) =>
120
- fs.promises.readFile(path.join(init.baseDirectory, file), "utf-8")
121
- )
114
+ files.map((file) => fs.promises.readFile(file, "utf-8"))
122
115
  );
123
116
  const candidate = contents.map((content) => extract(content)).flat();
124
117
  const compiler = await compile(entry, { loadStylesheet });
@@ -127,9 +120,9 @@ async function compileTailwind(
127
120
  const result = init.skipLightning
128
121
  ? css
129
122
  : transform({
130
- filename: "input.css",
131
- code: new TextEncoder().encode(css)
132
- }).code;
123
+ filename: "input.css",
124
+ code: new TextEncoder().encode(css)
125
+ }).code;
133
126
 
134
127
  return typeof result === "string"
135
128
  ? result
@@ -150,8 +143,9 @@ async function tailwindBuilder(params: {
150
143
 
151
144
  const sources = params.sources.filter((s) => !s.endsWith(".css"));
152
145
  await initialize(params.initializeOptions);
153
- const css = await compileTailwind(params.resolved.at(0).importer, sources);
154
- const basename = path.basename(params.resolved.at(0).importer);
146
+ const entryfile = params.resolved.at(0).importer;
147
+ const css = await compileTailwind(entryfile, sources);
148
+ const basename = path.basename(entryfile);
155
149
 
156
150
  return [
157
151
  {
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@fullstacked/tailwindcss",
3
- "version": "4.3.2-patch.1",
3
+ "version": "4.3.2-patch.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
- "build": "esbuild --outfile=index.js index.ts"
6
+ "build": "esbuild --outfile=index.js index.ts",
7
+ "prepack": "npm run build"
7
8
  },
8
9
  "dependencies": {
9
10
  "lightningcss-wasm": "^1.32.0",