Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 0 deletions .github/workflows/create-sentry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ jobs:
uses: snapshot-labs/actions/.github/workflows/create-sentry-release.yml@main
secrets: inherit
with:
package_manager: bun
project: snapshot-sequencer
sourcemaps: './build'
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ jobs:
lint:
uses: snapshot-labs/actions/.github/workflows/lint.yml@main
secrets: inherit
with:
package_manager: bun
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
uses: snapshot-labs/actions/.github/workflows/test.yml@main
secrets: inherit
with:
package_manager: bun
mysql_database_name: snapshot_sequencer_test
mysql_schema_path: 'test/schema.sql'
redis: true
1,654 changes: 1,654 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

34 changes: 20 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
"name": "snapshot-sequencer",
"version": "0.1.3",
"license": "MIT",
"//ajv": "ajv 8.11.0 is a transitive dep of @snapshot-labs/snapshot.js (also used by ajv-formats and ajv-errors). Pinned at this level to force a single hoisted copy at node_modules/ajv. Without it, bun puts eslint's ajv@^6.x in the root slot and gives snapshot.js / ajv-formats / ajv-errors each their own nested 8.x copy — same version, different module identities, which breaks ajv-errors's vocabulary registration ('SyntaxError: Unexpected token :'). Drop this dep when bun supports nested overrides (oven-sh/bun#6608) or ajv-errors is replaced upstream.",
"scripts": {
"lint": "eslint src/ test/ --ext .ts",
"lint:fix": "yarn lint --fix",
"lint:fix": "bun run lint --fix",
"typecheck": "tsc --noEmit",
"build": "tsc",
"dev": "nodemon src/index.ts",
"start": "node build/src/index.js",
"start:test": "dotenv -e test/.env.test yarn dev",
"test:setup": "dotenv -e test/.env.test yarn ts-node ./test/setupDb.ts",
"test": "yarn test:setup; PORT=3003 start-server-and-test 'yarn start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand'",
"start:test": "dotenv -e test/.env.test bun run dev",
"test:setup": "dotenv -e test/.env.test bunx ts-node ./test/setupDb.ts",
"test": "bun run test:setup; PORT=3003 start-server-and-test 'bun run start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand'",
"test:unit": "dotenv -e test/.env.test jest --runInBand --collectCoverage=false test/unit",
"test:integration": "dotenv -e test/.env.test jest --runInBand --collectCoverage=false test/integration",
"test:e2e": "PORT=3003 start-server-and-test 'yarn start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand --collectCoverage=false test/e2e/'"
"test:e2e": "PORT=3003 start-server-and-test 'bun run start:test' http://localhost:3003 'dotenv -e test/.env.test jest --runInBand --collectCoverage=false test/e2e/'"
},
"eslintConfig": {
"extends": "@snapshot-labs"
Expand All @@ -32,14 +33,15 @@
"@snapshot-labs/pineapple": "^1.2.1",
"@snapshot-labs/snapshot-metrics": "^1.4.1",
"@snapshot-labs/snapshot-sentry": "^1.5.5",
"@snapshot-labs/snapshot.js": "^0.14.20",
"@snapshot-labs/snapshot.js": "^0.14.21",
"ajv": "8.11.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this new dependency ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajv is not used directly by sequencer, and will be cleaned up by a agent in the future.

@tony8713 what is adding this dependency resolving ? is there other way to do it ?

"bluebird": "^3.7.2",
"connection-string": "^1.0.1",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"express": "^4.18.1",
"express-rate-limit": "^6.9.0",
"lodash": "^4.17.21",
"lodash": "4.17.21",
"mysql": "^2.18.1",
"node-fetch": "^2.7.0",
"rate-limit-redis": "^3.1.0",
Expand All @@ -50,19 +52,23 @@
"winston": "^3.8.2",
"zod": "3.23.8"
},
"overrides": {
"@snapshot-labs/eslint-config-base": "0.1.0-beta.18",
"ofetch": "1.3.3"
Comment on lines +55 to +57
},
"devDependencies": {
"@snapshot-labs/eslint-config": "^0.1.0-beta.18",
"@snapshot-labs/prettier-config": "^0.1.0-beta.7",
"@types/jest": "^29.5.2",
"@snapshot-labs/eslint-config": "0.1.0-beta.18",
"@snapshot-labs/prettier-config": "0.1.0-beta.7",
"@types/jest": "29.5.2",
"@types/node": "^16.0.0",
"dotenv-cli": "^7.2.1",
"eslint": "^8.28.0",
"jest": "^29.6.1",
"jest-environment-node-single-context": "^29.1.0",
"jest": "29.6.1",
"jest-environment-node-single-context": "29.1.0",
"nodemon": "^2.0.19",
"prettier": "^3.0.3",
"prettier": "3.0.3",
"start-server-and-test": "^2.0.0",
"supertest": "^6.3.4",
"ts-jest": "^29.1.1"
"ts-jest": "29.1.1"
}
}
2 changes: 1 addition & 1 deletion scripts/hibernate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import networks from '@snapshot-labs/snapshot.js/src/networks.json';

