mirror of
https://github.com/zkitter/groups.git
synced 2026-01-09 13:08:01 -05:00
refactor: update baseurl for import, create subfolders (#12)
This commit is contained in:
@@ -1 +1,7 @@
|
||||
extends: ['@r1oga']
|
||||
overrides:
|
||||
- files: ['scripts/*.ts']
|
||||
rules:
|
||||
no-console: off
|
||||
'@typescript-eslint/restrict-template-expressions': off
|
||||
'@typescript-eslint/ban-ts-comment': off
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'cross-fetch/polyfill'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { getGhGroup } from '../src'
|
||||
import { getGhGroup } from 'gh/get-gh-group'
|
||||
|
||||
export default async (_: Request, res: Response) => {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'cross-fetch/polyfill'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { getGhOrgs } from '../src/get-gh-orgs'
|
||||
import { getGhOrgs } from 'snapshot/get-gh-orgs'
|
||||
|
||||
export default async (_: Request, res: Response) => {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'cross-fetch/polyfill'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { get100TopDaosWithMin10kFollowers } from '../src/get-spaces'
|
||||
import { get100TopDaosWithMin10kFollowers } from 'snapshot/get-spaces'
|
||||
|
||||
export default async (_: Request, res: Response) => {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getGhGroup } from '../src'
|
||||
import { getGhGroup } from 'gh/get-gh-group'
|
||||
|
||||
const main = async () => {
|
||||
console.log('Fetching gh group (top 100 DAOs with >= 10_000 followers)...')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { hideBin } from 'yargs/helpers'
|
||||
import yargs from 'yargs/yargs'
|
||||
|
||||
import { getSpaces } from '../src/get-spaces'
|
||||
import { getSpaces } from 'snapshot/get-spaces'
|
||||
|
||||
const options = {
|
||||
maxOrgs: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ok } from 'assert'
|
||||
import { URLS } from './constants'
|
||||
import committersQuery from './graphql/committers-query'
|
||||
import committersQuery from 'graphql/committers-query'
|
||||
import { URLS } from '../constants'
|
||||
|
||||
const parseDate = (date: Date) => date.toISOString().split('.')[0] + 'Z'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getGhOrgs } from 'snapshot/get-gh-orgs'
|
||||
import { getCommittersByOrg } from './get-commiters-by-org'
|
||||
import { getGhOrgs } from './get-gh-orgs'
|
||||
|
||||
const minusOneMonth = (date: Date) =>
|
||||
new Date(new Date().setMonth(date.getMonth() - 1))
|
||||
@@ -1 +0,0 @@
|
||||
export * from './get-gh-group'
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CHUNK_SIZE, URLS } from './constants'
|
||||
import spacesGqlQuery from 'graphql/spaces-gql-query'
|
||||
import { CHUNK_SIZE, URLS } from '../constants'
|
||||
import { getSpaces } from './get-spaces'
|
||||
import spacesGqlQuery from './graphql/spaces-gql-query'
|
||||
|
||||
const split = (arr: string[]) => {
|
||||
const chunks = []
|
||||
@@ -1,5 +1,5 @@
|
||||
import { URLS } from './constants'
|
||||
import { Space } from './types'
|
||||
import { URLS } from '../constants'
|
||||
import { Space } from '../types'
|
||||
|
||||
export const filterSpaces =
|
||||
(minFollowers: number) =>
|
||||
@@ -9,6 +9,7 @@ const jestConfig: JestConfigWithTsJest = {
|
||||
'./test/jest.prettier.ts',
|
||||
'./test/jest.unit.ts',
|
||||
],
|
||||
testTimeout: 20_000,
|
||||
watchPlugins: [
|
||||
'jest-watch-select-projects',
|
||||
'jest-watch-typeahead/filename',
|
||||
|
||||
@@ -14,9 +14,8 @@ const jestUnitConfig: JestConfigWithTsJest = {
|
||||
},
|
||||
},
|
||||
displayName: 'unit',
|
||||
moduleDirectories: ['node_modules', __dirname],
|
||||
moduleFileExtensions: ['ts', 'js', 'json'],
|
||||
|
||||
moduleDirectories: ['node_modules', '<rootDir>/src'],
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
preset: 'ts-jest',
|
||||
setupFilesAfterEnv: ['jest-chain', './test/setup.ts'],
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { filterSpaces } from '../../src/get-spaces'
|
||||
import { filterSpaces } from 'snapshot/get-spaces'
|
||||
|
||||
describe('filterSpaces', () => {
|
||||
it('should return true if followers is greater than min', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCommittersByOrg } from '../../src/get-commiters-by-org'
|
||||
import { getCommittersByOrg } from 'gh/get-commiters-by-org'
|
||||
|
||||
describe('getCommitters', () => {
|
||||
it('should return a list of committers', async () => {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { getGhGroup } from '../../src/get-gh-group'
|
||||
|
||||
jest.setTimeout(20_000)
|
||||
import { getGhGroup } from 'gh/get-gh-group'
|
||||
|
||||
describe('getGhGroup', () => {
|
||||
it('should return a list of users', async () => {
|
||||
@@ -12,6 +10,7 @@ describe('getGhGroup', () => {
|
||||
expect(user.includes('[bot]')).toBeFalsy()
|
||||
})
|
||||
// no duplicates
|
||||
// eslint-disable-next-line @typescript-eslint/require-array-sort-compare
|
||||
expect(Array.from(new Set(users)).sort()).toEqual(users.sort())
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getGhOrgs } from '../../src/get-gh-orgs'
|
||||
import { getGhOrgs } from '../../src/snapshot/get-gh-orgs'
|
||||
|
||||
describe('get-gh-orgs', () => {
|
||||
it('should return an array of github orgs', async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
get100TopDaosWithMin10kFollowers,
|
||||
getSpaces,
|
||||
} from '../../src/get-spaces'
|
||||
} from '../../src/snapshot/get-spaces'
|
||||
|
||||
describe('getSpaces', () => {
|
||||
it('should return an array of spaces', async () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"files": ["node_modules/jest-chain/types/index.d.ts"],
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"baseUrl": ".",
|
||||
"baseUrl": "./src",
|
||||
"sourceRoot": "src",
|
||||
"target": "ESNext",
|
||||
"module": "commonjs",
|
||||
|
||||
Reference in New Issue
Block a user