Skip to content

Commit

Permalink
Faster format for ts files (#315)
Browse files Browse the repository at this point in the history
* Faster format command in project root

* Format miscellaneous files
  • Loading branch information
spalladino authored Apr 20, 2023
1 parent 60c8409 commit d800474
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 20 deletions.
7 changes: 6 additions & 1 deletion yarn-project/.prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.yarn
.yarn
node_modules/
dest/
*.md
ethereum.js/example/
ethereum.js/src/contract/fixtures/
2 changes: 1 addition & 1 deletion yarn-project/l1-contracts/contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"buildFile": "../../l1-contracts/out/UnverifiedDataEmitter.sol/UnverifiedDataEmitter.json"
}
}
}
}
6 changes: 1 addition & 5 deletions yarn-project/package.common.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
"formatting:fix": "run -T prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
},
"files": [
"dest",
"src",
"!*.test.*"
],
"files": ["dest", "src", "!*.test.*"],
"types": "./dest/index.d.ts",
"devDependencies": {
"@jest/globals": "^29.5.0",
Expand Down
1 change: 1 addition & 0 deletions yarn-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"docs": "typedoc --out docs/dist && cd docs && yarn serve",
"formatting": "yarn workspaces foreach -v run formatting",
"formatting:fix": "yarn workspaces foreach -v run formatting:fix",
"format": "yarn prettier --cache -w .",
"test": "yarn build && yarn workspaces foreach -v run test",
"build": "tsc -b tsconfig.json",
"build:dev": "tsc -b tsconfig.json --watch",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/sequencer-client/jest.integration.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
},
"testRegex": "./test/.*\\.test\\.ts$",
"rootDir": "./test"
}
}
2 changes: 1 addition & 1 deletion yarn-project/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
{ "path": "types/tsconfig.json" },
{ "path": "world-state/tsconfig.json" }
],
"files": ["./@types/jest/index.d.ts"],
"files": ["./@types/jest/index.d.ts"]
}
2 changes: 1 addition & 1 deletion yarn-project/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"world-state",
"merkle-tree"
]
}
}
15 changes: 5 additions & 10 deletions yarn-project/yarn-project-base/scripts/update_build_manifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// Updates build manifest for a package based on a package.json

import { existsSync, readFileSync, writeFileSync } from "fs";
import { basename, dirname, resolve, join } from "path";
import { existsSync, readFileSync, writeFileSync } from 'fs';
import { basename, dirname, resolve, join } from 'path';
import { cwd } from 'process';

// Update build_manifest.json with new dependencies
Expand Down Expand Up @@ -73,7 +73,7 @@ function main() {
// Process options if any
const options = { checkOnly: false };
for (const arg of process.argv.slice(3)) {
if (arg === "--check") {
if (arg === '--check') {
options.checkOnly = true;
} else {
console.error(`Unknown option ${arg}`);
Expand All @@ -82,18 +82,13 @@ function main() {
}

// Read package.json
const packageData = JSON.parse(readFileSync(packageJsonFile, "utf-8"));
const packageData = JSON.parse(readFileSync(packageJsonFile, 'utf-8'));

// Get the directory name of the directory that holds package.json
const projectKey = basename(dirname(resolve(packageJsonFile)));

// Add the path to the build-manifest.json file
const buildManifestFile = join(
dirname(packageJsonFile),
"..",
"..",
"build_manifest.json"
);
const buildManifestFile = join(dirname(packageJsonFile), '..', '..', 'build_manifest.json');

// Update build_manifest.json with the new dependencies
updateBuildManifest(
Expand Down

0 comments on commit d800474

Please sign in to comment.