Skip to content

Commit

Permalink
convert project into workspace and add package.json for standalone pa…
Browse files Browse the repository at this point in the history
…ckages
  • Loading branch information
brandon-schabel committed Dec 27, 2024
1 parent 99352ec commit 7fe20c4
Show file tree
Hide file tree
Showing 260 changed files with 181 additions and 4,444 deletions.
56 changes: 0 additions & 56 deletions cli/cli-utils.test.ts

This file was deleted.

138 changes: 0 additions & 138 deletions cli/cli-utils.ts

This file was deleted.

1 change: 0 additions & 1 deletion cli/create-cli-factory.test.ts

This file was deleted.

58 changes: 0 additions & 58 deletions cli/create-cli-factory.ts

This file was deleted.

1 change: 0 additions & 1 deletion cli/index.ts

This file was deleted.

34 changes: 13 additions & 21 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
import * as auth from './auth'
import * as cli from './cli'
import * as cookies from './cookies'
import * as dataGen from './data-gen'
import * as deploy from './deploy'
import * as fetcher from './fetcher'
import * as filesFolders from './files-folders'
import * as htmlody from './htmlody'
import * as jwt from './jwt'
import * as logger from './logger'
import * as npm from './npm-release'
import * as server from './server'
import * as sqlite from './sqlite'
import * as state from './state'
import * as uuid from './uuid'
import * as validation from './validation'
import * as auth from './packages/auth'
import * as cookies from './packages/cookies'
import * as dataGen from './packages/data-gen'
import * as deploy from './packages/deploy'
import * as fetcher from './packages/fetcher'
import * as filesFolders from './packages/files-folders'
import * as htmlody from './packages/htmlody'
import * as jwt from './packages/jwt'
import * as logger from './packages/logger'
import * as npm from './packages/npm-release'
import * as state from './packages/state'
import * as uuid from './packages/uuid'

// utility exports
import * as utils from './utils/classy'
import * as utils from './packages/utils/classy'

export {
auth,
cli,
cookies,
dataGen,
deploy,
Expand All @@ -30,10 +25,7 @@ export {
jwt,
logger,
npm,
server,
sqlite,
state,
utils,
uuid,
validation,
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "bnkit",
"version": "0.5.20",
"main": "index.ts",
"workspaces": [
"packages/*"
],
"devDependencies": {
"bun": "^1.1.21",
"bun-types": "^1.1.21",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { oAuthFactory } from 'auth/oauth'
import { initGoogleOAuth } from 'auth/oauth-providers'
import { oAuthFactory } from 'packages/auth/oauth'
import { initGoogleOAuth } from 'packages/auth/oauth-providers'
import type { Routes } from 'server'
import { serverFactory } from 'server'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test";
import { addCorsHeaders, getAllowedOrigin, handleCorsPreFlight, getDefaultCorsOptions } from "./cors-utils";
import type { CorsOptions } from "./router-types";
import { addCorsHeaders, getAllowedOrigin, handleCorsPreFlight, getDefaultCorsOptions } from "./cors";
import type { CorsOptions } from "./cors";

describe("cors-utils", () => {
describe("addCorsHeaders", () => {
Expand Down
11 changes: 10 additions & 1 deletion server-router/src/cors-utils.ts → packages/cors/cors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { CorsOptions } from "./router-types";
export type HttpMethod = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT' | 'OPTIONS';

// CORS Types
export interface CorsOptions {
origin?: string | string[] | ((origin: string) => boolean);
methods?: HttpMethod[];
credentials?: boolean;
headers?: string[];
}


export async function addCorsHeaders(
response: Response,
Expand Down
14 changes: 14 additions & 0 deletions packages/cors/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@bnk/cors",
"version": "1.0.1",
"main": "cors.ts",
"types": "cors.ts",
"devDependencies": {
"bun-types": "*"
},
"scripts": {
"test": "bun test",
"prepublishOnly": "bun test",
"publish:cors": "bun publish --access public"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7fe20c4

Please sign in to comment.