@pikacss/integration 0.0.10 → 0.0.12

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
@@ -212,6 +212,9 @@ async function createCtx(options) {
212
212
  devCss,
213
213
  autoCreateConfig
214
214
  } = options;
215
+ core.setWarnFn((...args) => {
216
+ console.warn(`[${currentPackageName}]`, ...args);
217
+ });
215
218
  const devCssFilepath = pathe.isAbsolute(devCss) ? pathe.resolve(devCss) : pathe.join(cwd, devCss);
216
219
  const tsCodegenFilepath = tsCodegen === false ? null : pathe.isAbsolute(tsCodegen) ? pathe.resolve(tsCodegen) : pathe.join(cwd, tsCodegen);
217
220
  const inlineConfig = typeof configOrPath === "object" ? configOrPath : null;
@@ -279,14 +282,14 @@ async function createCtx(options) {
279
282
  }
280
283
  ctx.usages.clear();
281
284
  const { config, file } = await ctx.loadConfig().catch((error) => {
282
- console.warn(`[${ctx.currentPackageName}] Failed to load config file: ${error}`);
285
+ core.warn(`Failed to load config file: ${error.message}`, error);
283
286
  return { config: null, file: null };
284
287
  });
285
288
  ctx.resolvedConfigPath = file;
286
289
  try {
287
290
  ctx.engine = await core.createEngine(config ?? {});
288
291
  } catch (error) {
289
- console.warn(`[${ctx.currentPackageName}] Failed to create engine: ${error}. Maybe the config file is invalid, falling back to default config.`);
292
+ core.warn(`Failed to create engine: ${error.message}. Maybe the config file is invalid, falling back to default config.`, error);
290
293
  ctx.engine = await core.createEngine({});
291
294
  }
292
295
  ctx.engine.config.plugins.unshift({
@@ -343,7 +346,7 @@ async function createCtx(options) {
343
346
  map: transformed.generateMap({ hires: true })
344
347
  };
345
348
  } catch (error) {
346
- console.warn(`[${ctx.currentPackageName}] Failed to transform code: ${error}`);
349
+ core.warn(`Failed to transform code: ${error.message}`, error);
347
350
  return void 0;
348
351
  }
349
352
  },
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { statSync } from 'node:fs';
2
2
  import { writeFile, mkdir, stat } from 'node:fs/promises';
3
- import { createEngine } from '@pikacss/core';
3
+ import { setWarnFn, warn, createEngine } from '@pikacss/core';
4
4
  export * from '@pikacss/core';
5
5
  import { createJiti } from 'jiti';
6
6
  import { isPackageExists } from 'local-pkg';
@@ -206,6 +206,9 @@ async function createCtx(options) {
206
206
  devCss,
207
207
  autoCreateConfig
208
208
  } = options;
209
+ setWarnFn((...args) => {
210
+ console.warn(`[${currentPackageName}]`, ...args);
211
+ });
209
212
  const devCssFilepath = isAbsolute(devCss) ? resolve(devCss) : join(cwd, devCss);
210
213
  const tsCodegenFilepath = tsCodegen === false ? null : isAbsolute(tsCodegen) ? resolve(tsCodegen) : join(cwd, tsCodegen);
211
214
  const inlineConfig = typeof configOrPath === "object" ? configOrPath : null;
@@ -273,14 +276,14 @@ async function createCtx(options) {
273
276
  }
274
277
  ctx.usages.clear();
275
278
  const { config, file } = await ctx.loadConfig().catch((error) => {
276
- console.warn(`[${ctx.currentPackageName}] Failed to load config file: ${error}`);
279
+ warn(`Failed to load config file: ${error.message}`, error);
277
280
  return { config: null, file: null };
278
281
  });
279
282
  ctx.resolvedConfigPath = file;
280
283
  try {
281
284
  ctx.engine = await createEngine(config ?? {});
282
285
  } catch (error) {
283
- console.warn(`[${ctx.currentPackageName}] Failed to create engine: ${error}. Maybe the config file is invalid, falling back to default config.`);
286
+ warn(`Failed to create engine: ${error.message}. Maybe the config file is invalid, falling back to default config.`, error);
284
287
  ctx.engine = await createEngine({});
285
288
  }
286
289
  ctx.engine.config.plugins.unshift({
@@ -337,7 +340,7 @@ async function createCtx(options) {
337
340
  map: transformed.generateMap({ hires: true })
338
341
  };
339
342
  } catch (error) {
340
- console.warn(`[${ctx.currentPackageName}] Failed to transform code: ${error}`);
343
+ warn(`Failed to transform code: ${error.message}`, error);
341
344
  return void 0;
342
345
  }
343
346
  },
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.10",
7
+ "version": "0.0.12",
8
8
  "author": "DevilTea <ch19980814@gmail.com>",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -40,14 +40,13 @@
40
40
  "magic-string": "^0.30.12",
41
41
  "micromatch": "^4.0.8",
42
42
  "pathe": "^2.0.3",
43
- "@pikacss/core": "0.0.10"
43
+ "@pikacss/core": "0.0.12"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/micromatch": "^4.0.9"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "unbuild",
50
- "build:pack": "pnpm build && pnpm pack",
51
50
  "stub": "unbuild --stub",
52
51
  "typecheck": "pnpm typecheck:package && pnpm typecheck:test",
53
52
  "typecheck:package": "tsc --project ./tsconfig.package.json --noEmit",