mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-26 02:10:07 +00: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 }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
|
||||||
restore-keys: ${{ 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...
|
- name: Formatting...
|
||||||
run: node common/scripts/install-run-rush.js fast-format
|
run: node common/scripts/install-run-rush.js fast-format
|
||||||
- name: Check files formatting
|
- name: Check files formatting
|
||||||
@ -136,8 +147,8 @@ jobs:
|
|||||||
echo '================================================================'
|
echo '================================================================'
|
||||||
echo 'Checking for diff files'
|
echo 'Checking for diff files'
|
||||||
echo '================================================================'
|
echo '================================================================'
|
||||||
git diff '*.ts' '*.svelte' | cat
|
git diff '*.js' '*.ts' '*.svelte' '*.json' | cat
|
||||||
[ -z "$(git diff --name-only '*.ts' '*.svelte' | cat)" ]
|
[ -z "$(git diff --name-only '*.js' '*.ts' '*.svelte' '*.json' | cat)" ]
|
||||||
echo '================================================================'
|
echo '================================================================'
|
||||||
test:
|
test:
|
||||||
needs: build
|
needs: build
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"isolatedModules": true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,6 +11,8 @@
|
|||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"types" : [],
|
||||||
|
"isolatedModules": true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,6 +14,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"isolatedModules": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"isolatedModules": true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -16,6 +16,8 @@
|
|||||||
"esnext",
|
"esnext",
|
||||||
"dom"
|
"dom"
|
||||||
],
|
],
|
||||||
"incremental": true
|
"incremental": true,
|
||||||
|
"types": ["jest"],
|
||||||
|
"isolatedModules": true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -29,8 +29,8 @@
|
|||||||
"prettier-plugin-svelte": "^3.1.0",
|
"prettier-plugin-svelte": "^3.1.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.1",
|
||||||
"@types/jest":"^29.5.5",
|
"@types/jest": "^29.5.5",
|
||||||
"typescript":"^5.3.3"
|
"typescript": "^5.3.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lexorank": "~1.0.4"
|
"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
|
let template
|
||||||
for (const t of templates) {
|
for (const t of templates) {
|
||||||
if( t.isDefault) {
|
if( t.isDefault && currentPackage.template === undefined) {
|
||||||
template = t
|
template = t
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ function updatePackage(packageRoot, templates) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t.package.peerDependencies !== undefined) {
|
if (t.package.peerDependencies !== undefined && currentPackage.template === undefined) {
|
||||||
const peers = Object.keys(t.package.peerDependencies)
|
const peers = Object.keys(t.package.peerDependencies)
|
||||||
const deps = Object.keys(currentPackage.dependencies ?? {})
|
const deps = Object.keys(currentPackage.dependencies ?? {})
|
||||||
const devDeps = Object.keys(currentPackage.devDependencies ?? {})
|
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)
|
console.log('updating => ', currentPackage.name, ' with template', template.package.name)
|
||||||
|
|
||||||
const packageJson = template.package
|
const packageJson = template.package
|
||||||
|
Loading…
Reference in New Issue
Block a user