forked from aws/aws-pdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Only publish single aws-pdk package (aws#536)
This commit restructures the PDK as follows: - Individual packages are now namespaced as @aws-pdk and are NOT published to npm/pypi/maven. - A new aws-pdk package is created which creates a single distributable which IS published to npm/pypi/maven. - Dependencies between packages is supported via @aws-pdk/XXX. When packaging into the aws-pdk, these imports are rewritten using a combination of tsconfig paths and tsc-alias. - PDKProject has been refactored to pull out PDKRelease as this should now only happen in AwsPdkProject. - Package tasks have been removed from individual packages as this now should only occur in aws-pdk. - aws_arch and cdk_graph_plugin_diagram have been refactored slightly to ensure exported types make JSII happy. - Overall DAG has been simplified and improvements to build times have been made ~8 mins - docs has been pulled up to the root level - private has been replaces by projenrc - PDKPipelineXXProject has been removed from the pipeline package. - Updated Monorepo to ensure NodeResolution is nodenext for TS projects - Changed transient deps script to use shallowest transient dep version instead of greatest given we are now bundling everything together in one. - Interfaces no longer expose required props when they aren't actually required. - All TSProjects under a monorepo use tsconfig module reoslution settings of nodenext and target es2021 - Added a global pdk command which aliases underlying package manager command 🕺 - Added an API Explorer powered by SwaggerUI to the CloudscapeReactTsWebsite which allows you to make authenticated API requests - Added an Infra package which allows you to create boilerplate CDK code for an API + Website. This means you can get a fully functioning website + API, with all Infra in < 70 LoC 👏 BREAKING CHANGES - All imports will need to be changed to aws-pdk/<pkg> - All dependencies on @aws-prototyping-sdk/* will need to be changed to a single dependency on aws-pdk - Refactored CDKGraph & CdkGraphDiagramPlugin to poly friendly definitions which will break existing consumers in TS (Py and Java never worked). - Removed PDKPipeline projen constructs. - Renamed nx-monorepo to monorepo - TypeSafeApi Python runtime moved to new python-nextgen OpenAPI generator, which means: - Properties of models can be referenced as attributes rather than dictionary syntax (eg .my_property rather than ["my_property"]). - Models are now serialised and deserialised using the .from_json and .to_json methods. - request_parameters and request_array_parameters are also models. - TypeSafeApi Python handlers import location changed from <package>.apis.tags.default_api_operation_config to <package>.api.operation_config. - TypeSafeApi Java classes for handlers/interceptors in runtime are no longer static subclasses of the Handlers class. The import location has changed from eg <package>.api.Handlers.SayHello to <package>.api.handlers.say_hello.SayHello.
- Loading branch information
Showing
607 changed files
with
34,238 additions
and
573,434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | ||
uses: nrwl/nx-set-shas@v2 | ||
with: | ||
main-branch-name: 'mainline' | ||
main-branch-name: "mainline" | ||
- name: Set git identity | ||
run: |- | ||
git config user.name "github-actions" | ||
|
@@ -42,7 +42,7 @@ jobs: | |
id: git_remote | ||
run: echo ::set-output name=latest_commit::"$(git ls-remote origin -h ${{ github.ref }} | cut -f1)" | ||
- name: Extract Dists | ||
run: rsync -a . ./dist --include="*/" --include="/public/docs/dist/**" --include="/packages/*/dist/**" --exclude="*" --prune-empty-dirs | ||
run: rsync -a . ./dist --include="*/" --include="/docs/dist/**" --include="/packages/aws-pdk/dist/**" --exclude="*" --prune-empty-dirs | ||
- name: Upload artifact | ||
if: ${{ steps.git_remote.outputs.latest_commit == github.sha }} | ||
uses: actions/[email protected] | ||
|
@@ -67,7 +67,7 @@ jobs: | |
path: dist | ||
- name: Release | ||
run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi | ||
working-directory: dist/packages/nx-monorepo | ||
working-directory: dist/packages/aws-pdk | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
|
@@ -92,8 +92,8 @@ jobs: | |
name: build-artifact | ||
path: dist | ||
- name: Release | ||
working-directory: dist/packages | ||
run: for d in *; do cd $d && ( [ -d "dist/js" ] && pnpm --package publib@latest dlx publib-npm || echo "Ignore `basename $PWD` - no dist/js" ) && cd ..; done; | ||
working-directory: dist/packages/aws-pdk | ||
run: pnpm --package publib@latest dlx publib-npm || echo "Ignore `basename $PWD` - no dist/js" | ||
env: | ||
NPM_DIST_TAG: latest | ||
NPM_REGISTRY: registry.npmjs.org | ||
|
@@ -122,8 +122,8 @@ jobs: | |
name: build-artifact | ||
path: dist | ||
- name: Release | ||
working-directory: dist/packages | ||
run: for d in *; do cd $d && ( [ -d "dist/java" ] && pnpm --package publib@latest dlx publib-maven || echo "Ignore `basename $PWD` - no dist/java" ) && cd ..; done; | ||
working-directory: dist/packages/aws-pdk | ||
run: pnpm --package publib@latest dlx publib-maven || echo "Ignore `basename $PWD` - no dist/java" | ||
env: | ||
MAVEN_ENDPOINT: https://aws.oss.sonatype.org | ||
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | ||
|
@@ -154,8 +154,8 @@ jobs: | |
name: build-artifact | ||
path: dist | ||
- name: Release | ||
working-directory: dist/packages | ||
run: for d in *; do cd $d && ( [ -d "dist/python" ] && pnpm --package publib@latest dlx publib-pypi || echo "Ignore `basename $PWD` - no dist/python" ) && cd ..; done; | ||
working-directory: dist/packages/aws-pdk | ||
run: pnpm --package publib@latest dlx publib-pypi || echo "Ignore `basename $PWD` - no dist/python" | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
|
@@ -181,16 +181,16 @@ jobs: | |
git config user.name "AWS PDK Automation" | ||
git config user.email "[email protected]" | ||
- name: Upload docs to Github | ||
run: zip -r docs.zip dist/public/docs/dist/docs/* && gh release upload $(cat dist/packages/nx-monorepo/dist/releasetag.txt) -R $GITHUB_REPOSITORY docs.zip && rm docs.zip | ||
run: zip -r docs.zip dist/docs/dist/docs/* && gh release upload $(cat dist/packages/aws-pdk/dist/releasetag.txt) -R $GITHUB_REPOSITORY docs.zip && rm docs.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
- name: Prepare Commit | ||
run: |- | ||
mv dist/public/docs/dist ${{ runner.temp }}/dist | ||
mv dist/docs/dist ${{ runner.temp }}/dist | ||
rsync --delete --exclude=.git --recursive ${{ runner.temp }}/dist/docs/ . | ||
touch .nojekyll | ||
git add . | ||
git diff --cached --exit-code >/dev/null || (git commit -am 'docs: publish from ${{ github.sha }}') | ||
- name: Push | ||
run: git push origin gh-pages:gh-pages | ||
# - name: Push | ||
# run: git push origin gh-pages:gh-pages |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,41 @@ | ||
/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 */ | ||
import { NxProject } from "./packages/nx-monorepo/src/components/nx-project"; | ||
import { PDKProject } from "./private/pdk-project"; | ||
import { AwsArchProject } from "./private/projects/aws-arch"; | ||
import { CdkGraphProject } from "./private/projects/cdk-graph"; | ||
import { CdkGraphPluginDiagramProject } from "./private/projects/cdk-graph-plugin-diagram"; | ||
import { CloudscapeReactTsWebsiteProject } from "./private/projects/cloudscape-react-ts-website"; | ||
import { DocsProject } from "./private/projects/docs-project"; | ||
import { IdentityProject } from "./private/projects/identity-project"; | ||
import { NXMonorepoProject } from "./private/projects/nx-monorepo-project"; | ||
import { OpenApiGatewayProject } from "./private/projects/open-api-gateway-project"; | ||
import { PDKMonorepoProject } from "./private/projects/pdk-monorepo-project"; | ||
import { PDKNagProject } from "./private/projects/pdk-nag-project"; | ||
import { PipelineProject } from "./private/projects/pipeline-project"; | ||
import { StaticWebsiteProject } from "./private/projects/static-website-project"; | ||
import { TypeSafeApiProject } from "./private/projects/type-safe-api-project"; | ||
import { AwsArchProject } from "./projenrc/projects/aws-arch-project"; | ||
import { AwsPdkProject } from "./projenrc/projects/aws-pdk-project"; | ||
import { CdkGraphPluginDiagramProject } from "./projenrc/projects/cdk-graph-plugin-diagram-project"; | ||
import { CdkGraphProject } from "./projenrc/projects/cdk-graph-project"; | ||
import { CloudscapeReactTsWebsiteProject } from "./projenrc/projects/cloudscape-react-ts-website-project"; | ||
import { DocsProject } from "./projenrc/projects/docs-project"; | ||
import { IdentityProject } from "./projenrc/projects/identity-project"; | ||
import { InfrastructureProject } from "./projenrc/projects/infrastructure-project"; | ||
import { MonorepoProject } from "./projenrc/projects/monorepo-project"; | ||
import { PDKMonorepoProject } from "./projenrc/projects/pdk-monorepo-project"; | ||
import { PDKNagProject } from "./projenrc/projects/pdk-nag-project"; | ||
import { PipelineProject } from "./projenrc/projects/pipeline-project"; | ||
import { StaticWebsiteProject } from "./projenrc/projects/static-website-project"; | ||
import { TypeSafeApiProject } from "./projenrc/projects/type-safe-api-project"; | ||
|
||
// root/parent project | ||
const monorepoProject = new PDKMonorepoProject(); | ||
|
||
new PDKNagProject(monorepoProject); | ||
|
||
// public packages | ||
new NXMonorepoProject(monorepoProject); | ||
new MonorepoProject(monorepoProject); | ||
new StaticWebsiteProject(monorepoProject); | ||
new IdentityProject(monorepoProject); | ||
new OpenApiGatewayProject(monorepoProject); | ||
new TypeSafeApiProject(monorepoProject); | ||
new CloudscapeReactTsWebsiteProject(monorepoProject); | ||
new AwsArchProject(monorepoProject); | ||
new CdkGraphProject(monorepoProject); | ||
new CdkGraphPluginDiagramProject(monorepoProject); | ||
new PipelineProject(monorepoProject); | ||
new InfrastructureProject(monorepoProject); | ||
|
||
// This must always appear after all other packages! | ||
new AwsPdkProject(monorepoProject); | ||
|
||
// docs | ||
const docsProject = new DocsProject(monorepoProject); | ||
// Docs should have a dependency on all publishable packages | ||
NxProject.ensure(docsProject).addImplicitDependency( | ||
...monorepoProject.sortedSubProjects.filter( | ||
(s: any) => s instanceof PDKProject && s.pdkRelease | ||
) | ||
); | ||
new DocsProject(monorepoProject); | ||
|
||
monorepoProject.synth(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Oops, something went wrong.