Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #124

Merged
6 commits merged into from
Mar 7, 2024
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: 6 additions & 0 deletions .changeset/few-kings-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@astro-aws/constructs": patch
"@astro-aws/adapter": patch
---

Use flatted to handle circular json
6 changes: 6 additions & 0 deletions .changeset/lemon-dancers-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@astro-aws/constructs": minor
"@astro-aws/adapter": minor
---

Updated dependencies
6 changes: 6 additions & 0 deletions .changeset/quick-grapes-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@astro-aws/constructs": minor
"@astro-aws/adapter": minor
---

Support Astro v4
7 changes: 4 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require("@rushstack/eslint-patch/modern-module-resolution")

const { createSmartConfig } = require("@lshay/eslint-config")

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["@lshay/eslint-config"],
module.exports = createSmartConfig({
overrides: [
{
files: ["*.test.*"],
Expand Down Expand Up @@ -32,4 +33,4 @@ module.exports = {
},
},
},
}
})
20 changes: 0 additions & 20 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,3 @@ jobs:
environment_url: https://static.dev.astro-aws.org/
stack_environment: DEV
secrets: inherit
deploy-dev-ssr:
name: Deploy Dev SSR
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.job) }}
uses: ./.github/workflows/deploy.yml
with:
environment_name: development-ssr
environment_url: https://ssr.dev.astro-aws.org/
stack_environment: SSR
secrets: inherit
deploy-dev-edge:
name: Deploy Dev Edge
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.job) }}
uses: ./.github/workflows/deploy.yml
with:
environment_name: development-edge
environment_url: https://edge.dev.astro-aws.org/
stack_environment: EDGE
secrets: inherit
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

permissions:
id-token: write
contents: read

jobs:
check:
name: Check
Expand All @@ -29,17 +33,13 @@ jobs:
- synth
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: "8.7.6"
- uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: "pnpm"
- uses: aws-actions/configure-aws-credentials@v1
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: us-east-2
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: pnpm install
- run: pnpm run ${{ matrix.cmd }}
role-to-assume: arn:aws:iam::738697399292:role/GitHubOIDCReadOnlyRole
aws-region: us-west-2
- run: bun install
- run: bun run ${{ matrix.cmd }}
14 changes: 3 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
required: false
type: string
default: "20"
pnpm_version:
description: The version of PNPM to use
required: false
type: string
default: "8.7.6"
stack_environment:
description: The stack environment to deploy
required: true
Expand Down Expand Up @@ -81,15 +76,12 @@ jobs:
with:
aws-region: ${{ inputs.aws_region }}
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
- uses: pnpm/action-setup@v2
with:
version: ${{ inputs.pnpm_version }}
- uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: "pnpm"
- run: pnpm install
- run: pnpm run deploy:one infra -- ${{ inputs.stack_environment }}
- run: bun install
- run: bun run deploy:one infra -- ${{ inputs.stack_environment }}
env:
AWS_ACCOUNT: ${{ secrets.AWS_ACCOUNT }}
# - run: |
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@lshay/prettier-config")
90 changes: 46 additions & 44 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
{
"name": "@astro-aws/docs",
"version": "0.0.0",
"private": true,
"homepage": "https://astro-aws.org/",
"repository": {
"type": "git",
"url": "ssh://[email protected]/lukeshay/astro-aws.git",
"directory": "apps/www"
},
"license": "MIT",
"type": "module",
"files": [
"dist"
],
"eslintConfig": {
"extends": [
"../../.eslintrc.cjs"
],
"root": false
},
"scripts": {
"astro": "astro",
"build": "pnpm run clean && ./scripts/copy-package-readmes.sh && astro build",
"check": "astro check && tsc",
"clean": "rimraf dist",
"dev": "astro dev",
"preview": "astro preview",
"release": "pnpm run build && pnpm run package",
"start": "astro dev"
},
"dependencies": {
"@astrojs/starlight": "^0.12.0",
"astro": "^3.5.5",
"sharp": "^0.32.6"
},
"devDependencies": {
"@astro-aws/adapter": "workspace:^",
"eslint": "^8.53.0",
"prettier": "^3.1.0",
"rimraf": "^5.0.5"
},
"engines": {
"node": "18.x || 20.x"
}
"name": "@astro-aws/docs",
"version": "0.0.0",
"private": true,
"homepage": "https://astro-aws.org/",
"repository": {
"type": "git",
"url": "ssh://[email protected]/lukeshay/astro-aws.git",
"directory": "apps/www"
},
"license": "MIT",
"type": "module",
"files": [
"dist"
],
"eslintConfig": {
"extends": [
"../../.eslintrc.cjs"
],
"root": false
},
"scripts": {
"astro": "astro",
"build": "pnpm run clean && ./scripts/copy-package-readmes.sh && astro build",
"check": "astro check && tsc",
"clean": "rimraf dist",
"dev": "astro dev",
"preview": "astro preview",
"release": "pnpm run build && pnpm run package",
"start": "astro dev"
},
"dependencies": {
"@astrojs/starlight": "^0.21.1",
"astro": "^4.4.13",
"sharp": "^0.33.2"
},
"devDependencies": {
"@astro-aws/adapter": "workspace:^",
"@types/node": "^18.18.0",
"eslint": "^8.57.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"starlight-links-validator": "^0.6.0"
},
"engines": {
"node": "18.x || 20.x"
}
}
Binary file removed apps/docs/src/assets/ClaimId_864280113200.pdf
Binary file not shown.
Binary file removed apps/docs/src/assets/ClaimId_864496019100.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion apps/docs/src/content/docs/guides/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ pnpm i @astro-aws/constructs

### Modify `lib/hello-cdk-stack.ts` to contain the following

