Skip to content

Commit

Permalink
convert to monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandotv committed Jan 23, 2022
1 parent c121ca0 commit 76bcc98
Show file tree
Hide file tree
Showing 14 changed files with 277 additions and 203 deletions.
22 changes: 22 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
coverage:
status:
project:
default:
target: auto
dumba:
target: auto
flags:
- dumba

comment:
layout: 'reach, diff, flags, files'
behavior: default
require_changes: false
require_base: true
require_head: true

flags:
dumba:
paths:
- packages/dumba/
carryforward: true
19 changes: 7 additions & 12 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
module.exports = {
testMatch: [
'<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)',
'<rootDir>/tests/?(*.)+(spec|test).[jt]s?(x)'
],
testEnvironment: 'node',
moduleDirectories: ['node_modules', 'src'],
testEnvironment: 'jsdom',
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
],
collectCoverageFrom: [
'<rootDir>/src/**',
'!<rootDir>/src/globals.d.ts',
'!<rootDir>/src/__tests__/**',
'!<rootDir>/src/__fixtures__/**'
],
globals: {
__DEV__: true,
__VERSION__: true,
__BUILD_DATE__: true,
__COMMIT_SHA__: true
},
coverageThreshold: {
global: {
branches: 80,
Expand Down
83 changes: 16 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,25 @@
{
"name": "graphql-no-alias",
"version": "1.0.1",
"private": false,
"description": "No alias directive for graphql mutation and query types. It can limit the amount of alias fields that can be used for queries and mutations. Preventing batch attacks.",
"keywords": [
"graphql",
"graphql directive",
"graphql validation",
"graphql alias",
"graphql query alias",
"graphql mutation alias"
],
"author": "ivandotv",
"license": "MIT",
"main": "./dist/prod/graphql-no-alias.js",
"exports": {
"import": "./dist/prod/graphql-no-alias.esm.js",
"require": "./dist/prod/graphql-no-alias.js"
},
"types": "./dist/types/index.d.ts",
"files": [
"dist",
"src"
],
"name": "graphql-no-alias-monorepo",
"version": "0.0.0",
"private": true,
"author": "Ivan Vlatkovic",
"scripts": {
"lint": "eslint --fix \"src/**/\"",
"lint:check": "eslint \"src/**/\"",
"lint:ci": "pnpm lint:check && pnpm format:check",
"format": "prettier --write src/**",
"format:check": "prettier --check src/**",
"test": "NODE_ENV=test jest --verbose --coverage --no-cache",
"test:watch": "NODE_ENV=test jest --watch",
"test:ci": "NODE_ENV=test jest --runInBand --ci --coverage --coverageDirectory=coverage",
"build:prod": "NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --target node --output dist/prod",
"build": "rm -rf ./dist && pnpm build:prod",
"prepublishOnly": "pnpm build",
"test": "pnpm multi run test --workspace-concurrency 1",
"test:ci": "pnpm multi run test:ci --workspace-concurrency 1",
"lint": "pnpm multi run lint",
"lint:ci": "pnpm multi run lint:ci",
"build": "pnpm multi run build",
"prepare": "husky install",
"release": "pnpm run prepublishOnly && pnpm changeset publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ivandotv/graphql-no-alias.git"
},
"bugs": {
"url": "https://github.com/ivandotv/graphql-no-alias/issues"
"release": "pnpm multi run prepublishOnly --workspace-concurrency 1 && pnpm changeset publish"
},
"homepage": "https://github.com/ivandotv/graphql-no-alias#readme",
"peerDependencies": {
"graphql": "^16.2.0"
"dependencies": {
"husky": "^7.0.4",
"lint-staged": "^12.2.2",
"prettier": "^2.5.1"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@changesets/cli": "^2.19.0",
"@types/jest": "^27.4.0",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^25.3.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-tsdoc": "^0.2.14",
"graphql": "^16.2.0",
"husky": "^7.0.4",
"jest": "^27.4.5",
"jest-mock-console": "^1.2.3",
"jest-watch-typeahead": "^1.0.0",
"lint-staged": "^12.1.4",
"microbundle": "^0.14.2",
"prettier": "^2.5.1",
"shx": "^0.3.3"
"del": "^6.0.0",
"minimist": "^1.2.5"
}
}
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions packages/no-alias/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const baseConfig = require('../../jest.config')

module.exports = {
...baseConfig,
rootDir: '.',
projects: undefined,
testMatch: ['<rootDir>/src/__tests__/?(*.)+(spec|test).[jt]s?(x)'],
collectCoverageFrom: [
'<rootDir>/src/**',
'!<rootDir>/src/index.ts',
'!<rootDir>/src/__tests__/**',
'!<rootDir>/src/__fixtures__/**'
]
}
76 changes: 76 additions & 0 deletions packages/no-alias/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "graphql-no-alias",
"version": "1.0.1",
"private": false,
"description": "No alias directive for graphql mutation and query types. It can limit the amount of alias fields that can be used for queries and mutations. Preventing batch attacks.",
"keywords": [
"graphql",
"graphql directive",
"graphql validation",
"graphql alias",
"graphql query alias",
"graphql mutation alias"
],
"author": "ivandotv",
"license": "MIT",
"main": "./dist/prod/graphql-no-alias.js",
"exports": {
"import": "./dist/prod/graphql-no-alias.esm.js",
"require": "./dist/prod/graphql-no-alias.js"
},
"types": "./dist/types/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"lint": "eslint --fix \"src/**/\"",
"lint:check": "eslint \"src/**/\"",
"lint:ci": "pnpm lint:check && pnpm format:check",
"format": "prettier --write src/**",
"format:check": "prettier --check src/**",
"test": "NODE_ENV=test jest --verbose --coverage --no-cache",
"test:watch": "NODE_ENV=test jest --watch",
"test:ci": "NODE_ENV=test jest --runInBand --ci --coverage --coverageDirectory=coverage",
"build:prod": "NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --target node --output dist/prod",
"build": "rm -rf ./dist && pnpm build:prod",
"prepublishOnly": "pnpm build",
"prepare": "husky install",
"release": "pnpm run prepublishOnly && pnpm changeset publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ivandotv/graphql-no-alias.git"
},
"bugs": {
"url": "https://github.com/ivandotv/graphql-no-alias/issues"
},
"homepage": "https://github.com/ivandotv/graphql-no-alias#readme",
"peerDependencies": {
"graphql": "^16.2.0"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@changesets/cli": "^2.19.0",
"@types/jest": "^27.4.0",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^25.3.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-tsdoc": "^0.2.14",
"graphql": "^16.2.0",
"husky": "^7.0.4",
"jest": "^27.4.5",
"jest-mock-console": "^1.2.3",
"jest-watch-typeahead": "^1.0.0",
"lint-staged": "^12.1.4",
"microbundle": "^0.14.2",
"prettier": "^2.5.1",
"shx": "^0.3.3"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildSchema, parse, validate } from 'graphql'
import createValidation from '../'
import createValidation from '..'

describe('Object type level validation', () => {
test('Object level directive applies to all fields', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildSchema, GraphQLError, parse, validate } from 'graphql'
import createValidation from '../'
import createValidation from '..'

describe('Permissions via config', () => {
test('Set default value for all queries', () => {
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions tsconfig.json → packages/no-alias/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"incremental": true,
"jsx": "preserve"
},
"include": ["src/**/*"],
"include": ["packages/no-alias/src/**/*"],
"exclude": [
"**/node_modules",
"src/**/__tests__",
"src/**/*.test.ts",
"src/**/*.spec.ts"
"packages/no-alias/src/**/__tests__",
"packages/no-alias/src/**/*.test.ts",
"packages/no-alias/src/**/*.spec.ts"
]
}
Loading

0 comments on commit 76bcc98

Please sign in to comment.