Skip to content

Commit

Permalink
Merge pull request #44 from daichitakahashi/separateIaC
Browse files Browse the repository at this point in the history
Separate IaC
  • Loading branch information
daichitakahashi authored Nov 26, 2024
2 parents 51aae5c + b4bdc0f commit 0ffcc46
Show file tree
Hide file tree
Showing 13 changed files with 203 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["dev-eventhub", "flaky-handler", "stable-handler"]
Expand Down
6 changes: 6 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ function readPackage(pkg, _) {
"cf-eventhub": "workspace:../cf-eventhub",
};
}
if (pkg.name === "@cf-eventhub/pulumi") {
pkg.dependencies = {
...pkg.dependencies,
"cf-eventhub": "workspace:../../cf-eventhub",
};
}

return pkg;
}
Expand Down
6 changes: 6 additions & 0 deletions cf-eventhub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# cf-eventhub

## 0.0.4

### Patch Changes

- 9a22301: New separated "@cf-eventhub/pulumi" package

## 0.0.3

### Patch Changes
Expand Down
15 changes: 12 additions & 3 deletions cf-eventhub/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "cf-eventhub",
"type": "module",
"version": "0.0.3",
"version": "0.0.4",
"keywords": [
"cloudflare"
],
"scripts": {
"build": "tsup --external cloudflare:workers",
"test": "vitest -c vitest.config.worker.mts",
Expand Down Expand Up @@ -33,31 +36,37 @@
"tsup": {
"entry": [
"src/**/*.ts",
"!src/**/*.test.ts"
"!src/**/*.test.ts",
"!src/repositorytest/**/*.ts"
],
"splitting": false,
"sourcemap": true,
"format": [
"esm"
"esm",
"cjs"
],
"dts": true,
"clean": true
},
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./core": {
"import": "./dist/core/index.js",
"require": "./dist/core/index.cjs",
"types": "./dist/core/index.d.ts"
},
"./dev": {
"import": "./dist/dev/index.js",
"require": "./dist/dev/index.cjs",
"types": "./dist/dev/index.d.ts"
},
"./postgresjs": {
"import": "./dist/postgres/postgresjs.js",
"require": "./dist/postgres/index.cjs",
"types": "./dist/postgres/postgresjs.d.ts"
}
},
Expand Down
1 change: 1 addition & 0 deletions cf-eventhub/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./logger";
export * from "./executor";
export * from "./hub";
export * from "./hub/routing";
export * from "./repository";
export * from "./type";
9 changes: 9 additions & 0 deletions iac/pulumi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @cf-eventhub/pulumi

## 0.0.1

### Patch Changes

- 9a22301: New separated "@cf-eventhub/pulumi" package
- Updated dependencies [9a22301]
- [email protected]
42 changes: 42 additions & 0 deletions iac/pulumi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@cf-eventhub/pulumi",
"main": "src/index.ts",
"type": "commonjs",
"version": "0.0.1",
"keywords": [
"pulumi",
"cloudflare"
],
"scripts": {
"build": "tsup"
},
"devDependencies": {
"tsup": "^8.3.5",
"typescript": "^5.7.2"
},
"dependencies": {
"@pulumi/cloudflare": "^5.40.0",
"@pulumi/pulumi": "^3.113.0",
"cf-eventhub": "^0.0.4"
},
"tsup": {
"entry": [
"src/index.ts"
],
"splitting": false,
"sourcemap": true,
"format": [
"esm",
"cjs"
],
"dts": true,
"clean": true
},
"exports": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"files": [
"dist"
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Queue, WorkersCronTrigger } from "@pulumi/cloudflare";
import { type Input, jsonStringify } from "@pulumi/pulumi";

import type { Config, ConfigInput } from "../../core/hub/routing";
import type { Config, ConfigInput } from "cf-eventhub/core";

export type HandlerWorkerScriptBinding = {
readonly name: Input<string>;
Expand Down Expand Up @@ -238,12 +237,12 @@ export abstract class EventHub<
this.handlers = handlers;
}

abstract createEventHubWorkerScript(
protected abstract createEventHubWorkerScript(
name: string,
args: CreateEventHubWorkerScriptArgs,
): _WorkerScript;

abstract createExecutorWorkerScript(
protected abstract createExecutorWorkerScript(
name: string,
args: CreateExecutorWorkerScriptArgs,
): _WorkerScript;
Expand Down
15 changes: 15 additions & 0 deletions iac/pulumi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"strict": true,
"outDir": "bin",
"target": "es2020",
"module": "NodeNext",
"moduleResolution": "nodenext",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true
}
}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "cf-eventhub",
"version": "1.0.0",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -16,8 +17,5 @@
"devDependencies": {
"@changesets/cli": "^2.27.10",
"chalk": "^5.3.0"
},
"publishConfig": {
"access": "public"
}
}
110 changes: 105 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
packages:
- cf-eventhub
- web-console
- iac/pulumi
- internal/*
Loading

0 comments on commit 0ffcc46

Please sign in to comment.