forked from chanzuckerberg/fogg
-
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.
- feat: Add pnpm + turbo.build monorepo structure - feat: Add biomejs formatter config - feat: Extract FoggStack to pkg - feat: Extract Golang struct to Typescript Interface generator - feat: Add FoggStack unit tests - feat: Add Vitest unit tests - feat: Add release-please node-workspace configuration - feat: Add pnpm publish to GH Pkgs logic
- Loading branch information
1 parent
c2ed461
commit f1f6347
Showing
39 changed files
with
8,819 additions
and
20 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
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
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
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 |
---|---|---|
|
@@ -4,9 +4,14 @@ on: | |
- feat-multi-module-components | ||
|
||
name: release-please | ||
env: | ||
CI: true | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: release please | ||
uses: google-github-actions/[email protected] | ||
|
@@ -15,6 +20,8 @@ jobs: | |
# https://github.com/google-github-actions/release-please-action#github-credentials | ||
token: ${{ secrets.VINCENT_PAT }} | ||
|
||
## publish Go release | ||
|
||
- uses: actions/checkout@v4 | ||
# we need to fetch all history and tags | ||
# so we build the proper version | ||
|
@@ -35,3 +42,34 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.VINCENT_PAT }} | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
## publish CDKTF pkg | ||
|
||
# pnpm required for setup-node cache support | ||
# ref: | ||
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data | ||
# - https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-nodejs-packages#publishing-packages-to-github-packages | ||
# - https://pnpm.io/using-changesets#publishing | ||
- name: Setup pnpm from .packageManager | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
run_install: false | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Use Node.js from .nvmrc | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: "pnpm" | ||
registry-url: "https://npm.pkg.github.com" | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Run pnpm Build | ||
run: | | ||
pnpm install --frozen-lockfile | ||
pnpm run build | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Run pnpm Publish | ||
run: pnpm ci:publish | ||
env: | ||
# setup-node action sets up .npmrc for NODE_AUTH_TOKEN | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ steps.release.outputs.release_created }} |
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,12 +1,13 @@ | ||
fogg | ||
coverage.out | ||
dist | ||
.vscode | ||
!templates/templates/turbo/root/.vscode | ||
!testdata/**/.vscode | ||
|
||
coverage.txt | ||
|
||
bin | ||
node_modules/ | ||
package-lock.json | ||
|
||
**/coverage/** | ||
.turbo | ||
node_modules |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@vincenthsh:registry=https://npm.pkg.github.com | ||
auto-install-peers = true |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v18 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome", "dbaeumer.vscode-eslint"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// Ref: https://vitest.dev/guide/debugging#vs-code | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Current Test File", | ||
"autoAttachChildProcesses": true, | ||
"skipFiles": ["<node_internals>/**", "**/node_modules/**"], | ||
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs", | ||
"args": ["run", "${relativeFile}", "--update"], | ||
"smartStep": true, | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"eslint.workingDirectories": [ | ||
{ | ||
"mode": "auto" | ||
} | ||
], | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
}, | ||
"editor.formatOnSave": true | ||
} |
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 |
---|---|---|
@@ -0,0 +1,155 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, | ||
"files": { "ignoreUnknown": false, "ignore": ["*.generated.ts"] }, | ||
"formatter": { | ||
"enabled": true, | ||
"useEditorconfig": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineEnding": "lf", | ||
"lineWidth": 80, | ||
"attributePosition": "auto", | ||
"bracketSpacing": true | ||
}, | ||
"organizeImports": { "enabled": true }, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": false, | ||
"complexity": { | ||
"noBannedTypes": "off", | ||
"noExtraBooleanCast": "error", | ||
"noMultipleSpacesInRegularExpressionLiterals": "error", | ||
"noUselessCatch": "error", | ||
"noUselessTypeConstraint": "error", | ||
"noWith": "error" | ||
}, | ||
"correctness": { | ||
"noConstAssign": "error", | ||
"noConstantCondition": "error", | ||
"noEmptyCharacterClassInRegex": "error", | ||
"noEmptyPattern": "error", | ||
"noGlobalObjectCalls": "error", | ||
"noInvalidBuiltinInstantiation": "error", | ||
"noInvalidConstructorSuper": "error", | ||
"noNonoctalDecimalEscape": "error", | ||
"noPrecisionLoss": "error", | ||
"noSelfAssign": "error", | ||
"noSetterReturn": "error", | ||
"noSwitchDeclarations": "error", | ||
"noUndeclaredVariables": "error", | ||
"noUnreachable": "error", | ||
"noUnreachableSuper": "error", | ||
"noUnsafeFinally": "error", | ||
"noUnsafeOptionalChaining": "error", | ||
"noUnusedLabels": "error", | ||
"noUnusedPrivateClassMembers": "error", | ||
"noUnusedVariables": "error", | ||
"useArrayLiterals": "off", | ||
"useIsNan": "error", | ||
"useValidForDirection": "error", | ||
"useYield": "error" | ||
}, | ||
"style": { | ||
"noInferrableTypes": "off", | ||
"noNamespace": "error", | ||
"useAsConstAssertion": "error", | ||
"useBlockStatements": "off" | ||
}, | ||
"suspicious": { | ||
"noAsyncPromiseExecutor": "error", | ||
"noCatchAssign": "error", | ||
"noClassAssign": "error", | ||
"noCompareNegZero": "error", | ||
"noConsole": "off", | ||
"noControlCharactersInRegex": "error", | ||
"noDebugger": "error", | ||
"noDuplicateCase": "error", | ||
"noDuplicateClassMembers": "error", | ||
"noDuplicateObjectKeys": "error", | ||
"noDuplicateParameters": "error", | ||
"noEmptyBlockStatements": "error", | ||
"noExplicitAny": "warn", | ||
"noExtraNonNullAssertion": "error", | ||
"noFallthroughSwitchClause": "error", | ||
"noFunctionAssign": "error", | ||
"noGlobalAssign": "error", | ||
"noImportAssign": "error", | ||
"noMisleadingCharacterClass": "error", | ||
"noMisleadingInstantiator": "error", | ||
"noPrototypeBuiltins": "error", | ||
"noRedeclare": "error", | ||
"noShadowRestrictedNames": "error", | ||
"noSparseArray": "error", | ||
"noUnsafeDeclarationMerging": "error", | ||
"noUnsafeNegation": "error", | ||
"useGetterReturn": "error", | ||
"useNamespaceKeyword": "error", | ||
"useValidTypeof": "error" | ||
} | ||
}, | ||
"ignore": [ | ||
".*.?(c)js", | ||
"*.config*.?(c|m)js", | ||
".*.ts", | ||
"*.config*.ts", | ||
"*.d.ts", | ||
"dist", | ||
".git", | ||
"node_modules", | ||
"coverage" | ||
] | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"trailingCommas": "all", | ||
"semicolons": "asNeeded", | ||
"arrowParentheses": "always", | ||
"bracketSameLine": false, | ||
"quoteStyle": "single", | ||
"attributePosition": "auto", | ||
"bracketSpacing": true | ||
}, | ||
"globals": ["exports"] | ||
}, | ||
"overrides": [ | ||
{ | ||
"include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], | ||
"linter": { | ||
"rules": { | ||
"correctness": { | ||
"noConstAssign": "off", | ||
"noGlobalObjectCalls": "off", | ||
"noInvalidBuiltinInstantiation": "off", | ||
"noInvalidConstructorSuper": "off", | ||
"noNewSymbol": "off", | ||
"noSetterReturn": "off", | ||
"noUndeclaredVariables": "off", | ||
"noUnreachable": "off", | ||
"noUnreachableSuper": "off" | ||
}, | ||
"style": { | ||
"noArguments": "error", | ||
"noVar": "error", | ||
"useConst": "error" | ||
}, | ||
"suspicious": { | ||
"noClassAssign": "off", | ||
"noDuplicateClassMembers": "off", | ||
"noDuplicateObjectKeys": "off", | ||
"noDuplicateParameters": "off", | ||
"noFunctionAssign": "off", | ||
"noImportAssign": "off", | ||
"noRedeclare": "off", | ||
"noUnsafeNegation": "off", | ||
"useGetterReturn": "off" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "fogg-npm-monorepo", | ||
"description": "Monorepo for Fogg npm packages", | ||
"private": true, | ||
"scripts": { | ||
"type-check": "turbo type-check", | ||
"test": "turbo test", | ||
"build": "turbo run build", | ||
"lint": "turbo run lint", | ||
"format": "turbo run prettier", | ||
"repo-lint": "sherif", | ||
"clean": "turbo clean && rm -rf node_modules", | ||
"ci:publish": "pnpm publish -r" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@biomejs/biome": "1.9.4", | ||
"sherif": "^1.0.2", | ||
"turbo": "^2.3.3", | ||
"vitest": "^2.1.6" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=18.20.5" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
cdktf.log | ||
tsconfig.tsbuildinfo |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Typescriptify Fogg structs | ||
|
||
Generates TS Interface from Fogg golang structs | ||
|
||
```bash | ||
pnpm run go:generate | ||
``` |
Oops, something went wrong.