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
6 changes: 5 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- "apps/website/**"
- ".github/workflows/gh-pages.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gh-pages
cancel-in-progress: true

jobs:
# Build job
build:
Expand All @@ -27,7 +31,7 @@ jobs:

- name: Setup Turbo
run: |
npx -y turbo prune website
npx -y turbo@canary prune website
cp tsconfig.base.json out/tsconfig.base.json
cp .oxlintrc.json out/.oxlintrc.json
cp -R scripts out/scripts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fi
done

npx -y turbo prune storybooker ${pkgNames[@]}
npx -y turbo@canary prune storybooker ${pkgNames[@]}
cp tsconfig.base.json out/tsconfig.base.json
cp .oxlintrc.json out/.oxlintrc.json
cp -R scripts out/scripts
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ on:
branches:
- "*"

concurrency: ${{ github.workflow }}-${{ github.ref }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
Expand All @@ -29,7 +31,17 @@ jobs:
node-version-file: ".nvmrc"
cache: "yarn"

- name: Cache deps
id: cache
uses: actions/cache@v4
with:
path: |
node_modules/
packages/core/node_modules/
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ storybook-static
*.zip
test-report
coverage
openapi.json
openapi.json
lgtm
16 changes: 11 additions & 5 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
"arrow-body-style": "allow",
"id-length": ["warn", { "exceptions": ["z"] }],
"func-style": ["allow"],
"max-lines-per-function": [
"warn",
{ "max": 50, "skipBlankLines": true, "skipComments": true }
],
"sort-imports": "allow",
"max-lines-per-function": ["warn", { "max": 50, "skipBlankLines": true, "skipComments": true }],
"import/consistent-type-specifier-style": "allow",
"import/exports-last": "allow",
"import/extensions": ["deny", "always"],
"import/group-exports": "allow",
"import/max-dependencies": "allow",
"import/no-cycle": "warn",
"import/no-namespace": "allow",
"import/prefer-default-export": "allow",
"import/no-named-export": "allow",
"new-cap": "allow",
"no-async-await": "allow",
"no-continue": "allow",
Expand All @@ -35,6 +40,7 @@
"no-unsafe-type-assertion": "allow",
"only-throw-error": "allow",
"return-await": "allow",
"sort-imports": "allow",
"switch-exhaustiveness-check": "warn",
"strict-boolean-expressions": "allow",
"typescript/strict-boolean-expressions": "allow"
Expand Down
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.1.cjs

This file was deleted.

942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.12.0.cjs

Large diffs are not rendered by default.

27 changes: 22 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.1.1.cjs

npmRegistryServer: "https://registry.npmjs.org"
npmPublishRegistry: "https://registry.npmjs.org"
npmAuthToken: ${NPM_AUTH_TOKEN:-}
npmAlwaysAuth: true
npmPublishAccess: "public"

npmAuthToken: "${NPM_AUTH_TOKEN:-}"

npmPublishAccess: public

npmPublishRegistry: "https://registry.npmjs.org"

npmRegistryServer: "https://registry.npmjs.org"

npmScopes:
jsr:
npmRegistryServer: "https://npm.jsr.io"

yarnPath: .yarn/releases/yarn-4.12.0.cjs

catalog:
"@typescript/native-preview": "^7.0.0-dev.20251213.1"
"@types/node": "^22.0.0"
"@vitest/coverage-v8": "^4.0.0"
hono: "^4.11.0"
oxlint: "^1.32.0"
"oxlint-tsgolint": "^0.8.6"
"prettier": "^3.7.4"
tsdown: "^0.17.3"
vitest: "^4.0.0"
zod: "^4.1.0"
2 changes: 1 addition & 1 deletion apps/test-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@storybook/addon-vitest": "^9.1.5",
"@storybook/react-vite": "^9.0.0",
"@types/node": "^22.0.0",
"@types/node": "catalog:",
"@types/react": "^19.0.0",
"@vitejs/plugin-react": "^5.0.2",
"@vitest/browser": "^3.2.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/vercel-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@vercel/blob": "^2.0.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"@types/node": "catalog:",
"typescript": "^5.9.0",
"vercel": "^48.12.1"
}
Expand Down
4 changes: 4 additions & 0 deletions apps/vercel-app/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class VercelEdgeConfigDatabaseService implements DatabaseAdapter {
this.#keyPrefix = options?.keyPrefix || "sbr";
}

metadata: DatabaseAdapter["metadata"] = {
name: "Vercel Edge Config",
};

