Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/little-buses-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@bluecadet/launchpad-controller": major
"@bluecadet/launchpad": major
"@bluecadet/launchpad-scaffold": major
"@bluecadet/launchpad-content": major
"@bluecadet/launchpad-monitor": major
"@bluecadet/launchpad-utils": major
"@bluecadet/launchpad-cli": major
---

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.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"files": {
"ignoreUnknown": false,
"includes": ["**/src/**/*.ts", "**/docs/**/*.ts", "**/docs/**/*.mts"]
"includes": ["**/src/**/*.ts", "**/docs/**/*.ts", "**/docs/**/*.mts", "**/scripts/**/*.ts"]
},
"formatter": {
"enabled": true,
Expand Down
5 changes: 3 additions & 2 deletions docs/src/guides/downloading-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ First, add the `mediaDownloader` plugin to your configuration:

```ts
import { defineConfig } from '@bluecadet/launchpad-cli';
import { mediaDownloader } from '@bluecadet/launchpad-content';
import { mediaDownloader } from '@bluecadet/launchpad-content/plugins/media-downloader';

export default defineConfig({
content: {
Expand Down Expand Up @@ -49,7 +49,8 @@ Add the sharp plugin *after* the media downloader:

```ts{8-13}
import { defineConfig } from '@bluecadet/launchpad-cli';
import { mediaDownloader, sharp } from '@bluecadet/launchpad-content';
import { mediaDownloader } from '@bluecadet/launchpad-content/plugins/media-downloader';
import { sharp } from '@bluecadet/launchpad-content/plugins/sharp';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guides/fetching-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Content fetching requires a `ContentConfig` object in your Launchpad configurati
```js
// launchpad.config.js
import { defineConfig } from '@bluecadet/launchpad-cli';
import { jsonSource } from '@bluecadet/launchpad-content';
import { jsonSource } from '@bluecadet/launchpad-content/sources/json';

export default defineConfig({
content: {
Expand Down
7 changes: 6 additions & 1 deletion docs/src/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ Alternatively, install everything at once:
npm install @bluecadet/launchpad
```

> [!TIP]
> These docs assume you have installed the packages individually. If you installed the monorepo package (`@bluecadet/launchpad`), you can adjust the import paths by replacing `@bluecadet/launchpad-` with `@bluecadet/launchpad/`.
>
> For example, `@bluecadet/launchpad-content/plugins/sharp` becomes `@bluecadet/launchpad/content/plugins/sharp`.

## Basic Setup

1. Create a configuration file:

```js
// launchpad.config.js (or launchpad.config.ts, launchpad.config.mjs, etc.)
import { defineConfig } from '@bluecadet/launchpad-cli';
import { jsonSource } from '@bluecadet/launchpad-content';
import { jsonSource } from '@bluecadet/launchpad-content/sources/json';

export default defineConfig({
content: {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/recipes/custom-content-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Content sources in Launchpad:
Here's a minimal content source example:

```typescript
import { defineSource } from '@bluecadet/launchpad-content';
import { defineSource } from '@bluecadet/launchpad-content/source';

export default defineSource({
id: 'my-custom-source',
Expand All @@ -34,7 +34,7 @@ export default defineSource({
Let's create a source that fetches data from a REST API:

```typescript
import { defineSource } from '@bluecadet/launchpad-content';
import { defineSource } from '@bluecadet/launchpad-content/source';

const myApiSource = defineSource({
id: 'api-source',
Expand Down
11 changes: 6 additions & 5 deletions docs/src/recipes/transforming-sanity-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ When working with Sanity.io images, you can leverage Sanity's built-in image tra
First, ensure your GROQ query includes all necessary image fields:

```typescript{12-17}
import { defineConfig } from '@bluecadet/launchpad-core';
import { sanitySource } from '@bluecadet/launchpad-content';
import { defineConfig } from '@bluecadet/launchpad-cli';
import { sanitySource } from '@bluecadet/launchpad-content/sources/sanity';

export default defineConfig({
content: {
Expand Down Expand Up @@ -40,9 +40,10 @@ The `asset->` reference is crucial for accessing the full image data, including

Add the `sanityImageUrlTransform` plugin to transform image references into URLs:

```typescript{14-22}
import { defineConfig } from '@bluecadet/launchpad-core';
import { sanityImageUrlTransform, sanitySource } from '@bluecadet/launchpad-content';
```typescript{15-23}
import { defineConfig } from '@bluecadet/launchpad-cli';
import { sanitySource } from '@bluecadet/launchpad-content/sources/sanity';
import { sanityImageUrlTransform } from '@bluecadet/launchpad-content/plugins/sanity-image-url-transform';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/cli/config-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ When using TypeScript or an editor with TypeScript support (like VS Code), the `

```js
import { defineConfig } from '@bluecadet/launchpad-cli';
import { jsonSource } from '@bluecadet/launchpad-content';
import { jsonSource } from '@bluecadet/launchpad-content/sources/json';

export default defineConfig({
content: {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ The content package is a powerful tool for downloading, transforming, and managi
npm install @bluecadet/launchpad-content
```

## Basic Usage
## JS API Usage

```typescript
import LaunchpadContent from '@bluecadet/launchpad-content';
import { LaunchpadContent } from '@bluecadet/launchpad-content';

const content = LaunchpadContent({
sources: [
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/md-to-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `mdToHtml` plugin is used to transform Markdown content into HTML. It suppor
To use the `mdToHtml` plugin, include it in the list of content plugins in your configuration:

```typescript{1,6-8}
import { mdToHtml } from '@bluecadet/launchpad-content';
import { mdToHtml } from '@bluecadet/launchpad-content/plugins/md-to-html';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/media-downloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Downloaded media files are colocated with the sources that reference them.
To use the `mediaDownloader` plugin, include it in the list of content plugins in your configuration:

```typescript{1,6-8}
import { mediaDownloader } from '@bluecadet/launchpad-content';
import { mediaDownloader } from '@bluecadet/launchpad-content/plugins/media-downloader';

export default defineConfig({
content: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `sanityImageUrlTransform` plugin transforms Sanity image references into usa
To use the `sanityImageUrlTransform` plugin, include it in your configuration before your `mediaDownloader` plugin:

```typescript{1,6-12}
import { sanityImageUrlTransform } from '@bluecadet/launchpad-content';
import { sanityImageUrlTransform } from '@bluecadet/launchpad-content/plugins/sanity-image-url-transform';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/sanity-to-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `sanityToHtml` plugin is used to transform Sanity.io Portable Text content i
To use the `sanityToHtml` plugin, include it in the list of content plugins in your configuration:

```typescript{1,6-8}
import { sanityToHtml } from '@bluecadet/launchpad-content';
import { sanityToHtml } from '@bluecadet/launchpad-content/plugins/sanity-to-html';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/sanity-to-md.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `sanityToMd` plugin is used to transform Sanity.io Portable Text content int
To use the `sanityToMd` plugin, include it in the list of content plugins in your configuration:

```typescript{1,6-8}
import { sanityToMd } from '@bluecadet/launchpad-content';
import { sanityToMd } from '@bluecadet/launchpad-content/plugins/sanity-to-md';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/sanity-to-plain.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `sanityToPlain` plugin is used to transform Sanity.io Portable Text content
To use the `sanityToPlain` plugin, include it in the list of content plugins in your configuration:

```typescript{1,6-8}
import { sanityToPlain } from '@bluecadet/launchpad-content';
import { sanityToPlain } from '@bluecadet/launchpad-content/plugins/sanity-to-plain';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/sharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `sharp` plugin is used to transform downloaded images using the [Sharp](http
To use the `sharp` plugin, include it in the list of content plugins after the mediaDownloader in your configuration:

```typescript{1,7-12}
import { sharp } from '@bluecadet/launchpad-content';
import { sharp } from '@bluecadet/launchpad-content/plugins/sharp';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/plugins/symlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The `symlink` plugin is used to create symbolic links between files or directori
## Usage

```typescript
import { symlink } from '@bluecadet/launchpad-content';
import { symlink } from '@bluecadet/launchpad-content/plugins/symlink';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/sources/airtable-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `airtableSource` content source is used to fetch data from Airtable. It supp
To use the `airtableSource` content source, include it in the list of content sources in your configuration:

```typescript{1,6-12}
import { airtableSource } from '@bluecadet/launchpad-content';
import { airtableSource } from '@bluecadet/launchpad-content/sources/airtable';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/sources/contentful-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `contentfulSource` content source is used to fetch entries and assets from C
To use the `contentfulSource` content source, include it in the list of content sources in your configuration:

```typescript{1,6-13}
import { contentfulSource } from '@bluecadet/launchpad-content';
import { contentfulSource } from '@bluecadet/launchpad-content/sources/contentful';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/sources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The fetched data, either as a promise returning a single document or an async it
To define a custom content source, use the `defineSource` function:

```typescript
import { defineSource } from '@bluecadet/launchpad-content';
import { defineSource } from '@bluecadet/launchpad-content/source';

export default defineSource({
id: 'myCustomSource',
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/sources/json-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `jsonSource` content source is used to fetch data from JSON endpoints via HT
To use the `jsonSource` content source, include it in the list of content sources in your configuration:

```typescript{1,6-13}
import { jsonSource } from '@bluecadet/launchpad-content';
import { jsonSource } from '@bluecadet/launchpad-content/sources/json';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/sources/sanity-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `sanitySource` content source is used to fetch data from Sanity.io. It suppo
To use the `sanitySource` content source, include it in the list of content sources in your configuration:

```typescript{1,6-15}
import { sanitySource } from '@bluecadet/launchpad-content';
import { sanitySource } from '@bluecadet/launchpad-content/sources/sanity';

export default defineConfig({
content: {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/content/sources/strapi-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `strapiSource` content source is used to fetch data from Strapi CMS. It supp
To use the `strapiSource` content source, include it in the list of content sources in your configuration:

```typescript{1,6-13}
import { strapiSource } from '@bluecadet/launchpad-content';
import { strapiSource } from '@bluecadet/launchpad-content/sources/strapi';

export default defineConfig({
content: {
Expand Down
2 changes: 0 additions & 2 deletions docs/src/reference/controller/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Events are fully type-safe through TypeScript declaration merging. Each subsyste

```typescript
import { LaunchpadController } from '@bluecadet/launchpad-controller';
import '@bluecadet/launchpad-content'; // Import content event types
import '@bluecadet/launchpad-monitor'; // Import monitor event types

const controller = new LaunchpadController(config, logger);
const eventBus = controller.getEventBus();
Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/monitor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ The monitor package is a robust process management and monitoring tool designed
npm install @bluecadet/launchpad-monitor
```

## Basic Usage
## JS API Usage

```typescript
import LaunchpadMonitor from '@bluecadet/launchpad-monitor';
import { LaunchpadMonitor } from '@bluecadet/launchpad-monitor';

const monitor = new LaunchpadMonitor({
apps: [
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/scaffold/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ npx launchpad scaffold
> [!NOTE] Note:
> The scaffold package primarily consists of PowerShell scripts and batch files. The npm package provides minimal JavaScript adapters to enable programmatic usage through the JavaScript API shown below.

## JavaScript API Usage
## JS API Usage

```typescript
import { launchScaffold } from '@bluecadet/launchpad-scaffold';
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/launchpad-config.d.ts",
"default": "./dist/launchpad-config.js"
},
"./package.json": "./package.json"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import { hideBin } from "yargs/helpers";
import yargs from "yargs/yargs";

export { defineConfig } from "./launchpad-config.js";

export type GlobalLaunchpadArgs = {
config?: string;
env?: (string | number)[];
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function content(argv: GlobalLaunchpadArgs) {
},
otherwise: (controller) => {
// No daemon - need to instantiate subsystem and register it
return importLaunchpadContent().andThen(({ default: LaunchpadContent }) => {
return importLaunchpadContent().andThen(({ LaunchpadContent }) => {
const contentInstance = new LaunchpadContent(configContent, rootLogger, dir);
controller.registerSubsystem("content", contentInstance);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function monitor(argv: GlobalLaunchpadArgs) {
},
otherwise: (controller) => {
// No daemon - need to instantiate subsystem and register it
return importLaunchpadMonitor().andThen(({ default: LaunchpadMonitor }) => {
return importLaunchpadMonitor().andThen(({ LaunchpadMonitor }) => {
const monitorInstance = new LaunchpadMonitor(configMonitor, rootLogger, dir);
controller.registerSubsystem("monitor", monitorInstance);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/scaffold.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { launchScaffold } from "@bluecadet/launchpad-scaffold";
import { LogManager } from "@bluecadet/launchpad-utils";
import { LogManager } from "@bluecadet/launchpad-utils/log-manager";
import type { GlobalLaunchpadArgs } from "../cli.js";

export async function scaffold(_argv: GlobalLaunchpadArgs) {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/start.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fork } from "node:child_process";
import fs from "node:fs";
import type { BaseCommand } from "@bluecadet/launchpad-utils";
import type { BaseCommand } from "@bluecadet/launchpad-utils/controller-interfaces";
import { fromPromise, ok, okAsync, type ResultAsync } from "neverthrow";
import type { GlobalLaunchpadArgs } from "../cli.js";
import { handleFatalError, initializeLogger, loadConfigAndEnv } from "../utils/command-utils.js";
Expand Down Expand Up @@ -110,7 +110,7 @@ function startForeground(argv: GlobalLaunchpadArgs): ResultAsync<void, Error> {
startupCommands.push({ type: "content.fetch" });

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

const monitorConfig = config.monitor;
return importLaunchpadMonitor().andThen(({ default: LaunchpadMonitor }) => {
return importLaunchpadMonitor().andThen(({ LaunchpadMonitor }) => {
const monitorInstance = new LaunchpadMonitor(monitorConfig, rootLogger, dir);
controller.registerSubsystem("monitor", monitorInstance);
return ok();
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import type { LaunchpadState } from "@bluecadet/launchpad-controller";
import { onExit } from "@bluecadet/launchpad-utils";
import { onExit } from "@bluecadet/launchpad-utils/on-exit";
import ansiEscapes from "ansi-escapes";
import chalk from "chalk";
import { okAsync, ResultAsync } from "neverthrow";
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/stop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import { deletePidFile, isProcessRunning } from "@bluecadet/launchpad-controller";
import { LogManager } from "@bluecadet/launchpad-utils";
import { deletePidFile, isProcessRunning } from "@bluecadet/launchpad-controller/pid-utils";
import { LogManager } from "@bluecadet/launchpad-utils/log-manager";
import { err, ok, type Result, ResultAsync } from "neverthrow";
import type { GlobalLaunchpadArgs } from "../cli.js";
import { loadConfigAndEnv } from "../utils/command-utils.js";
Expand Down Expand Up @@ -67,7 +67,7 @@ export function stop(argv: GlobalLaunchpadArgs) {
console.log("Launchpad is not running.");
console.log("Found monitor configuration, attempting to kill monitor process...");

return importLaunchpadMonitor().andThen(({ default: LaunchpadMonitor }) => {
return importLaunchpadMonitor().andThen(({ LaunchpadMonitor }) => {
const logger = LogManager.configureRootLogger();
return LaunchpadMonitor.kill(logger);
});
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/cli/src/launchpad-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { controllerConfigSchema } from "@bluecadet/launchpad-controller";
import type { LaunchpadConfig } from "@bluecadet/launchpad-utils";
import { controllerConfigSchema } from "@bluecadet/launchpad-controller/config";
import type { LaunchpadConfig } from "@bluecadet/launchpad-utils/types";

/**
* Applies defaults to the provided launchpad config.
Expand Down
Loading