@pikacss/integration 0.0.5 → 0.0.6

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.
package/dist/index.cjs CHANGED
@@ -275,8 +275,8 @@ async function createCtx(options) {
275
275
  if (inlineConfig != null)
276
276
  return { config: inlineConfig, file: null };
277
277
  let resolvedConfigPath = configSources.find((path) => {
278
- const stat = node_fs.statSync(path, { throwIfNoEntry: false });
279
- return stat != null && stat.isFile();
278
+ const stat2 = node_fs.statSync(path, { throwIfNoEntry: false });
279
+ return stat2 != null && stat2.isFile();
280
280
  });
281
281
  if (resolvedConfigPath == null) {
282
282
  if (autoCreateConfig === false)
@@ -304,7 +304,8 @@ async function createCtx(options) {
304
304
  ctx.isReady = false;
305
305
  await promises.mkdir(pathe.dirname(devCssFilepath), { recursive: true }).catch(() => {
306
306
  });
307
- await promises.writeFile(devCssFilepath, "");
307
+ if ((await promises.stat(devCssFilepath)).isFile() === false)
308
+ await promises.writeFile(devCssFilepath, "");
308
309
  if (tsCodegenFilepath != null) {
309
310
  await promises.mkdir(pathe.dirname(tsCodegenFilepath), { recursive: true }).catch(() => {
310
311
  });
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { statSync } from 'node:fs';
2
- import { writeFile, mkdir } from 'node:fs/promises';
2
+ import { writeFile, mkdir, stat } from 'node:fs/promises';
3
3
  import { createEngine } from '@pikacss/core';
4
4
  export * from '@pikacss/core';
5
5
  import { createJiti } from 'jiti';
@@ -256,8 +256,8 @@ async function createCtx(options) {
256
256
  if (inlineConfig != null)
257
257
  return { config: inlineConfig, file: null };
258
258
  let resolvedConfigPath = configSources.find((path) => {
259
- const stat = statSync(path, { throwIfNoEntry: false });
260
- return stat != null && stat.isFile();
259
+ const stat2 = statSync(path, { throwIfNoEntry: false });
260
+ return stat2 != null && stat2.isFile();
261
261
  });
262
262
  if (resolvedConfigPath == null) {
263
263
  if (autoCreateConfig === false)
@@ -285,7 +285,8 @@ async function createCtx(options) {
285
285
  ctx.isReady = false;
286
286
  await mkdir(dirname(devCssFilepath), { recursive: true }).catch(() => {
287
287
  });
288
- await writeFile(devCssFilepath, "");
288
+ if ((await stat(devCssFilepath)).isFile() === false)
289
+ await writeFile(devCssFilepath, "");
289
290
  if (tsCodegenFilepath != null) {
290
291
  await mkdir(dirname(tsCodegenFilepath), { recursive: true }).catch(() => {
291
292
  });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.5",
7
+ "version": "0.0.6",
8
8
  "author": "DevilTea <ch19980814@gmail.com>",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "micromatch": "^4.0.8",
42
42
  "pathe": "^2.0.3",
43
43
  "prettier": "^3.2.5",
44
- "@pikacss/core": "0.0.5"
44
+ "@pikacss/core": "0.0.6"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/micromatch": "^4.0.9"