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
21 changes: 21 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"semi": false,
"quoteProps": "consistent",
"singleQuote": false,
"printWidth": 120,
"sortPackageJson": true,
"sortImports": {
"newlinesBetween": false,
"groups": [
"type-import",
["value-builtin", "value-external"],
"type-internal",
"value-internal",
["type-parent", "type-sibling", "type-index"],
["value-parent", "value-sibling", "value-index"],
"unknown"
]
},
"ignorePatterns": ["package-lock.json", "pnpm-lock.yaml", "yarn.lock", "empty-sandbox.js"]
}
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

6 changes: 3 additions & 3 deletions documentation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "documentation",
"type": "module",
"version": "0.0.1",
"contributors": [
{
Expand All @@ -12,6 +11,7 @@
"url": "https://github.com/binjospookie"
}
],
"type": "module",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -31,9 +31,9 @@
"sharp": "0.34.5",
"starlight-llms-txt": "0.7.0"
},
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a",
"devDependencies": {
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3"
}
},
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a"
}
2 changes: 1 addition & 1 deletion documentation/src/components/sandbox/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SandpackEditor from './index.tsx';
import { Code } from "@astrojs/starlight/components"

const { code: rawCode, template, options, files } = Astro.props;
const sourceCode = rawCode.replace(/^[ \t]*\/\/\s*prettier-ignore[ \t]*\r?\n?/gm, '');
const sourceCode = rawCode.replace(/^[ \t]*\/\/\s*oxfmt-ignore[ \t]*\r?\n?/gm, '');
---

<Code class="sandbox-code" code={sourceCode} lang="ts" />
Expand Down
26 changes: 11 additions & 15 deletions documentation/src/components/sandbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ import {
} from "@codesandbox/sandpack-react"
import { APP_COMPOSE_JS } from "virtual:app-compose-js"
import { Editor } from "./editor/index"
import { Output } from "./output"
import { sandboxStyle } from "./sandboxStyle"
import { useTheme } from "./useTheme"
import { Output } from "./output"

