Skip to content

Commit

Permalink
fix(runtime-logger): Use unique names for internal plugins (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryuni authored Nov 12, 2024
1 parent aa73961 commit 23b89bf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-poems-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@inox-tools/runtime-logger': patch
---

Fixes internal plugins having the same name causing incorrect warnings when building
2 changes: 1 addition & 1 deletion packages/runtime-logger/src/buildLoggerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { INTERNAL_MODULE } from './internalPlugin.js';
const MODULE_PREFIX = '@it-astro:logger:';
const RESOLVED_MODULE_PREFIX = '\x00@it-astro:logger:';

const pluginName = '@inox-tools/runtime-logger/dev';
const pluginName = '@inox-tools/runtime-logger/integrations';

export const buildLoggerPlugin = (loggers: Map<string, AstroIntegrationLogger>): Plugin => {
(globalThis as any)[Symbol.for(pluginName)] = loggers;
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-logger/src/devLoggerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { AstroIntegrationLogger } from 'astro';
const MODULE_PREFIX = '@it-astro:logger:';
const RESOLVED_MODULE_PREFIX = '\x00@it-astro:logger:';

const pluginName = '@inox-tools/runtime-logger/dev';
const pluginName = '@inox-tools/runtime-logger/integrations';

export const devLoggerPlugin = (loggers: Map<string, AstroIntegrationLogger>): Plugin => {
(globalThis as any)[Symbol.for(pluginName)] = loggers;
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-logger/src/projectLoggerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const VIRTUAL_MODULE = '@it-astro:logger';
const RESOLVED_VIRTUAL_MODULE = '\x00@it-astro:logger?';

export const projectLoggerPlugin = (rootPath: string): Plugin => ({
name: '@inox-tools/runtime-logger/dev',
name: '@inox-tools/runtime-logger/project',
resolveId(id, importer) {
if (id === VIRTUAL_MODULE) {
const params = new URLSearchParams();
Expand Down

0 comments on commit 23b89bf

Please sign in to comment.