Skip to content

Commit 8fc8034

Browse files
committed
chore: fix test:changed script
1 parent d71f1cc commit 8fc8034

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
"compile": "nx run-many -t compile",
3636
"test": "nx run-many -t test",
3737
"test:browser": "nx run-many -t test:browser",
38-
"test:ci:changed": "nx affected -t lint --base=origin/main --head=HEAD",
39-
"test-all-versions": "npm run --if-present --workspaces test-all-versions",
38+
"test:ci:changed": "nx affected -t test --base=origin/main --head=HEAD",
39+
"test-all-versions": "nx run-many -t test-all-versions",
4040
"bump": "lerna publish",
4141
"changelog": "lerna-changelog",
4242
"lint": "nx run-many -t lint && npm run lint:readme && npm run lint:markdown",
43-
"lint:fix": "lerna run lint:fix && npm run lint:markdown:fix",
43+
"lint:fix": "nx run-many -t lint:fix && npm run lint:markdown:fix",
4444
"lint:examples": "eslint ./examples/**/*.js",
4545
"lint:examples:fix": "eslint ./examples/**/*.js --fix",
4646
"lint:markdown": "markdownlint-cli2 $(git ls-files '*.md')",

scripts/update-otel-deps.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,32 @@ function updateNpmWorkspacesDeps({patterns, allowRangeBumpFor0x, dryRun}) {
331331
);
332332
}
333333

334-
async function main() {
335-
updateNpmWorkspacesDeps({
336-
patterns: ['@opentelemetry/*'],
337-
allowRangeBumpFor0x: true,
338-
dryRun: false,
334+
function removePrecompile() {
335+
const dirs = getAllWorkspaceDirs();
336+
337+
dirs.forEach(d => {
338+
const pkgPath = path.join(d, 'package.json');
339+
const pkgText = fs.readFileSync(pkgPath, 'utf-8');
340+
const pkgLines = pkgText.split('\n');
341+
342+
const removeIndex = pkgLines.findIndex(l => l.indexOf('"precompile":') !== -1)
343+
const shouldRemove = removeIndex !== -1;
344+
345+
console.log(d, removeIndex)
346+
if (shouldRemove) {
347+
pkgLines.splice(removeIndex, 1);
348+
fs.writeFileSync(pkgPath, pkgLines.join('\n'), 'utf-8');
349+
}
339350
});
340351
}
341352

353+
async function main() {
354+
// updateNpmWorkspacesDeps({
355+
// patterns: ['@opentelemetry/*'],
356+
// allowRangeBumpFor0x: true,
357+
// dryRun: false,
358+
// });
359+
removePrecompile();
360+
}
361+
342362
main();

0 commit comments

Comments
 (0)