-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
155 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
extends: ['@amazeelabs/eslint-config'], | ||
root: 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 @@ | ||
"@amazeelabs/prettier-config" |
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,21 @@ | ||
{ | ||
"name": "@-amazeelabs/silverback-template-tests", | ||
"version": "1.0.0", | ||
"description": "Checks if silverback-template works with the latest changes from the monorepo.", | ||
"author": "Amazee Labs", | ||
"license": "MIT", | ||
"private": true, | ||
"devDependencies": { | ||
"@amazeelabs/eslint-config": "1.4.43", | ||
"@amazeelabs/prettier-config": "1.1.3", | ||
"@types/node": "20.8.5", | ||
"eslint": "8.51.0", | ||
"prettier": "3.0.3", | ||
"tsx": "3.13.0", | ||
"typescript": "5.2.2" | ||
}, | ||
"scripts": { | ||
"test:static": "tsc --noEmit && eslint \"**/*.{ts,tsx,js,jsx}\" --ignore-path=\"./.gitignore\" --fix", | ||
"prepare-template": "tsx prepare-template.ts" | ||
} | ||
} |
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,51 @@ | ||
import { execSync } from 'child_process'; | ||
|
||
type Package = { | ||
name: string; | ||
version: string; | ||
path: string; | ||
private: boolean; | ||
}; | ||
|
||
console.log('Clone template and install its deps.'); | ||
execSync( | ||
[ | ||
'rm -rf /tmp/silverback-template', | ||
'cd /tmp', | ||
'git clone https://github.com/AmazeeLabs/silverback-template.git', | ||
'cd /tmp/silverback-template', | ||
'pnpm i', | ||
].join(' && '), | ||
); | ||
|
||
console.log('Make all monorepo public packages available for linking.'); | ||
const monoPackages: Array<Package> = JSON.parse( | ||
execSync('pnpm -r exec pnpm list -r --depth -1 --json').toString(), | ||
); | ||
for (const pkg of monoPackages) { | ||
if (!pkg.private && pkg.name.startsWith('@amazeelabs/')) { | ||
execSync(`cd ${pkg.path} && pnpm link --global`); | ||
} | ||
} | ||
|
||
console.log('Link monorepo packages to template.'); | ||
const templatePackages: Array<Package> = JSON.parse( | ||
execSync( | ||
[ | ||
'cd /tmp/silverback-template', | ||
'pnpm -r exec pnpm list -r --depth -1 --json', | ||
].join(' && '), | ||
).toString(), | ||
); | ||
for (const pkg of templatePackages) { | ||
const names = execSync( | ||
`cd ${pkg.path} && ls -1 node_modules/@amazeelabs || true`, | ||
) | ||
.toString() | ||
.split('\n') | ||
.map((it) => it.trim()) | ||
.filter((it) => !!it); | ||
for (const name of names) { | ||
execSync(`cd ${pkg.path} && pnpm link --global @amazeelabs/${name}`); | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"skipLibCheck": true, | ||
"lib": ["es2015"], | ||
"types": ["node"] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.