Skip to content
Open
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
15 changes: 3 additions & 12 deletions .context/alchemy-effect/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ name: Release NPM Package
on:
workflow_dispatch:
inputs:
bump:
description: "Bump type"
required: true
type: choice
options:
- patch
- minor
version-override:
description: "Exact version override (e.g. 0.7.0-alpha). Leave empty to use bump type."
description: "Exact version override (e.g. 2.0.0-beta.5). Leave empty to auto-increment beta."
required: false
type: string

Expand Down Expand Up @@ -59,7 +52,7 @@ jobs:
if [ -n "${{ inputs.version-override }}" ]; then
bun ./scripts/bump.ts "${{ inputs.version-override }}"
else
bun ./scripts/bump.ts "${{ inputs.bump }}"
bun ./scripts/bump.ts beta
fi
VERSION=$(node -p "require('./alchemy-effect/package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
Expand All @@ -72,13 +65,11 @@ jobs:
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

- name: Create and push tag
if: ${{ !contains(steps.bump.outputs.version, '-') }}
run: |
git tag -a "v${{ steps.bump.outputs.version }}" -m "Release v${{ steps.bump.outputs.version }}"
git push --tags

- name: Create GitHub Release
if: ${{ !contains(steps.bump.outputs.version, '-') }}
run: |
if ! gh release view "v${{ steps.bump.outputs.version }}" >/dev/null 2>&1; then
PREV_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
Expand All @@ -93,7 +84,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ── Step 2: Build & publish alchemy-effect to npm ──
# ── Step 2: Build & publish alchemy to npm ──
publish-alchemy-effect:
needs: bump
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .context/alchemy-effect/.gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vendor/alchemy"]
path = vendor/alchemy
path = .vendor/alchemy
url = git@github.com:alchemy-run/alchemy.git
1 change: 1 addition & 0 deletions .context/alchemy-effect/.vendor/alchemy
Submodule alchemy added at 8c4a07
4 changes: 2 additions & 2 deletions .context/alchemy-effect/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"diffEditor.renderSideBySide": false,
"js/ts.experimental.useTsgo": false,
"typescript.experimental.useTsgo": false,
"js/ts.experimental.useTsgo": true,
"typescript.experimental.useTsgo": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifier": "relative",
Expand Down
47 changes: 47 additions & 0 deletions .context/alchemy-effect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
## v2.0.0-beta.3

###    🚀 Features

- **GitHub**:
- Comment Resource and CI guide &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(5e938)</samp>](https://github.com/alchemy-run/alchemy/commit/5e93857)
- Secret and Variable &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(0f620)</samp>](https://github.com/alchemy-run/alchemy/commit/0f620bd)

### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes

- **core**: Fix undefined Provider in plan &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(e0143)</samp>](https://github.com/alchemy-run/alchemy/commit/e01431f)

##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](https://github.com/alchemy-run/alchemy/compare/v2.0.0-beta.2...v2.0.0-beta.3)

---

## v2.0.0-beta.2

### &nbsp;&nbsp;&nbsp;🚀 Features

- ProviderCollections reduce number of Provider types polluting user's types &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(9f76b)</samp>](https://github.com/alchemy-run/alchemy/commit/9f76b91)

##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](https://github.com/alchemy-run/alchemy/compare/v2.0.0-beta.1...v2.0.0-beta.2)

---

## v2.0.0-beta.1

### &nbsp;&nbsp;&nbsp;🚀 Features

- Migrate to effect@4.0.0-beta.48 &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(8674e)</samp>](https://github.com/alchemy-run/alchemy/commit/8674e8f)
- **cloudflare**: Support R2Bucket.bind instead of R2BucketBinding.bind for all CF resources &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(12b50)</samp>](https://github.com/alchemy-run/alchemy/commit/12b50d3)
- **core**: Alchemy.Stack &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(68e66)</samp>](https://github.com/alchemy-run/alchemy/commit/68e6622)

### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes

- Release to alchemy package &nbsp;-&nbsp; by **Michael (Pear)** in https://github.com/alchemy-run/alchemy/issues/55 [<samp>(217c5)</samp>](https://github.com/alchemy-run/alchemy/commit/217c5c9)
- **cloudflare**:
- Require Content Length in R2.put and use raw ReadableStream if available &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(1cd6b)</samp>](https://github.com/alchemy-run/alchemy/commit/1cd6bda)
- Bundle properly formats windows paths &nbsp;-&nbsp; by **Michael (Pear)** [<samp>(5156c)</samp>](https://github.com/alchemy-run/alchemy/commit/5156c6c)
- **test**:
- Infer and resolve Output types in Test/Bun &nbsp;-&nbsp; by **Sam Goodwin** [<samp>(9853d)</samp>](https://github.com/alchemy-run/alchemy/commit/9853d92)

##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on GitHub](https://github.com/alchemy-run/alchemy/compare/v0.11.0...v2.0.0-beta.1)

---

## v0.11.0

### &nbsp;&nbsp;&nbsp;🚀 Features
Expand Down
5 changes: 2 additions & 3 deletions .context/alchemy-effect/alchemy-effect/bin/alchemy-effect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ if [ -n "$link" ]; then
else
dir="$(cd "$(dirname "$0")" && pwd)"
fi
script="$dir/alchemy-effect.js"
if command -v bun >/dev/null 2>&1; then
exec bun "$script" "$@"
exec bun "$dir/alchemy-effect.ts" "$@"
else
exec node "$script" "$@"
exec node "$dir/alchemy-effect.js" "$@"
fi
8 changes: 4 additions & 4 deletions .context/alchemy-effect/alchemy-effect/bin/alchemy-effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import * as AWSRegion from "../src/AWS/Region.ts";
import * as CLI from "../src/Cli/index.ts";
import { dotAlchemy } from "../src/Config.ts";
import * as Plan from "../src/Plan.ts";
import { getProviderByType, type LogLine } from "../src/Provider.ts";
import { findProviderByType, type LogLine } from "../src/Provider.ts";
import * as Stack from "../src/Stack.ts";
import { Stage } from "../src/Stage.ts";
import * as State from "../src/State/index.ts";
Expand Down Expand Up @@ -341,7 +341,7 @@ const tailCommand = Command.make(
});
if (!resourceState?.attr) continue;

const provider = yield* getProviderByType(resource.Type);
const provider = yield* findProviderByType(resource.Type);
if (!provider.tail) continue;

tailable.push({
Expand Down Expand Up @@ -636,7 +636,7 @@ const logsCommand = Command.make(
});
if (!resourceState?.attr) continue;

const provider = yield* getProviderByType(resource.Type);
const provider = yield* findProviderByType(resource.Type);
if (!provider.logs) continue;

const lines = yield* provider.logs({
Expand Down Expand Up @@ -726,7 +726,7 @@ const parseSince = (value: string): Date => {
return parsed;
};

const root = Command.make("alchemy-effect", {}).pipe(
const root = Command.make("alchemy", {}).pipe(
Command.withSubcommands([
bootstrapCommand,
deployCommand,
Expand Down
29 changes: 19 additions & 10 deletions .context/alchemy-effect/alchemy-effect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alchemy-effect",
"version": "0.11.0",
"name": "alchemy",
"version": "2.0.0-beta.3",
"homepage": "https://alchemy.run",
"license": "Apache-2.0",
"author": "Sam Goodwin <sam@alchemy.run>",
Expand All @@ -20,6 +20,14 @@
],
"type": "module",
"sideEffects": false,
"scripts": {
"dev": "tsdown --watch",
"build": "bun bundle && bun pm pack",
"bundle": "tsdown",
"bundle:watch": "tsdown --watch",
"publish:npm": "cp ../README.md . && bun publish && rm README.md",
"test:benchmark": "tsx --tsconfig tsconfig.test.json test/types.benchmark.ts"
},
"exports": {
".": {
"types": "./src/index.d.ts",
Expand Down Expand Up @@ -123,6 +131,12 @@
"worker": "./src/Cloudflare/*/index.ts",
"import": "./lib/Cloudflare/*/index.js"
},
"./GitHub": {
"types": "./src/GitHub/index.d.ts",
"bun": "./src/GitHub/index.ts",
"worker": "./src/GitHub/index.ts",
"import": "./lib/GitHub/index.js"
},
"./Endpoint": {
"types": "./src/Endpoint/index.d.ts",
"bun": "./src/Endpoint/index.ts",
Expand Down Expand Up @@ -187,14 +201,6 @@
"publishConfig": {
"access": "public"
},
"scripts": {
"dev": "tsdown --watch",
"build": "bun bundle && bun pm pack",
"bundle": "tsdown",
"bundle:watch": "tsdown --watch",
"publish:npm": "cp ../README.md . && bun publish && rm README.md",
"test:benchmark": "tsx --tsconfig tsconfig.test.json test/types.benchmark.ts"
},
"dependencies": {
"@ai-sdk/anthropic": "^3.0.31",
"@ai-sdk/openai": "^3.0.23",
Expand All @@ -207,10 +213,12 @@
"@distilled.cloud/core": "catalog:",
"@effect/vitest": "catalog:",
"@libsql/client": "catalog:",
"@octokit/rest": "^22.0.1",
"@smithy/node-config-provider": "catalog:",
"@smithy/shared-ini-file-loader": "catalog:",
"@smithy/types": "catalog:",
"@types/aws-lambda": "catalog:",
"@types/libsodium-wrappers": "^0.8.2",
"ai": "catalog:",
"aws4fetch": "catalog:",
"capnp-es": "catalog:",
Expand All @@ -219,6 +227,7 @@
"fast-xml-parser": "catalog:",
"ignore": "^7.0.5",
"jszip": "^3.10.1",
"libsodium-wrappers": "^0.8.3",
"rolldown": "catalog:",
"solid-js": "catalog:",
"sonda": "catalog:",
Expand Down
95 changes: 49 additions & 46 deletions .context/alchemy-effect/alchemy-effect/src/AWS/ACM/Certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as Schedule from "effect/Schedule";
import { deepEqual, isResolved } from "../../Diff.ts";
import * as Provider from "../../Provider.ts";
import { Resource } from "../../Resource.ts";
import type { Providers } from "../Providers.ts";
import {
createInternalTags,
createTagsList,
Expand Down Expand Up @@ -96,7 +97,9 @@ export interface Certificate extends Resource<
* Certificate expiration timestamp, when issued.
*/
notAfter: Date | undefined;
}
},
never,
Providers
> {}

/**
Expand Down Expand Up @@ -127,51 +130,6 @@ export interface Certificate extends Resource<
*/
export const Certificate = Resource<Certificate>("AWS.ACM.Certificate");

const ACM_REGION = "us-east-1" as const;
const defaultValidationMethod = "DNS" as const;

const withAcmRegion = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
effect.pipe(Effect.provideService(AwsRegion, ACM_REGION as any));

const normalizeHostedZoneId = (hostedZoneId: string) =>
hostedZoneId.replace(/^\/hostedzone\//, "");

const normalizeSanList = (names: string[] | undefined) =>
[...(names ?? [])].sort((a, b) => a.localeCompare(b));

const toTagRecord = (tags: acm.Tag[] | undefined) =>
Object.fromEntries(
(tags ?? [])
.filter(
(tag): tag is { Key: string; Value: string } =>
typeof tag.Key === "string" && typeof tag.Value === "string",
)
.map((tag) => [tag.Key, tag.Value]),
);

const toAttrs = (
props: CertificateProps,
detail: acm.CertificateDetail,
tags: Record<string, string>,
) => ({
certificateArn: detail.CertificateArn!,
domainName: detail.DomainName ?? props.domainName,
subjectAlternativeNames: detail.SubjectAlternativeNames ?? [],
status: detail.Status,
domainValidationOptions: detail.DomainValidationOptions ?? [],
validationMethod: props.validationMethod ?? defaultValidationMethod,
keyAlgorithm: detail.KeyAlgorithm ?? props.keyAlgorithm,
hostedZoneId: props.hostedZoneId
? normalizeHostedZoneId(props.hostedZoneId)
: undefined,
tags,
issuedAt: detail.IssuedAt,
notAfter: detail.NotAfter,
});

const isTerminalFailure = (status: acm.CertificateStatus | undefined) =>
status === "FAILED" || status === "VALIDATION_TIMED_OUT";

export const CertificateProvider = () =>
Provider.effect(
Certificate,
Expand Down Expand Up @@ -502,3 +460,48 @@ export const CertificateProvider = () =>
};
}),
);

const ACM_REGION = "us-east-1" as const;
const defaultValidationMethod = "DNS" as const;

const withAcmRegion = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
effect.pipe(Effect.provideService(AwsRegion, ACM_REGION as any));

const normalizeHostedZoneId = (hostedZoneId: string) =>
hostedZoneId.replace(/^\/hostedzone\//, "");

const normalizeSanList = (names: string[] | undefined) =>
[...(names ?? [])].sort((a, b) => a.localeCompare(b));

const toTagRecord = (tags: acm.Tag[] | undefined) =>
Object.fromEntries(
(tags ?? [])
.filter(
(tag): tag is { Key: string; Value: string } =>
typeof tag.Key === "string" && typeof tag.Value === "string",
)
.map((tag) => [tag.Key, tag.Value]),
);

const toAttrs = (
props: CertificateProps,
detail: acm.CertificateDetail,
tags: Record<string, string>,
) => ({
certificateArn: detail.CertificateArn!,
domainName: detail.DomainName ?? props.domainName,
subjectAlternativeNames: detail.SubjectAlternativeNames ?? [],
status: detail.Status,
domainValidationOptions: detail.DomainValidationOptions ?? [],
validationMethod: props.validationMethod ?? defaultValidationMethod,
keyAlgorithm: detail.KeyAlgorithm ?? props.keyAlgorithm,
hostedZoneId: props.hostedZoneId
? normalizeHostedZoneId(props.hostedZoneId)
: undefined,
tags,
issuedAt: detail.IssuedAt,
notAfter: detail.NotAfter,
});

const isTerminalFailure = (status: acm.CertificateStatus | undefined) =>
status === "FAILED" || status === "VALIDATION_TIMED_OUT";
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Input } from "../../Input.ts";
import { createPhysicalName } from "../../PhysicalName.ts";
import * as Provider from "../../Provider.ts";
import { Resource } from "../../Resource.ts";
import type { Providers } from "../Providers.ts";
import { createInternalTags, diffTags } from "../../Tags.ts";
import type { SubnetId } from "../EC2/Subnet.ts";
import type {
Expand Down Expand Up @@ -94,7 +95,9 @@ export interface AutoScalingGroup extends Resource<
defaultCooldown?: number;
terminationPolicies?: string[];
tags: Record<string, string>;
}
},
never,
Providers
> {}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { createPhysicalName } from "../../PhysicalName.ts";
import { Platform, type Main, type PlatformProps } from "../../Platform.ts";
import * as Provider from "../../Provider.ts";
import { Resource } from "../../Resource.ts";
import type { Providers } from "../Providers.ts";
import { Stack } from "../../Stack.ts";
import { Stage } from "../../Stage.ts";
import { createInternalTags, diffTags, hasTags } from "../../Tags.ts";
Expand Down Expand Up @@ -125,7 +126,8 @@ export interface LaunchTemplate extends Resource<
{
env?: Record<string, any>;
policyStatements?: PolicyStatement[];
}
},
Providers
> {}

export type LaunchTemplateServices = Credentials | Region;
Expand Down
Loading
Loading