mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-03 17:05:16 +03:00
Add apply-templates check (#4907)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com> Co-authored-by: Eduard Aksamitov <e@euaaaio.ru>
This commit is contained in:
parent
79b4390911
commit
5cadf883c0
15
.github/workflows/main.yml
vendored
15
.github/workflows/main.yml
vendored
@ -129,6 +129,17 @@ jobs:
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
|
||||
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
|
||||
|
||||
- name: Apply templates...
|
||||
run: node common/scripts/install-run-rush.js apply-templates
|
||||
|
||||
- name: Check templates
|
||||
run: |
|
||||
echo '================================================================'
|
||||
echo 'Checking for diff files'
|
||||
echo '================================================================'
|
||||
git diff '*.js' '*.ts' '*.svelte' '*.json' | cat
|
||||
[ -z "$(git diff --name-only '*.js' '*.ts' '*.svelte' '*.json' | cat)" ]
|
||||
echo '================================================================'
|
||||
- name: Formatting...
|
||||
run: node common/scripts/install-run-rush.js fast-format
|
||||
- name: Check files formatting
|
||||
@ -136,8 +147,8 @@ jobs:
|
||||
echo '================================================================'
|
||||
echo 'Checking for diff files'
|
||||
echo '================================================================'
|
||||
git diff '*.ts' '*.svelte' | cat
|
||||
[ -z "$(git diff --name-only '*.ts' '*.svelte' | cat)" ]
|
||||
git diff '*.js' '*.ts' '*.svelte' '*.json' | cat
|
||||
[ -z "$(git diff --name-only '*.js' '*.ts' '*.svelte' '*.json' | cat)" ]
|
||||
echo '================================================================'
|
||||
test:
|
||||
needs: build
|
||||
|
@ -16,6 +16,7 @@
|
||||
"esModuleInterop": true,
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"incremental": true
|
||||
"incremental": true,
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
@ -11,6 +11,8 @@
|
||||
"skipDefaultLibCheck": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"incremental": true
|
||||
"incremental": true,
|
||||
"types" : [],
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@
|
||||
"esModuleInterop": true,
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"incremental": true
|
||||
"incremental": true,
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
"esModuleInterop": true,
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"incremental": true
|
||||
"incremental": true,
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"incremental": true
|
||||
"incremental": true,
|
||||
"types": ["jest"],
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
@ -29,8 +29,8 @@
|
||||
"prettier-plugin-svelte": "^3.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"ts-jest": "^29.1.1",
|
||||
"@types/jest":"^29.5.5",
|
||||
"typescript":"^5.3.3"
|
||||
"@types/jest": "^29.5.5",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"lexorank": "~1.0.4"
|
||||
|
4
pods/authProviders/config/rig.json
Normal file
4
pods/authProviders/config/rig.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
|
||||
"rigPackageName": "@hcengineering/platform-rig"
|
||||
}
|
@ -66,7 +66,7 @@ function updatePackage(packageRoot, templates) {
|
||||
|
||||
let template
|
||||
for (const t of templates) {
|
||||
if( t.isDefault) {
|
||||
if( t.isDefault && currentPackage.template === undefined) {
|
||||
template = t
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ function updatePackage(packageRoot, templates) {
|
||||
break
|
||||
}
|
||||
|
||||
if (t.package.peerDependencies !== undefined) {
|
||||
if (t.package.peerDependencies !== undefined && currentPackage.template === undefined) {
|
||||
const peers = Object.keys(t.package.peerDependencies)
|
||||
const deps = Object.keys(currentPackage.dependencies ?? {})
|
||||
const devDeps = Object.keys(currentPackage.devDependencies ?? {})
|
||||
@ -86,6 +86,11 @@ function updatePackage(packageRoot, templates) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if( template === undefined) {
|
||||
console.warn('No template found for package', currentPackage.template)
|
||||
return
|
||||
}
|
||||
|
||||
console.log('updating => ', currentPackage.name, ' with template', template.package.name)
|
||||
|
||||
const packageJson = template.package
|
||||
|
Loading…
Reference in New Issue
Block a user