init: DatabaseAdapter["init"] = async (_options) => {
// Edge Config doesn't require explicit initialization
// Just verify we can read from it
Expand Down
4 changes: 4 additions & 0 deletions apps/vercel-app/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class VercelBlobService implements StorageAdapter {
this.#baseUrl = baseUrl;
}

metadata: StorageAdapter["metadata"] = {
name: "Vercel Storage",
};

createContainer: StorageAdapter["createContainer"] = async (_containerId, _options) => {
// Vercel Blob doesn't have explicit container creation
// Containers are implicit through path prefixes
Expand Down
8 changes: 4 additions & 4 deletions apps/website/docs/core/bun.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ Run following with `bun run --hot server.ts`

import { createHonoRouter } from "@storybooker/core";
import {
LocalFileDatabase,
LocalFileStorage,
createLocalFileDatabaseAdapter,
createLocalFileStorageAdapter,
} from "@storybooker/core/adapter/fs";
import { createBasicUIAdapter } from "@storybooker/ui";

// Create StoryBooker router
const router = createHonoRouter({
// provide a supported database service adapter
database: new LocalFileDatabase(),
database: createLocalFileDatabaseAdapter(),
// provide a supported storage service adapter
storage: new LocalFileStorage(),
storage: createLocalFileStorageAdapter(),
// provide a supported UI adapter
ui: createBasicUIAdapter(),
});
Expand Down
8 changes: 4 additions & 4 deletions apps/website/docs/core/deno.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ Run following with `deno serve -REW server.ts`

import { createHonoRouter } from "jsr:@storybooker/core";
import {
LocalFileDatabase,
LocalFileStorage,
createLocalFileDatabaseAdapter,
createLocalFileStorageAdapter,
} from "jsr:@storybooker/core/adapter/fs";
import { createBasicUIAdapter } from "npm:@storybooker/ui";

// Create StoryBooker router
const router = createHonoRouter({
// provide a supported database service adapter
database: new LocalFileDatabase(),
database: createLocalFileDatabaseAdapter(),
// provide a supported storage service adapter
storage: new LocalFileStorage(),
storage: createLocalFileStorageAdapter(),
// provide a supported UI adapter
ui: createBasicUIAdapter(),
});
Expand Down
8 changes: 4 additions & 4 deletions apps/website/docs/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ Purging deletes all builds older than certain days based on Project's configurat

## Adapters (for testing)

### `LocalFileDatabase`
### `createLocalFileStorageAdapter`

> [API Docs](https://jsr.io/@storybooker/core/doc/adapters/~/LocalFileDatabase)
> [API Docs](https://jsr.io/@storybooker/core/doc/adapter/fs/~/createLocalFileStorageAdapter)

A simple database adapter that uses local file to store data. Defaults to `./db.json` file.

### `LocalFileStorage`
### `createLocalFileStorageAdapter`

> [API Docs](https://jsr.io/@storybooker/core/doc/adapters/~/LocalFileStorage)
> [API Docs](https://jsr.io/@storybooker/core/doc/adapter/fs/~/createLocalFileStorageAdapter)

A simple storage adapter that uses local folder to store files. Defaults to current folder.

Expand Down
8 changes: 4 additions & 4 deletions apps/website/docs/core/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Run following with `node server.mjs`
import { serve } from "@hono/node-server";
import { createHonoRouter } from "@storybooker/core";
import {
LocalFileDatabase,
LocalFileStorage,
createLocalFileDatabaseAdapter,
createLocalFileStorageAdapter,
} from "@storybooker/core/adapter/fs";
import { createBasicUIAdapter } from "npm:@storybooker/ui";

// Create StoryBooker Hono router
const router = createHonoRouter({
// provide a supported database service adapter
database: new LocalFileDatabase(),
database: createLocalFileDatabaseAdapter(),
// provide a supported storage service adapter
storage: new LocalFileStorage(),
storage: createLocalFileStorageAdapter(),
// provide a supported UI adapter
ui: createBasicUIAdapter(),
});
Expand Down
12 changes: 7 additions & 5 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
"write-heading-ids": "docusaurus write-heading-ids",
"check": "tsc --noEmit",
"fmt": "prettier src --write --config ../../.prettierrc",
"oxfmt": "npx oxfmt ./src --check",
"lint": "oxlint --type-aware ./src",
"oxfmt": "npx oxfmt ./src",
"lint": "oxlint --type-aware --type-check ./src",
"lint:fix": "yarn lint --fix",
"openapi": "cp ../../packages/core/dist/openapi.json ./static/openapi.json"
},
"dependencies": {
"@docusaurus/core": "3.9.2",
"@docusaurus/plugin-content-docs": "3.9.2",
"@docusaurus/preset-classic": "3.9.2",
"@docusaurus/theme-common": "3.9.2",
"@easyops-cn/docusaurus-search-local": "^0.52.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
Expand All @@ -35,9 +37,9 @@
"@docusaurus/types": "3.9.2",
"@storybooker/core": "workspace:*",
"@types/react": "^19.0.0",
"oxlint": "^1.31.0",
"oxlint-tsgolint": "^0.8.0",
"prettier": "^3.6.2",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"prettier": "catalog:",
"typescript": "^5.9.2"
},
"imports": {
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
"repository": "git@github.com:GuptaSiddhant/storybooker.git",
"author": "Siddhant Gupta <guptasiddhant@icloud.com>",
"license": "MIT",
"packageManager": "yarn@4.1.1",
"packageManager": "yarn@4.12.0",
"workspaces": [
"./apps/*",
"./packages/*"
],
"scripts": {
"build": "turbo build",
"build:pkg": "turbo build --filter='./packages/*'",
"check": "turbo check",
"core:build": "yarn workspace @storybooker/core build",
"core:dev": "yarn workspace @storybooker/core dev",
"cli": "yarn workspace storybooker start",
Expand All @@ -25,15 +24,15 @@
"functions": "yarn workspace azure-functions-app dev",
"lint": "turbo lint",
"release": "node ./scripts/release.ts",
"server": "NODE_ENV=development deno serve -REW --unstable-sloppy-imports --watch ./scripts/server.ts",
"server": "NODE_ENV=development OTEL_DENO=true deno serve -REW --unstable-sloppy-imports --watch ./scripts/server.ts",
"test": "turbo test",
"verify": "turbo verify --filter='./packages/*'"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
"oxfmt": "^0.16.0",
"prettier": "^3.6.2",
"turbo": "^2.5.6"
"prettier": "catalog:",
"turbo": "^2.6.4-canary.3"
},
"overrides": {
"debug": "4.4.1"
Expand Down
27 changes: 13 additions & 14 deletions packages/aws/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybooker/aws",
"version": "0.19.4",
"version": "0.20.0",
"type": "module",
"description": "StoryBooker Adapter for interacting with AWS services.",
"author": {
Expand Down Expand Up @@ -46,21 +46,20 @@
"exports": {
"./dynamo-db": {
"source": "./src/dynamo-db.ts",
"default": "./dist/dynamo-db.js"
"default": "./dist/dynamo-db.mjs"
},
"./s3": {
"source": "./src/s3.ts",
"default": "./dist/s3.js"
"default": "./dist/s3.mjs"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsdown",
"check": "tsgo --noEmit",
"dev": "tsdown -w ./src",
"fmt": "prettier src --write --config ../../.prettierrc",
"oxfmt": "npx oxfmt ./src --check",
"lint": "oxlint --type-aware ./src",
"oxfmt": "npx oxfmt ./src",
"lint": "oxlint --type-aware --type-check ./src",
"lint:fix": "yarn lint --fix"
},
"dependencies": {
Expand All @@ -69,12 +68,12 @@
"devDependencies": {
"@aws-sdk/client-dynamodb": "^3.895.0",
"@aws-sdk/client-s3": "^3.895.0",
"@types/node": "^22.0.0",
"@typescript/native-preview": "^7.0.0-dev.20251024.1",
"oxlint": "^1.31.0",
"oxlint-tsgolint": "^0.8.0",
"prettier": "^3.6.2",
"tsdown": "^0.15.9"
"@types/node": "catalog:",
"@typescript/native-preview": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"prettier": "catalog:",
"tsdown": "catalog:"
},
"peerDependencies": {
"@aws-sdk/client-dynamodb": "^3.0.0",
Expand All @@ -90,8 +89,8 @@
},
"publishConfig": {
"exports": {
"./dynamo-db": "./dist/dynamo-db.js",
"./s3": "./dist/s3.js",
"./dynamo-db": "./dist/dynamo-db.mjs",
"./s3": "./dist/s3.mjs",
"./package.json": "./package.json"
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/aws/src/dynamo-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export class AwsDynamoDatabaseService implements DatabaseAdapter {
this.#client = client;
}

metadata: DatabaseAdapter["metadata"] = { name: "AWS DynamoDB" };

listCollections: DatabaseAdapter["listCollections"] = async (options) => {
const response = await this.#client.send(new Dynamo.ListTablesCommand({}), {
abortSignal: options.abortSignal,
Expand Down
Loading
Loading