Skip to content

Commit 70dfd5c

Browse files
committed
Fix platform-rig detection
1 parent 5b2572b commit 70dfd5c

File tree

9 files changed

+136
-80
lines changed

9 files changed

+136
-80
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 75 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/scripts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"format": "echo \"No format specified\""
66
},
77
"devDependencies": {
8-
"@hcengineering/platform-rig": "workspace:^0.7.13",
9-
"@typescript-eslint/eslint-plugin": "^8.46.0",
8+
"@hcengineering/platform-rig": "workspace:^0.7.14",
9+
"@typescript-eslint/eslint-plugin": "^6.11.0",
1010
"eslint-plugin-import": "^2.26.0",
1111
"eslint-plugin-promise": "^6.1.1",
1212
"eslint-plugin-n": "^15.4.0",

packages/measurements-otlp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"_phase:validate": "compile validate"
2828
},
2929
"devDependencies": {
30-
"@hcengineering/platform-rig": "workspace:^0.7.13",
30+
"@hcengineering/platform-rig": "workspace:^0.7.14",
3131
"jest": "^29.7.0",
3232
"ts-jest": "^29.1.1",
3333
"@types/jest": "^29.5.5",
34-
"@typescript-eslint/eslint-plugin": "^8.46.0",
34+
"@typescript-eslint/eslint-plugin": "^6.11.0",
3535
"@typescript-eslint/parser": "^8.46.0",
3636
"eslint": "^8.54.0",
3737
"eslint-config-standard-with-typescript": "^40.0.0",

packages/measurements/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"_phase:validate": "compile validate"
2828
},
2929
"devDependencies": {
30-
"@hcengineering/platform-rig": "workspace:^0.7.13",
30+
"@hcengineering/platform-rig": "workspace:^0.7.14",
3131
"jest": "^29.7.0",
3232
"ts-jest": "^29.1.1",
3333
"@types/jest": "^29.5.5",
34-
"@typescript-eslint/eslint-plugin": "^8.46.0",
34+
"@typescript-eslint/eslint-plugin": "^6.11.0",
3535
"@typescript-eslint/parser": "^8.46.0",
3636
"eslint": "^8.54.0",
3737
"eslint-config-standard-with-typescript": "^40.0.0",

packages/platform-rig/CHANGELOG.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{
22
"name": "@hcengineering/platform-rig",
33
"entries": [
4+
{
5+
"version": "0.7.14",
6+
"tag": "@hcengineering/platform-rig_v0.7.14",
7+
"date": "Sat, 11 Oct 2025 18:10:18 GMT",
8+
"comments": {
9+
"patch": [
10+
{
11+
"comment": "Fix eslint script"
12+
}
13+
]
14+
}
15+
},
416
{
517
"version": "0.7.13",
618
"tag": "@hcengineering/platform-rig_v0.7.13",

packages/platform-rig/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log - @hcengineering/platform-rig
22

3-
This log was last generated on Sat, 11 Oct 2025 17:58:53 GMT and should not be manually modified.
3+
This log was last generated on Sat, 11 Oct 2025 18:10:18 GMT and should not be manually modified.
4+
5+
## 0.7.14
6+
Sat, 11 Oct 2025 18:10:18 GMT
7+
8+
### Patches
9+
10+
- Fix eslint script
411

512
## 0.7.13
613
Sat, 11 Oct 2025 17:58:53 GMT

packages/platform-rig/bin/sync-eslint-deps.js

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ function isEslintDependency(depName) {
4545
return ESLINT_PATTERNS.some((pattern) => depName.startsWith(pattern))
4646
}
4747

48+
/**
49+
* Find platform-rig in node_modules
50+
*/
51+
function findPlatformRigPath() {
52+
// Try to find platform-rig in node_modules
53+
const cwd = process.cwd()
54+
const possiblePaths = [path.join(cwd, 'common', 'scripts', 'node_modules', '@hcengineering', 'platform-rig')]
55+
56+
for (const platformRigPath of possiblePaths) {
57+
const packageJsonPath = path.join(platformRigPath, 'package.json')
58+
if (fs.existsSync(packageJsonPath)) {
59+
return platformRigPath
60+
}
61+
}
62+
63+
return null
64+
}
65+
4866
/**
4967
* Get ESLint dev dependencies from platform-rig package.json
5068
*/
@@ -128,18 +146,18 @@ function main() {
128146
console.log('🔍 Syncing ESLint dependencies from platform-rig to all packages...\n')
129147

130148
try {
131-
// Get all Rush projects
132-
const projects = getRushProjects()
133-
console.log(`Found ${projects.length} projects in Rush workspace\n`)
134-
135-
// Find platform-rig project
136-
const platformRigProject = projects.find((p) => p.name === '@hcengineering/platform-rig')
137-
if (!platformRigProject) {
138-
throw new Error('platform-rig package not found in Rush workspace')
149+
// Find platform-rig in node_modules
150+
const platformRigPath = findPlatformRigPath()
151+
if (!platformRigPath) {
152+
console.log('⚠️ platform-rig package not found in node_modules. Skipping sync.')
153+
console.log(' Make sure @hcengineering/platform-rig is installed as a dependency.')
154+
return
139155
}
140156

157+
console.log(`📍 Found platform-rig at: ${platformRigPath}\n`)
158+
141159
// Get ESLint dependencies from platform-rig
142-
const eslintDeps = getEslintDepsFromPlatformRig(platformRigProject.fullPath)
160+
const eslintDeps = getEslintDepsFromPlatformRig(platformRigPath)
143161

144162
if (Object.keys(eslintDeps).length === 0) {
145163
console.log('⚠️ No ESLint dependencies found in platform-rig')
@@ -152,6 +170,10 @@ function main() {
152170
}
153171
console.log()
154172

173+
// Get all Rush projects
174+
const projects = getRushProjects()
175+
console.log(`Found ${projects.length} projects in Rush workspace\n`)
176+
155177
// Update all packages
156178
let updatedCount = 0
157179
let skippedCount = 0

packages/platform-rig/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hcengineering/platform-rig",
3-
"version": "0.7.13",
3+
"version": "0.7.14",
44
"scripts": {
55
"build": "echo 'Not required'",
66
"format": "echo 'Not required'"
@@ -13,7 +13,7 @@
1313
"typescript": "^5.9.3",
1414
"esbuild": "^0.25.10",
1515
"esbuild-plugin-copy": "^2.1.1",
16-
"@typescript-eslint/eslint-plugin": "^8.46.0",
16+
"@typescript-eslint/eslint-plugin": "^6.11.0",
1717
"eslint-plugin-import": "^2.26.0",
1818
"eslint-plugin-promise": "^6.1.1",
1919
"eslint-plugin-n": "^15.4.0",

packages/postgres-base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
"_phase:validate": "compile validate"
2929
},
3030
"devDependencies": {
31-
"@hcengineering/platform-rig": "workspace:^0.7.13",
31+
"@hcengineering/platform-rig": "workspace:^0.7.14",
3232
"jest": "^29.7.0",
3333
"ts-jest": "^29.1.1",
3434
"@types/jest": "^29.5.5",
3535
"@types/node": "^22.15.29",
36-
"@typescript-eslint/eslint-plugin": "^8.46.0",
36+
"@typescript-eslint/eslint-plugin": "^6.11.0",
3737
"@typescript-eslint/parser": "^8.46.0",
3838
"eslint": "^8.54.0",
3939
"eslint-config-standard-with-typescript": "^40.0.0",

0 commit comments

Comments
 (0)