Skip to content

Commit 11f09cc

Browse files
committed
re-add barrel files for common imports
After profiling, it turns out that removing barrel files really doesn't have a performance impact for this use. We're keeping the more specific import paths, but als adding back some barrels for convenience.
1 parent 29c2ccb commit 11f09cc

File tree

15 files changed

+47
-12
lines changed

15 files changed

+47
-12
lines changed

.changeset/little-buses-worry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"@bluecadet/launchpad-cli": major
99
---
1010

11-
Remove barrel files. All packages no longer have an index export file that re-exports the public APIs. Instead, those APIs are accessible directly. This updates nearly all import paths across the entire launchpad ecosystem.
11+
Refactor package exports. Removed most re-exports from the index files, and added additional package export paths. Also refactored the launchpad meta package to generate export paths that match the individual packages. This updates nearly all import paths across the entire launchpad ecosystem.

biome.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
"useNumberNamespace": "error",
3232
"noInferrableTypes": "error",
3333
"noUselessElse": "error"
34-
},
35-
"performance": {
36-
"noBarrelFile": "error"
3734
}
3835
}
3936
},

docs/src/reference/content/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ npm install @bluecadet/launchpad-content
3939
## JS API Usage
4040

4141
```typescript
42-
import LaunchpadContent from '@bluecadet/launchpad-content';
42+
import { LaunchpadContent } from '@bluecadet/launchpad-content';
4343

4444
const content = LaunchpadContent({
4545
sources: [

docs/src/reference/monitor/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ npm install @bluecadet/launchpad-monitor
4343
## JS API Usage
4444

4545
```typescript
46-
import LaunchpadMonitor from '@bluecadet/launchpad-monitor';
46+
import { LaunchpadMonitor } from '@bluecadet/launchpad-monitor';
4747

4848
const monitor = new LaunchpadMonitor({
4949
apps: [

packages/cli/src/commands/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function content(argv: GlobalLaunchpadArgs) {
2525
},
2626
otherwise: (controller) => {
2727
// No daemon - need to instantiate subsystem and register it
28-
return importLaunchpadContent().andThen(({ default: LaunchpadContent }) => {
28+
return importLaunchpadContent().andThen(({ LaunchpadContent }) => {
2929
const contentInstance = new LaunchpadContent(configContent, rootLogger, dir);
3030
controller.registerSubsystem("content", contentInstance);
3131

packages/cli/src/commands/monitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function monitor(argv: GlobalLaunchpadArgs) {
2727
},
2828
otherwise: (controller) => {
2929
// No daemon - need to instantiate subsystem and register it
30-
return importLaunchpadMonitor().andThen(({ default: LaunchpadMonitor }) => {
30+
return importLaunchpadMonitor().andThen(({ LaunchpadMonitor }) => {
3131
const monitorInstance = new LaunchpadMonitor(configMonitor, rootLogger, dir);
3232
controller.registerSubsystem("monitor", monitorInstance);
3333

packages/cli/src/commands/start.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function startForeground(argv: GlobalLaunchpadArgs): ResultAsync<void, Error> {
110110
startupCommands.push({ type: "content.fetch" });
111111

112112
const contentConfig = config.content;
113-
return importLaunchpadContent().andThen(({ default: LaunchpadContent }) => {
113+
return importLaunchpadContent().andThen(({ LaunchpadContent }) => {
114114
const contentInstance = new LaunchpadContent(contentConfig, rootLogger, dir);
115115
controller.registerSubsystem("content", contentInstance);
116116
return contentInstance.loadSources();
@@ -124,7 +124,7 @@ function startForeground(argv: GlobalLaunchpadArgs): ResultAsync<void, Error> {
124124
startupCommands.push({ type: "monitor.connect" }, { type: "monitor.start" });
125125

126126
const monitorConfig = config.monitor;
127-
return importLaunchpadMonitor().andThen(({ default: LaunchpadMonitor }) => {
127+
return importLaunchpadMonitor().andThen(({ LaunchpadMonitor }) => {
128128
const monitorInstance = new LaunchpadMonitor(monitorConfig, rootLogger, dir);
129129
controller.registerSubsystem("monitor", monitorInstance);
130130
return ok();

packages/cli/src/commands/stop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function stop(argv: GlobalLaunchpadArgs) {
6767
console.log("Launchpad is not running.");
6868
console.log("Found monitor configuration, attempting to kill monitor process...");
6969

70-
return importLaunchpadMonitor().andThen(({ default: LaunchpadMonitor }) => {
70+
return importLaunchpadMonitor().andThen(({ LaunchpadMonitor }) => {
7171
const logger = LogManager.configureRootLogger();
7272
return LaunchpadMonitor.kill(logger);
7373
});

packages/cli/src/utils/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export async function loadConfigFromFile<T>(configPath: string): Promise<Partial
5959
return {};
6060
}
6161

62-
const jiti = createJiti(import.meta.url);
62+
const jiti = createJiti(import.meta.url, {
63+
fsCache: false,
64+
moduleCache: false,
65+
});
6366

6467
try {
6568
// need to use fileURLToPath here for windows support (prefixes with file://)

packages/content/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
],
1010
"exports": {
1111
".": {
12+
"types": "./dist/index.d.ts",
13+
"default": "./dist/index.js"
14+
},
15+
"./launchpad-content": {
1216
"types": "./dist/launchpad-content.d.ts",
1317
"default": "./dist/launchpad-content.js"
1418
},
@@ -32,6 +36,10 @@
3236
"types": "./dist/content-plugin.d.ts",
3337
"default": "./dist/content-plugin.js"
3438
},
39+
"./plugins": {
40+
"types": "./dist/plugins/index.d.ts",
41+
"default": "./dist/plugins/index.js"
42+
},
3543
"./plugins/md-to-html": {
3644
"types": "./dist/plugins/md-to-html.d.ts",
3745
"default": "./dist/plugins/md-to-html.js"
@@ -68,6 +76,10 @@
6876
"types": "./dist/source.d.ts",
6977
"default": "./dist/source.js"
7078
},
79+
"./sources": {
80+
"types": "./dist/sources/index.d.ts",
81+
"default": "./dist/sources/index.js"
82+
},
7183
"./sources/airtable": {
7284
"types": "./dist/sources/airtable-source.d.ts",
7385
"default": "./dist/sources/airtable-source.js"

0 commit comments

Comments
 (0)