Skip to content

Commit 5703331

Browse files
committed
fix PLUGIN_ID used before module load
1 parent 3d3d935 commit 5703331

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

components/cpath.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'node:fs/promises';
22
import * as path from 'node:path';
33

4-
import { PLUGIN_ID } from '#gc';
4+
import PLUGIN_ID from '#gc.id';
55

66
const cwd = process.cwd();
77

components/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const PLUGIN_ID = 'anon-plugin';
2-
31
import Common from './import/common.js';
42
import Logger from './import/logger.js';
53
import Plugin from './import/plugin.js';
@@ -13,7 +11,6 @@ import TodaysFortunePicker from './todays_fortune/picker.js';
1311
import * as Quotes from './quotes/index.js';
1412

1513
export {
16-
PLUGIN_ID,
1714
Common,
1815
Logger,
1916
Plugin,

components/plugin_id.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const PLUGIN_ID = 'anon-plugin';
2+
export default PLUGIN_ID;

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'node:fs'
22

3-
import { PLUGIN_ID, Path, Logger, Config, ensurePathExists } from '#gc';
3+
import PLUGIN_ID from '#gc.id';
4+
import { Path, Logger, Config, ensurePathExists } from '#gc';
45

56
const apps = await (async () => {
67
await ensurePathExists();

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"imports": {
1616
"#gc": "./components/index.js",
17+
"#gc.id": "./components/plugin_id.js",
1718
"#gc.model": "./model/index.js",
1819
"#gc.res": "./resources/index.js",
1920
"#@/*": "./*"

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"paths": {
1515
"#@/*": ["./*"],
1616
"#gc": ["./components/index.js"],
17+
"#gc.id": ["./components/plugin_id.js"],
1718
"#gc.res": ["./resources/index.js"],
1819
"#gc.models": ["./models/index.js"],
1920
"*": ["./node_modules/*", "./components/types/*"]

0 commit comments

Comments
 (0)