type Props = {
code: string
template?: SandpackPredefinedTemplate
files?: Record<string, string>
options?: Pick<
SandpackOptions,
"showConsole" | "editorHeight" | "editorWidthPercentage" | "showConsoleButton"
> & {
options?: Pick<SandpackOptions, "showConsole" | "editorHeight" | "editorWidthPercentage" | "showConsoleButton"> & {
layout?: SandpackOptions["layout"] | "tests"
hideOutput: boolean
storageKey?: string
Expand All @@ -30,16 +27,15 @@ const SandpackEditor = ({ code: __code, template = "react", options, files = {}

const theme = useTheme()
const isTests = options?.layout === "tests"
const fileName =
isTests
? "index.test.ts"
: template === "react"
? "App.js"
: template === "react-ts"
? "App.tsx"
: template === "vanilla-ts"
? "index.ts"
: "index.js"
const fileName = isTests
? "index.test.ts"
: template === "react"
? "App.js"
: template === "react-ts"
? "App.tsx"
: template === "vanilla-ts"
? "index.ts"
: "index.js"

const lines = code.replace(/\r\n/g, "\n").split("\n").length
const fullEditorHeight = options?.editorHeight ?? lines * 18
Expand Down
8 changes: 7 additions & 1 deletion documentation/src/components/sandbox/output.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { SandpackConsole, SandpackPreview, SandpackStack, SandpackTests, type SandpackOptions } from "@codesandbox/sandpack-react"
import {
SandpackConsole,
SandpackPreview,
SandpackStack,
SandpackTests,
type SandpackOptions,
} from "@codesandbox/sandpack-react"

type Props = Pick<SandpackOptions, "showConsole"> & {
layout?: SandpackOptions["layout"] | "tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ When you need only part of a task result or want to change its shape, `map` lets
If the source value is missing — because an upstream task failed or was skipped — `map` will not call your callback
and the downstream task will be silently skipped.
<br />
To handle a missing value explicitly, wrap the source with `optional` — in that case the callback receives `undefined` instead.
To handle a missing value explicitly, wrap the source with `optional` — in that case the callback receives `undefined`
instead.
</Aside>

<br />
Expand Down
4 changes: 2 additions & 2 deletions documentation/src/content/docs/home/graph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// prettier-ignore
// oxfmt-ignore
import {
bind,compose,createTag,createTask,optional
bind, compose, createTag, createTask, optional
} from "@grlt-hub/app-compose"

const tag = createTag<string>({ name: "title" })
Expand Down
4 changes: 2 additions & 2 deletions documentation/src/content/docs/home/isolation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// prettier-ignore
// oxfmt-ignore
import {
bind,compose,createTag,createTask
bind, compose, createTag, createTask
} from "@grlt-hub/app-compose"

const user = createTask({
Expand Down
4 changes: 2 additions & 2 deletions documentation/src/content/docs/home/reuse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// prettier-ignore
// oxfmt-ignore
import {
bind,compose,createTag,createTask,literal
bind, compose, createTag, createTask, literal
} from "@grlt-hub/app-compose";

const label = createTag<string>({ name: "label" })
Expand Down
7 changes: 3 additions & 4 deletions documentation/src/content/docs/learn/linting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ Use your preferred package manager.

Import the plugin and add it to your config. Use the recommended preset for a quick start.

{/* prettier-ignore */}
{/* oxfmt-ignore */}

```js
import appCompose from "@grlt-hub/eslint-plugin-app-compose"

export default tseslint.config(
appCompose.configs.recommended
)
export default tseslint.config(appCompose.configs.recommended)
```

You can also configure it manually.
Expand Down
3 changes: 2 additions & 1 deletion documentation/src/content/docs/learn/quick-start/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ This tells App-Compose that the value is data, not a reference to another Task o
/>

<Aside type="caution">
Prefer routing static values through a tag via `bind(tag, literal(value))`. Using `literal` directly in `run.context` bakes the value into the task — it can no longer be reused without modifying it.
Prefer routing static values through a tag via `bind(tag, literal(value))`. Using `literal` directly in `run.context`
bakes the value into the task — it can no longer be reused without modifying it.
</Aside>

## How to disable a Task
Expand Down
5 changes: 3 additions & 2 deletions documentation/src/content/docs/learn/typescript/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ Extracts the return type of a given Task.

Represents the possible execution outcomes of a Task.

{/* prettier-ignore */}
{/* oxfmt-ignore */}

```ts
type TaskStatus = 'done' | 'fail' | 'skip'
type TaskStatus = "done" | "fail" | "skip"
```

### Task&lt;T&gt;
Expand Down
4 changes: 2 additions & 2 deletions documentation/src/content/docs/sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// prettier-ignore
// oxfmt-ignore
import {
bind,compose,createTag,createTask,literal,optional
bind, compose, createTag, createTask, literal, optional
} from "@grlt-hub/app-compose"

const task = createTask({
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ h2.section-title {

:root {
--sl-content-width: 60rem;
--sl-color-text-accent: #58DC58;
--sl-color-text-accent: #58dc58;
}

.hero {
Expand Down
1 change: 0 additions & 1 deletion documentation/src/virtual.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ declare module "virtual:app-compose-dts" {
declare module "virtual:app-compose-js" {
export const APP_COMPOSE_JS: string
}

13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"name": "@grlt-hub/app-compose-dev",
"private": true,
"version": "3.0.0",
"private": true,
"homepage": "https://app-compose.dev",
"repository": {
"type": "git",
"url": "git+https://github.com/grlt-hub/app-compose.git"
},
"license": "MIT",
"contributors": [
{
Expand All @@ -18,6 +14,10 @@
"url": "https://github.com/binjospookie"
}
],
"repository": {
"type": "git",
"url": "git+https://github.com/grlt-hub/app-compose.git"
},
"type": "module",
"scripts": {
"doc:dev": "pnpm --filter ./packages/app-compose build && pnpm --dir ./documentation run dev",
Expand All @@ -31,9 +31,8 @@
"@types/node": "25.5.0",
"@vitest/coverage-v8": "4.1.2",
"knip": "6.1.0",
"oxfmt": "0.42.0",
"oxlint": "1.57.0",
"prettier": "3.8.1",
"prettier-plugin-organize-imports": "4.3.0",
"tsdown": "0.21.7",
"typescript": "6.0.2",
"vitest": "4.1.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compose/knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "https://unpkg.com/knip@5/schema.json",
"ignore": ["**/__tests__/**", "*.config.ts"],
"entry": ["./src/index.ts!"],
"ignoreBinaries": ["tsdown", "knip", "oxlint", "vitest"],
"ignoreBinaries": ["tsdown", "knip", "oxlint", "vitest", "oxfmt"],
"vitest": { "config": "vitest.config.ts", "entry": "src/**/*.{test,test-d,bench}.ts" }
}
30 changes: 15 additions & 15 deletions packages/app-compose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@
"name": "@grlt-hub/app-compose",
"version": "3.0.0-beta.0",
"private": false,
"publishConfig": {
"access": "public"
},
"description": "App-Compose is a TypeScript library that structures your frontend app around isolated tasks, explicit context, and predictable startup — by design.",
"keywords": [
"grlt",
"grlt-hub",
"app-compose",
"dependency-injection",
"di",
"grlt",
"grlt-hub",
"inversion-of-control",
"ioc",
"modular",
"typescript"
],
"homepage": "https://app-compose.dev",
"repository": {
"type": "git",
"url": "git+https://github.com/grlt-hub/app-compose.git"
},
"license": "MIT",
"contributors": [
{
Expand All @@ -33,7 +26,17 @@
"url": "https://github.com/binjospookie"
}
],
"repository": {
"type": "git",
"url": "git+https://github.com/grlt-hub/app-compose.git"
},
"files": [
"dist"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
Expand All @@ -47,12 +50,9 @@
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsdown",
"dev": "tsdown --watch",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { literal, shape } from "@computable"
import { createTask, createWire, tag } from "@runnable"
import { describe, expect, it, vi } from "vitest"
import { compose } from "../compose"
import type { ComposeHookMap } from "../observer"
import { compose } from "../compose"

describe("observer", () => {
describe("onTaskFail", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-compose/src/compose/graph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RunnableInternal } from "@runnable"
import { createAnalyzer } from "./analyze"
import type { ComposableKind, ComposeNode } from "./definition"
import { createAnalyzer } from "./analyze"

type EntryID = number

Expand Down
2 changes: 1 addition & 1 deletion packages/app-compose/src/compose/guard.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RunnableInternal } from "@runnable"
import { createAnalyzer } from "./analyze"
import type { ComposableKind, ComposeMeta, ComposeNode } from "./definition"
import { createAnalyzer } from "./analyze"

type NotifyEntry = { index?: number; node: ComposeNode }

Expand Down
2 changes: 1 addition & 1 deletion packages/app-compose/src/computable/shape.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { build } from "./build"
import type { ContextToSpot } from "./context"
import { build } from "./build"
import { Compute$, Missing$, type ComputeStep, type Spot } from "./definition"

const wrap =
Expand Down
Loading
Loading