```ts
```ts ins={4, 10-14}
// lib/hello-cdk-stack.ts
import { Stack } from "aws-cdk-lib/core"
import type { StackProps } from "aws-cdk-lib/core"
import { AstroAWS } from "@astro-aws/constructs"
Expand Down
5 changes: 2 additions & 3 deletions apps/docs/src/content/docs/guides/02-query-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Follow the [getting started guide](./getting-started) to create a new Astro proj

In order to allow query parameters to be passed to your application, you must create a custom `CachePolicy` for the CloudFront distribution. The following example based on the getting started guide will allow all query parameters to be passed to your application.

`lib/hello-cdk-stack.ts`:

```ts
```ts ins={16-18,21-31}
// lib/hello-cdk-stack.ts
import { Stack } from "aws-cdk-lib/core"
import type { StackProps } from "aws-cdk-lib/core"
import { AstroAWS } from "@astro-aws/constructs"
Expand Down
9 changes: 2 additions & 7 deletions apps/docs/src/content/docs/guides/03-cookies.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Follow the [getting started guide](./getting-started) to create a new Astro proj

In order to allow cookies to be passed to your application, you must create a custom `CachePolicy` for the CloudFront distribution. The following example based on the getting started guide will allow all cookies to be passed to your application.

`lib/hello-cdk-stack.ts`:

```ts
```ts ins={13-15,18-28}
// lib/hello-cdk-stack.ts
import { Stack } from "aws-cdk-lib/core"
import type { StackProps } from "aws-cdk-lib/core"
import { AstroAWS } from "@astro-aws/constructs"
Expand Down Expand Up @@ -45,7 +44,3 @@ export class HelloCdkStack extends Stack {
}
}
```

```

```
18 changes: 9 additions & 9 deletions apps/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
"dependencies": {
"@astro-aws/constructs": "workspace:^",
"@astro-aws/docs": "workspace:^",
"@aws-sdk/client-acm": "^3.460.0",
"aws-cdk": "^2.109.0",
"aws-cdk-lib": "^2.109.0",
"@aws-sdk/client-acm": "^3.525.0",
"aws-cdk": "^2.131.0",
"aws-cdk-lib": "^2.131.0",
"constructs": "^10.3.0",
"eslint": "^8.53.0",
"prettier": "^3.1.0",
"typescript": "^5.2.2",
"workspace-tools": "^0.36.3"
"eslint": "^8.57.0",
"prettier": "^3.2.5",
"typescript": "^5.4.2",
"workspace-tools": "^0.36.4"
},
"devDependencies": {
"@astro-aws/scripts": "workspace:^",
"@types/aws-lambda": "^8.10.126",
"@types/node": "^18.18.0",
"@types/aws-lambda": "^8.10.136",
"@types/node": "^18.18.4",
"eslint-config-get-off-my-lawn": "^7.2.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion apps/infra/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
ENVIRONMENT="${1:-DEV}"
AWS_ARGS="${@:2}"

pnpm exec -- cdk deploy --asset-parallelism --concurrency 4 --require-approval never "AstroAWS-${ENVIRONMENT}-*" ${AWS_ARGS}
bun run cdk deploy --asset-parallelism --concurrency 4 --require-approval never "AstroAWS-${ENVIRONMENT}-*" ${AWS_ARGS}
22 changes: 11 additions & 11 deletions apps/infra/src/lib/constants/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ const ENVIRONMENT_PROPS: Record<Environment, EnvironmentProps> = {
aliases: ["www.static.dev", "static.dev"],
hostedZoneName: "astro-aws.org",
mode: "static",
package: "@astro-aws/docs",
app: "apps/docs",
runtime: "nodejs20",
},
{
aliases: ["www.ssr.nodejs18.dev", "ssr.nodejs18.dev"],
hostedZoneName: "astro-aws.org",
mode: "ssr",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs18",
},
{
aliases: ["www.stream.nodejs18.dev", "stream.nodejs18.dev"],
hostedZoneName: "astro-aws.org",
mode: "ssr-stream",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs18",
},
{
Expand All @@ -62,21 +62,21 @@ const ENVIRONMENT_PROPS: Record<Environment, EnvironmentProps> = {
},
hostedZoneName: "astro-aws.org",
mode: "edge",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs18",
},
{
aliases: ["www.ssr.nodejs20.dev", "ssr.nodejs20.dev"],
hostedZoneName: "astro-aws.org",
mode: "ssr",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs20",
},
{
aliases: ["www.stream.nodejs20.dev", "stream.nodejs20.dev"],
hostedZoneName: "astro-aws.org",
mode: "ssr-stream",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs20",
},
{
Expand All @@ -87,7 +87,7 @@ const ENVIRONMENT_PROPS: Record<Environment, EnvironmentProps> = {
},
hostedZoneName: "astro-aws.org",
mode: "edge",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs20",
},
],
Expand All @@ -100,7 +100,7 @@ const ENVIRONMENT_PROPS: Record<Environment, EnvironmentProps> = {
aliases: ["www.docs"],
hostedZoneName: "astro-aws.org",
mode: "static",
package: "@astro-aws/docs",
app: "apps/docs",
redirectAliases: ["", "www", "docs"],
runtime: "nodejs20",
},
Expand All @@ -112,17 +112,17 @@ const ENVIRONMENT_PROPS: Record<Environment, EnvironmentProps> = {
websites: [
{
mode: "static",
package: "@astro-aws/docs",
app: "apps/docs",
runtime: "nodejs20",
},
{
mode: "ssr",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs20",
},
{
mode: "ssr-stream",
package: "@astro-aws/examples-base",
app: "examples/base",
runtime: "nodejs20",
},
],
Expand Down
Loading
Loading