Files
groups/package-scripts.yaml
r1oga d2b2d59e6c feat: check gh-contributors and dao-voters groups membership (#37)
* feat: check `gh-contributors` and `dao-voters` membership  (#36)

* feat:test: get orgs with repos and voters

* feat:test: split a time range in chunks

* refactor: get gh names by space ids

Rename field in gql query directly

* feat:test: get ids of the snapshot spaces an address voted for

Query by address instead of by space ids

* refactor: rename space keys when fetching them from snapshot rest api

* refactor getSpaces and getGhOrgs

* refactor: return object from getGhNamesBySpaceIds

* refactor: rename splitArray to split. Remove splitTimestamps fn

* remove gh, daos, snapshot & scripts folders

* add test.unit nps script

* feat:test: exclude orgs from an ignore list

* remove getGhOrgs method

* remove GroupService.ts

* refactor: accept ghName to be null

Because of prisma schema definition

* refactor `getOrgsWithRepos`

Make 1 call to get spaces gh names

* fix unit and integration tests

* update prisma schema (ghName optional)

* fix: fetch first 1000 spaces in getGhNamesBySpaceIdsQuery

* fix e2e and integration tests

* refactor:test: get whitelist short return `{ daos, repos }`

* feat:test: add GET `/whitelist/{daos,repos}` endpoints

* feat:test: can check wether a user belongs to voters group

* refactor whitelist service

* add `/whitelist/{daos,repos}` to app router

* format

* feat: add `/belongs-to-*-group` endpoints

* restructure endpoints

* update openapi spec

* Update README

* format

* fix: remove parameters from /whitelist/repos openapi spec
2023-02-28 23:20:53 +01:00

97 lines
3.1 KiB
YAML

scripts:
barrels:
script: barrelsby -c .barrelsby.json
hiddenFromHelp: true
build:
script: nps clean db.gen-schema barrels compile
description: Build project
clean:
script: rm -rf dist
hiddenFromHelp: true
compile:
script: tsc -p tsconfig.compile.json
hiddenFromHelp: true
db:
gen-schema:
script: pnpx prisma generate
hiddenFromHelp: true
fix:
default:
script: nps lint.fix format.fix
hiddenFromHelp: Fix linting and formatting errors
fetch:
spaces:
script: tsnd --cls --transpile-only scripts/get-spaces.ts
description: Fetch query results (-m <min> -s <size>)
ghgroup:
script: tsnd --cls --transpile-only scripts/get-committers-group.ts
description: Fetch GH group members
format:
default:
script: nps 'test.once --selectProjects prettier --coverage false'
description: Check for format errors
fix:
script: prettier --write .
hiddenFromHelp: true
lint:
default:
script: nps 'test.once --selectProjects lint --coverage false'
description: Check for lint errors
fix:
script: eslint . --ext .ts --fix
hiddenFromHelp: true
precommit:
script: tsc && lint-staged
hiddenFromHelp: true
start:
default:
script: nps db.gen-schema barrels build start.prod
description: Start in production mode
dev:
script: dotenv -e .env.dev -- tsnd --cls --exit-child --ignore-watch node_modules --quiet --respawn --rs --transpile-only -r tsconfig-paths/register src
description: Start in dev mode
prod:
script: NODE_ENV=production node -r module-alias/register dist
hiddenFromHelp: true
test:
default:
script: nps 'test.once --watch --coverage=false'
description: Run tests (watch, no coverage)
ci:
script: jest --config test/jest.config.ts --selectProjects unit integration e2e --silent --reporters=jest-silent-reporter
hiddenFromHelp: true
debug:
script: node --inspect-brk ./node_modules/jest/bin/jest --runInBand --watch --config test/jest.unit.ts
description: Start tests in debug mode (open in chrome://inspect)
once:
script: dotenv -e .env.test -- jest --config test/jest.config.ts
description: Run tests (once, coverage)
e2e:
script: dotenv -e .env.test -- jest --config test/jest.config.ts --selectProjects e2e --coverage=false
description: Run e2e tests
integration:
script: dotenv -e .env.test -- jest --config test/jest.config.ts --selectProjects integration --coverage=false
description: Run e2e tests
unit:
script: dotenv -e .env.test -- jest --config test/jest.config.ts --selectProjects unit --coverage=false
description: Run e2e tests
validate:
default:
script: concurrently tsc 'nps test.once'
description: Perform static analysis testing (lint, format...)
ci:
script: concurrently tsc 'jest --config test/jest.config.ts --selectProjects prettier lint --silent --reporters=jest-silent-reporter --coverage false'
hiddenFromHelp: true