Skip to content

Modernise and cleanup lint configuration and build process #1177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
59b6e76
feat: lint and build upgrade
RembrandtK May 21, 2025
cdc7ef9
feat: lint and build upgrade
RembrandtK May 21, 2025
4a4bbab
Merge remote-tracking branch 'refs/remotes/origin/rem/lint-upgrade' i…
RembrandtK May 21, 2025
8d68581
fix: setting node-version to 20
RembrandtK May 21, 2025
30a1938
fix: downgrade typechain deps for compatibility with ethers v5
RembrandtK May 21, 2025
5f44c19
fix: module upgrades and code changes to fix build and test
RembrandtK May 22, 2025
b236d3b
fix: update typechain patch
RembrandtK May 22, 2025
a6c4e79
fix: coverage tests, package versions
RembrandtK May 22, 2025
6fdf2e6
fix: updating references to increased package versions
RembrandtK May 22, 2025
99607df
fix: yarn.lock update
RembrandtK May 22, 2025
ea09d5f
fix: removing container name from docker-compose
RembrandtK May 23, 2025
20584c6
fix: reverting unneeded hacks to test code
RembrandtK May 23, 2025
7147ea8
fix: test:coverage
RembrandtK May 23, 2025
887230e
chore: solidity-coverage version update and related token-distributio…
RembrandtK May 24, 2025
8bfc50b
fix: attempt to fix GH workflows
RembrandtK May 24, 2025
2b4b7d5
fix: attempt to fix GH workflows
RembrandtK May 24, 2025
5267dd9
fix: set ADDRESS_BOOK to address.json for CI
RembrandtK May 24, 2025
a538915
fix: attempt to fix GH workflow coverage options
RembrandtK May 24, 2025
9168b4f
fix: attempting to fix GH workflow coverage test
RembrandtK May 24, 2025
688b9cf
fix: trying to use original coverage script for CI
RembrandtK May 24, 2025
6255d60
fix: build all packages first for CI, not just contracts
RembrandtK May 24, 2025
a3b9d33
fix: build only sdk and contracts for contracts CI, not all packages
RembrandtK May 24, 2025
c38ae95
fix: changing build order for CI
RembrandtK May 24, 2025
6c9aae4
fix: updating to use artifacts dir
RembrandtK May 24, 2025
60b06b3
Merge branch 'main' into rem/lint-upgrade
RembrandtK May 29, 2025
e9bf8fc
feat: dev container improvements
RembrandtK Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
services:
dev-graph-contracts:
container_name: dev-graph-contracts
build:
context: .
dockerfile: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'yarn'
- name: Install dependencies
shell: bash
Expand Down
377 changes: 377 additions & 0 deletions .github/workflows/lint.yml

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ yarn-error.log*

# Dependency directories
node_modules/
forge-std/

# Yarn
.yarn/
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

Expand All @@ -19,6 +20,10 @@ cache/
cached/
cache

# ESLint cache
.eslintcache
packages/*/.eslintcache

# Build artifacts
dist/
build/
Expand Down Expand Up @@ -52,6 +57,8 @@ addresses-fork.json

# Forge artifacts
cache_forge
forge-artifacts/
packages/issuance/lib/forge-std/

# Graph client
.graphclient
Expand Down
5 changes: 3 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
(cd packages/contracts && npx --no-install lint-staged)
(cd packages/data-edge && npx --no-install lint-staged)
#!/usr/bin/env sh

npx lint-staged
9 changes: 9 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"default": true,
"MD013": false,
"MD024": { "siblings_only": true },
"MD033": false,
"MD029": { "style": "ordered" },
"MD007": { "indent": 2 },
"MD004": { "style": "dash" }
}
1 change: 0 additions & 1 deletion packages/contracts/.solhint.json → .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"func-visibility": ["warn", { "ignoreConstructors": true }],
"compiler-version": ["off"],
"constructor-syntax": "warn",
Expand Down
37 changes: 37 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
extends: default

rules:
line-length:
max: 120
level: warning
indentation:
spaces: 2
indent-sequences: true
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
document-start:
present: true
document-end:
present: false
comments:
min-spaces-from-content: 1
braces:
min-spaces-inside: 0
max-spaces-inside: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1

ignore: |
node_modules/
dist/
build/
cache/
coverage/
.yarn/
packages/
56 changes: 56 additions & 0 deletions .yarn/patches/typechain-npm-8.3.2-b02e27439e.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/dist/typechain/io.js b/dist/typechain/io.js
index 725231a5ab1d8cc5f68a39ba730dddccf6a30f32..cfe0150aa07d09a32dd01c0670edb48d3c3786ce 100644
--- a/dist/typechain/io.js
+++ b/dist/typechain/io.js
@@ -7,19 +7,25 @@ const path_1 = require("path");
const outputTransformers_1 = require("../codegen/outputTransformers");
const abiParser_1 = require("../parser/abiParser");
const debug_1 = require("../utils/debug");
-function processOutput(services, cfg, output) {
+async function processOutput(services, cfg, output) {
const { fs, mkdirp } = services;
if (!output) {
return 0;
}
const outputFds = (0, lodash_1.isArray)(output) ? output : [output];
- outputFds.forEach((fd) => {
+ for (const fd of outputFds) {
// ensure directory first
mkdirp((0, path_1.dirname)(fd.path));
- const finalOutput = outputTransformers_1.outputTransformers.reduce((content, transformer) => transformer(content, services, cfg), fd.contents);
+ let finalOutput = outputTransformers_1.outputTransformers.reduce((content, transformer) => transformer(content, services, cfg), fd.contents);
+
+ // If finalOutput is a Promise, await it
+ if (finalOutput && typeof finalOutput.then === 'function') {
+ finalOutput = await finalOutput;
+ }
+
(0, debug_1.debug)(`Writing file: ${(0, path_1.relative)(cfg.cwd, fd.path)}`);
fs.writeFileSync(fd.path, finalOutput, 'utf8');
- });
+ }
return outputFds.length;
}
exports.processOutput = processOutput;
diff --git a/dist/typechain/runTypeChain.js b/dist/typechain/runTypeChain.js
index a5adce89148c1edd2bcdafe2d01d9a66ca2b57e4..b731c472b496c7639ffc531ffedd6b479b52d7f5 100644
--- a/dist/typechain/runTypeChain.js
+++ b/dist/typechain/runTypeChain.js
@@ -62,14 +62,14 @@ async function runTypeChain(publicConfig) {
const target = (0, findTarget_1.findTarget)(config);
const fileDescriptions = (0, io_1.loadFileDescriptions)(services, config.filesToProcess);
(0, debug_1.debug)('Executing beforeRun()');
- filesGenerated += (0, io_1.processOutput)(services, config, await target.beforeRun());
+ filesGenerated += await (0, io_1.processOutput)(services, config, await target.beforeRun());
(0, debug_1.debug)('Executing beforeRun()');
for (const fd of fileDescriptions) {
(0, debug_1.debug)(`Processing ${(0, path_1.relative)(config.cwd, fd.path)}`);
- filesGenerated += (0, io_1.processOutput)(services, config, await target.transformFile(fd));
+ filesGenerated += await (0, io_1.processOutput)(services, config, await target.transformFile(fd));
}
(0, debug_1.debug)('Running afterRun()');
- filesGenerated += (0, io_1.processOutput)(services, config, await target.afterRun());
+ filesGenerated += await (0, io_1.processOutput)(services, config, await target.afterRun());
return {
filesGenerated,
};
1 change: 0 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
nodeLinker: node-modules
nmHoistingLimits: workspaces
Loading
Loading