Skip to content

Commit

Permalink
switch to pnpm and fixed edge
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshay committed Sep 14, 2023
1 parent 2e67f29 commit bf0b198
Show file tree
Hide file tree
Showing 34 changed files with 14,463 additions and 16,598 deletions.
14 changes: 3 additions & 11 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
.pnp.*
.yarn/*

.cdk.staging
.DS_Store
.env
.env.production
.netlify
.env*
.turbo
*.log*
apps/docs/src/content/docs/references/packages/*
cdk.out/
dist/
node_modules/
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
apps/www/src/pages/docs/packages/*
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ body:
- Astro AWS version(s):
- Astro version(s):
- Node:
- npm/Yarn version: [e.g. npm 7/Yarn 2.3]
- pnpm/npm/yarn version: [e.g. npm 7/Yarn 2.3]
- AWS CDK version(s):
validations:
required: true
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,8 @@ permissions:
deployments: write

jobs:
prepare-yarn-cache:
name: Cache dependencies
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "yarn"
- run: yarn install --mode=skip-build
env:
YARN_ENABLE_SCRIPTS: false
deploy-dev:
name: Deploy Dev
needs: [prepare-yarn-cache]
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.job) }}
uses: ./.github/workflows/deploy.yml
Expand All @@ -45,7 +32,6 @@ jobs:
secrets: inherit
deploy-dev-ssr:
name: Deploy Dev SSR
needs: [prepare-yarn-cache]
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.job) }}
uses: ./.github/workflows/deploy.yml
Expand All @@ -56,7 +42,6 @@ jobs:
secrets: inherit
deploy-dev-edge:
name: Deploy Dev Edge
needs: [prepare-yarn-cache]
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.job) }}
uses: ./.github/workflows/deploy.yml
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,8 @@ permissions:
deployments: write

jobs:
prepare-yarn-cache:
name: Cache dependencies
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "yarn"
- run: yarn install --mode=skip-build
env:
YARN_ENABLE_SCRIPTS: false
deploy-prod:
name: Deploy Prod
needs: [prepare-yarn-cache]
concurrency:
group: ${{ format('{0}-{1}', github.workflow, github.job) }}
uses: ./.github/workflows/deploy.yml
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,9 @@ env:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
prepare-yarn-cache:
name: Cache dependencies
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "yarn"
- run: yarn install --mode=skip-build
env:
YARN_ENABLE_SCRIPTS: false
check:
name: Check
runs-on: ubuntu-22.04
needs: prepare-yarn-cache
strategy:
fail-fast: false
matrix:
Expand All @@ -38,16 +25,15 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: "yarn"
cache: "pnpm"
- uses: aws-actions/configure-aws-credentials@v1
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: yarn install --mode=skip-build
- run: yarn build
- run: yarn constraints
- run: yarn test
- run: yarn lint
- run: yarn prettier
- run: yarn synth
- run: pnpm install
- run: pnpm run build
- run: pnpm run test
- run: pnpm run lint
- run: pnpm run prettier
- run: pnpm run synth
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}
cache: "yarn"
- run: yarn install --mode=skip-build
- run: yarn deploy:one infra -- ${{ inputs.stack_environment }}
cache: "pnpm"
- run: pnpm install
- run: pnpm run deploy:one infra -- ${{ inputs.stack_environment }}
env:
WEB_ACL_ARN: ${{ secrets.WEB_ACL_ARN }}
# - run: |
Expand Down
17 changes: 2 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
.pnp.*
.yarn/*
!.yarn/plugins
!.yarn/releases

.cdk.staging
.DS_Store
.env*
.netlify
.turbo
.turbo/
*.log*
apps/docs/src/content/docs/references/packages/*
cdk.out/
dist/
node_modules/
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
package.tgz
apps/www/src/pages/docs/packages/*

.idea
14 changes: 3 additions & 11 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
.pnp.*
.yarn/*

.cdk.staging
.DS_Store
.env
.env.production
.netlify
.env*
.turbo
*.log*
apps/docs/src/content/docs/references/packages/*
cdk.out/
dist/
node_modules/
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
apps/www/src/pages/docs/packages/*
52 changes: 0 additions & 52 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarnrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
},
"scripts": {
"astro": "astro",
"build": "yarn clean && ./scripts/copy-package-readmes.sh && astro build",
"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": "yarn build && yarn package",
"release": "pnpm run build && pnpm run package",
"start": "astro dev"
},
"dependencies": {
Expand Down
Binary file added apps/docs/src/assets/ClaimId_864280113200.pdf
Binary file not shown.
Binary file added apps/docs/src/assets/ClaimId_864496019100.pdf
Binary file not shown.
12 changes: 9 additions & 3 deletions apps/docs/src/content/docs/reference/packages/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ yarn astro add @astro-aws/adapter

# Using PNPM
pnpm astro add @astro-aws/adapter

# Using Bun
bun x astro add @astro-aws/adapter
```

### Manually
Expand All @@ -25,13 +28,16 @@ pnpm astro add @astro-aws/adapter

```
# Using NPM
npm install @astro-aws/adapter
npm install -D @astro-aws/adapter
# Using Yarn
yarn add @astro-aws/adapter
yarn add -D @astro-aws/adapter
# Using PNPM
pnpm add @astro-aws/adapter
pnpm add -D @astro-aws/adapter
# Using Bun
bun add -D @astro-aws/adapter
```

2. Add the following to your `astro.config.mjs` file.
Expand Down
9 changes: 9 additions & 0 deletions apps/docs/src/content/docs/reference/packages/constructs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ yarn add @astro-aws/constructs constructs aws-cdk-lib

# Using PNPM
pnpm add @astro-aws/constructs constructs aws-cdk-lib

# Using Bun
bun add @astro-aws/constructs constructs aws-cdk-lib
```

2. Add the construct to your CDK stack.
Expand Down Expand Up @@ -55,6 +58,9 @@ yarn add @astro-aws/constructs constructs aws-cdk-lib

# Using PNPM
pnpm add @astro-aws/constructs constructs aws-cdk-lib

# Using Bun
bun add @astro-aws/constructs constructs aws-cdk-lib
```

2. Add the construct to your CDK stack.
Expand Down Expand Up @@ -91,6 +97,9 @@ yarn add @astro-aws/constructs constructs aws-cdk-lib

# Using PNPM
pnpm add @astro-aws/constructs constructs aws-cdk-lib

# Using Bun
bun add @astro-aws/constructs constructs aws-cdk-lib
```

2. Add the construct to your CDK stack.
Expand Down
2 changes: 1 addition & 1 deletion apps/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@astro-aws/constructs": "workspace:^",
"@astro-aws/docs": "workspace:^",
"@astro-aws/www": "workspace:^",
"@types/node": "^18.14.0",
"aws-cdk": "^2.94.0",
"aws-cdk-lib": "^2.94.0",
"constructs": "^10.1.253",
Expand All @@ -42,6 +41,7 @@
},
"devDependencies": {
"@astro-aws/scripts": "workspace:^",
"@types/node": "^18.14.0",
"eslint-config-get-off-my-lawn": "^7.2.0"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions apps/infra/src/lib/stacks/website-stack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cwd, env } from "node:process"

import { getYarnWorkspaces } from "workspace-tools"
import { getPnpmWorkspaces } from "workspace-tools"
import { CfnOutput, Duration, Stack } from "aws-cdk-lib/core"
import type { Certificate } from "aws-cdk-lib/aws-certificatemanager"
import {
Expand Down Expand Up @@ -34,7 +34,7 @@ export type WebsiteStackProps = AstroAWSStackProps & {
}

export class WebsiteStack extends Stack {
private static WORKSPACE_INFO = getYarnWorkspaces(cwd())
private static WORKSPACE_INFO = getPnpmWorkspaces(cwd())

public constructor(scope: Construct, id: string, props: WebsiteStackProps) {
super(scope, id, props)
Expand Down
4 changes: 2 additions & 2 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
],
"scripts": {
"astro": "astro",
"build": "yarn clean && ./scripts/copy-package-readmes.sh && astro build",
"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": "yarn build && yarn package",
"release": "pnpm run build && pnpm run package",
"start": "astro dev"
},
"eslintConfig": {
Expand Down
17 changes: 15 additions & 2 deletions apps/www/src/pages/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ pnpm create astro@latest
pnpm astro add @astro-aws/adapter
```

### Using Bun

```sh
bun create astro@latest
bun x astro add @astro-aws/adapter
```

## Build your Astro project

```sh
Expand All @@ -49,6 +56,9 @@ yarn build

# Using PNPM
pnpm run build

# Using PNPM
bun run build
```

## Start your first AWS CDK project
Expand All @@ -68,13 +78,16 @@ cdk init app --language typescript

```sh
# Using NPM
npm i @astro-aws/constructs
npm install @astro-aws/constructs

# Using Yarn
yarn add @astro-aws/constructs

# Using PNPM
pnpm i @astro-aws/constructs
pnpm add @astro-aws/constructs

# Using Bun
bun add @astro-aws/constructs
```

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

0 comments on commit bf0b198

Please sign in to comment.