@fullstacked/tailwindcss 4.3.2-patch.0 → 4.3.2-patch.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/index.ts +12 -15
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -8,16 +8,14 @@ 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;
15
14
 
16
15
  type InitializeOpts = {
17
- oxide: string;
18
- tailwindcss: string;
19
- lightningcss: string;
20
- baseDirectory?: string;
16
+ oxide?: string;
17
+ tailwindcss?: string;
18
+ lightningcss?: 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,12 +109,10 @@ 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
114
  files.map((file) =>
120
- fs.promises.readFile(path.join(init.baseDirectory, file), "utf-8")
115
+ fs.promises.readFile(file, "utf-8")
121
116
  )
122
117
  );
123
118
  const candidate = contents.map((content) => extract(content)).flat();
@@ -127,9 +122,9 @@ async function compileTailwind(
127
122
  const result = init.skipLightning
128
123
  ? css
129
124
  : transform({
130
- filename: "input.css",
131
- code: new TextEncoder().encode(css)
132
- }).code;
125
+ filename: "input.css",
126
+ code: new TextEncoder().encode(css)
127
+ }).code;
133
128
 
134
129
  return typeof result === "string"
135
130
  ? result
@@ -148,10 +143,12 @@ async function tailwindBuilder(params: {
148
143
  return [];
149
144
  }
150
145
 
151
- const sources = params.sources.filter((s) => !s.endsWith(".css"));
146
+ const sources = params.sources
147
+ .filter((s) => !s.endsWith(".css"));
152
148
  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);
149
+ const entryfile = params.resolved.at(0).importer;
150
+ const css = await compileTailwind(entryfile, sources);
151
+ const basename = path.basename(entryfile);
155
152
 
156
153
  return [
157
154
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacked/tailwindcss",
3
- "version": "4.3.2-patch.0",
3
+ "version": "4.3.2-patch.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "esbuild --outfile=index.js index.ts"