async function main() {
if (process.argv.length < 2) {
console.error(`Usage: yarn ts-node scripts/hibernate.ts run|preview`);
console.error(`Usage: bunx ts-node scripts/hibernate.ts run|preview`);
return process.exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/import-skins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* All imported colors will be in 6-character hex format, and will not support transparency.
* All colors with transparency will be opacified, based on the background color
*
* To run this script: yarn ts-node scripts/import-skins.ts
* To run this script: bunx ts-node scripts/import-skins.ts
*/

import 'dotenv/config';
Expand Down
2 changes: 1 addition & 1 deletion scripts/import-statements.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config';
import run from '../src/lib/importer/statement';

// Usage: yarn ts-node scripts/import-statements.ts --providers tally,agora --spaces s:hop.eth
// Usage: bunx ts-node scripts/import-statements.ts --providers tally,agora --spaces s:hop.eth
async function main() {
let providers: string[] | undefined = undefined;
let spaces: string[] | undefined = undefined;
Expand Down
2 changes: 1 addition & 1 deletion scripts/init_leaderboard_counters.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config';
import db from '../src/helpers/mysql';

// Usage: yarn ts-node scripts/init_leaderboard_counters.ts --pivot TIMESTAMP
// Usage: bunx ts-node scripts/init_leaderboard_counters.ts --pivot TIMESTAMP
async function main() {
let pivot: number | null = null;

Expand Down
2 changes: 1 addition & 1 deletion scripts/refresh-space-leaderboard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config';
import db from '../src/helpers/mysql';

// Usage: yarn ts-node scripts/refresh-space-leaderboard.ts --space SPACE-ID
// Usage: bunx ts-node scripts/refresh-space-leaderboard.ts --space SPACE-ID
// This script assumes there are no active proposals in the space

async function getFirstAndLastVote(space: string) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/refresh_leaderboard_counters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function refreshVotesCount(spaces?: string[], users?: string[]) {
);
}

// Usage: yarn ts-node scripts/refresh_leaderboard_counters.ts --type proposal|vote --space OPTIONAL-SPACE-ID --start TIMESTAMP --end TIMESTAMP
// Usage: bunx ts-node scripts/refresh_leaderboard_counters.ts --type proposal|vote --space OPTIONAL-SPACE-ID --start TIMESTAMP --end TIMESTAMP
async function main() {
let start = 0;
let end = 0;
Expand Down
2 changes: 1 addition & 1 deletion scripts/refresh_spaces_counters.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dotenv/config';
import db from '../src/helpers/mysql';

// Usage: yarn ts-node scripts/refresh_spaces_counters.ts
// Usage: bunx ts-node scripts/refresh_spaces_counters.ts
async function main() {
const spaces = await db.queryAsync(`SELECT COUNT(*) as count FROM spaces`);
console.log(`Found ${spaces[0].count} spaces`);
Expand Down
2 changes: 1 addition & 1 deletion test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const setup = async () => {
await sequencerDB.queryAsync('SELECT 1 + 1');
} catch (e: any) {
if (e.code === 'ER_BAD_DB_ERROR') {
console.error('Test database not setup, please run `yarn test:setup`');
console.error('Test database not setup, please run `bun run test:setup`');
throw new Error('Test database not setup');
}
} finally {
Expand Down
Loading
Loading