boss-css 0.0.21 → 0.0.23

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.
@@ -88,7 +88,6 @@ const runPostcss = async (root, result, options = {}) => {
88
88
  promises.push(processFile(file));
89
89
  });
90
90
  const processedFiles = await Promise.allSettled(promises);
91
- const onParseTasks = [];
92
91
  for (const settled of processedFiles) {
93
92
  if (settled.status !== "fulfilled") continue;
94
93
  const processed = settled.value;
@@ -97,19 +96,15 @@ const runPostcss = async (root, result, options = {}) => {
97
96
  const changedPath = value.path ? path.resolve(value.path) : null;
98
97
  if (changedPath) api.css?.removeSource?.(changedPath);
99
98
  const sourcePath = changedPath ?? value.path ?? "(unknown file)";
100
- onParseTasks.push({
101
- filePath: sourcePath,
102
- promise: api.trigger("onParse", value)
103
- });
99
+ try {
100
+ await api.trigger("onParse", value);
101
+ } catch (parseError) {
102
+ const relativePath = path.relative(baseDir ?? process.cwd(), sourcePath);
103
+ const sourceLabel = relativePath && !relativePath.startsWith("..") ? relativePath : sourcePath;
104
+ const reason = parseError instanceof Error ? parseError.message : String(parseError ?? "Unknown parsing error");
105
+ result.warn(`[boss-css] Failed parsing ${sourceLabel}: ${reason}`, { plugin: "boss-postcss-plugin" });
106
+ }
104
107
  }
105
- (await Promise.allSettled(onParseTasks.map((task) => task.promise))).forEach((parseResult, index) => {
106
- if (parseResult.status !== "rejected") return;
107
- const task = onParseTasks[index];
108
- const relativePath = path.relative(baseDir ?? process.cwd(), task.filePath);
109
- const sourceLabel = relativePath && !relativePath.startsWith("..") ? relativePath : task.filePath;
110
- const reason = parseResult.reason instanceof Error ? parseResult.reason.message : String(parseResult.reason ?? "Unknown parsing error");
111
- result.warn(`[boss-css] Failed parsing ${sourceLabel}: ${reason}`, { plugin: "boss-postcss-plugin" });
112
- });
113
108
  const boundaryResult = await resolveBoundaryOutputs(api, {
114
109
  rootDir: baseDir ?? process.cwd(),
115
110
  stylesheetPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boss-css",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Polymorphic, usage-driven CSS-in-JS.",
5
5
  "bin": {
6
6
  "boss": "./dist/cli/index.cjs",