Skip to content

Commit

Permalink
Use new bob version (#2419)
Browse files Browse the repository at this point in the history
* typescript

Signed-off-by: Tuval <tuval.simha@gmail.com>

* bob update + script

Signed-off-by: Tuval <tuval.simha@gmail.com>

* bob bootstrap

Signed-off-by: Tuval <tuval.simha@gmail.com>

* no bin in package.json

Signed-off-by: Tuval <tuval.simha@gmail.com>

* fix CI + docker

Signed-off-by: Tuval <tuval.simha@gmail.com>

* test fix: diff-command

Signed-off-by: Tuval <tuval.simha@gmail.com>

* fix docker

Signed-off-by: Tuval <tuval.simha@gmail.com>

* bob bootstrap again

Signed-off-by: Tuval <tuval.simha@gmail.com>

* some

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* "bob": {
    "check": false
  },

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* pnpm bob bootstrap

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* fix on complate + rule + diff

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* added missing vitest alias

* fix

* fix lint

* fix prettier

* now?

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* all esm

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* all cjs

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* some

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* ?

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* chmod +x

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* ?

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* all esm

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* ?

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* ?

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* all cjs

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* package json

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* all node

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* remove bob check

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

* fix integration tests

* fix

* changeset patch

Signed-off-by: TuvalSimha <tuval.simha@gmail.com>

---------

Signed-off-by: Tuval <tuval.simha@gmail.com>
Signed-off-by: TuvalSimha <tuval.simha@gmail.com>
Co-authored-by: Dotan Simha <dotansimha@gmail.com>
  • Loading branch information
TuvalSimha and dotansimha authored Apr 10, 2023
1 parent 33a1eb9 commit 34f84e8
Show file tree
Hide file tree
Showing 120 changed files with 1,166 additions and 1,058 deletions.
28 changes: 28 additions & 0 deletions .changeset/eleven-knives-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@graphql-inspector/introspect-command': patch
'@graphql-inspector/commands': patch
'@graphql-inspector/coverage-command': patch
'@graphql-inspector/validate-command': patch
'@graphql-inspector/similar-command': patch
'@graphql-inspector/graphql-loader': patch
'@graphql-inspector/loaders': patch
'@graphql-inspector/audit-command': patch
'@graphql-inspector/serve-command': patch
'@graphql-inspector/github-loader': patch
'@graphql-inspector/diff-command': patch
'@graphql-inspector/docs-command': patch
'@graphql-inspector/code-loader': patch
'@graphql-inspector/json-loader': patch
'@graphql-inspector/git-loader': patch
'@graphql-inspector/url-loader': patch
'@graphql-inspector/action': patch
'@graphql-inspector/config': patch
'@graphql-inspector/github': patch
'@graphql-inspector/logger': patch
'@graphql-inspector/core': patch
'@graphql-inspector/cli': patch
'@graphql-inspector/ci': patch
---

Update `bob` version -> change the way we build the packages (Dist folder build now esm and cjs
versions)
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
{
files: ['**'],
rules: {
'logical-assignment-operators': 'off',
'prefer-object-has-own': 'off', // enable in next major
// TODO: enable following rules
'@typescript-eslint/no-explicit-any': 'off',
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@ jobs:

- name: Integration tests
run: |
chmod +x ./packages/cli/dist/index.js
chmod +x ./packages/cli/dist/cjs/index.js
echo 2001
./packages/cli/dist/index.js validate './integration_tests/2001/operations/**/*.graphql' './integration_tests/2001/schema.graphql'
node ./packages/cli/dist/cjs/index.js validate './integration_tests/2001/operations/**/*.graphql' './integration_tests/2001/schema.graphql'
echo 1991
./packages/cli/dist/index.js validate './integration_tests/1991/two-operations.js' './integration_tests/1991/schema.graphql'
node ./packages/cli/dist/cjs/index.js validate './integration_tests/1991/two-operations.js' './integration_tests/1991/schema.graphql'
echo 1985
./packages/cli/dist/index.js introspect ./integration_tests/1985/schema.js || echo 'TODO'
node ./packages/cli/dist/cjs/index.js introspect ./integration_tests/1985/schema.js || echo 'TODO'
echo 2108
./packages/cli/dist/index.js introspect './integration_tests/2108/**/!(excluded)/*.graphql' --write ./2108.graphql
node ./packages/cli/dist/cjs/index.js introspect './integration_tests/2108/**/!(excluded)/*.graphql' --write ./2108.graphql
if grep -ic "bar" ./2108.graphql
then echo "Broken" && exit 1
else echo "Works"
fi
echo 2027
./packages/cli/dist/index.js diff ./integration_tests/2027/schema-before.graphql ./integration_tests/2027/schema-after.graphql --rule considerUsage --onUsage ./integration_tests/2027/unused-hotels.js
node ./packages/cli/dist/cjs/index.js diff ./integration_tests/2027/schema-before.graphql ./integration_tests/2027/schema-after.graphql --rule considerUsage --onUsage ./integration_tests/2027/unused-hotels.js
echo 2088
./packages/cli/dist/index.js diff ./integration_tests/2088/old.graphql ./integration_tests/2088/new.graphql --rule suppressRemovalOfDeprecatedField
node ./packages/cli/dist/cjs/index.js diff ./integration_tests/2088/old.graphql ./integration_tests/2088/new.graphql --rule suppressRemovalOfDeprecatedField
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ RUN npm install -g pnpm
RUN cd ${DISTDIR} \
&& pnpm install \
&& pnpm cache clean \
&& ln -s "${DISTDIR}"/packages/cli/dist/index.js /usr/local/bin/graphql-inspector \
&& ln -s "${DISTDIR}"/packages/cli/dist/cjs/index.js /usr/local/bin/graphql-inspector \
&& chmod +x /usr/local/bin/graphql-inspector
23 changes: 20 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"scripts": {
"action": "ncc build packages/action/src/action.ts --out action --minify --transpile-only",
"build": "tsc && bob build",
"build": "bob build",
"bundle": "webpack",
"lint": "eslint --cache --ignore-path .gitignore .",
"lint:prettier": "prettier --cache --check .",
Expand All @@ -47,6 +47,23 @@
"devDependencies": {
"@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.26.1",
"@graphql-inspector/audit-command": "workspace:*",
"@graphql-inspector/code-loader": "workspace:*",
"@graphql-inspector/commands": "workspace:*",
"@graphql-inspector/config": "workspace:*",
"@graphql-inspector/coverage-command": "workspace:*",
"@graphql-inspector/diff-command": "workspace:*",
"@graphql-inspector/docs-command": "workspace:*",
"@graphql-inspector/git-loader": "workspace:*",
"@graphql-inspector/github-loader": "workspace:*",
"@graphql-inspector/graphql-loader": "workspace:*",
"@graphql-inspector/introspect-command": "workspace:*",
"@graphql-inspector/json-loader": "workspace:*",
"@graphql-inspector/loaders": "workspace:*",
"@graphql-inspector/serve-command": "workspace:*",
"@graphql-inspector/similar-command": "workspace:*",
"@graphql-inspector/url-loader": "workspace:*",
"@graphql-inspector/validate-command": "workspace:*",
"@theguild/eslint-config": "0.8.0",
"@theguild/prettier-config": "1.1.2",
"@types/body-parser": "1.19.2",
Expand All @@ -55,7 +72,7 @@
"@types/node": "18.15.5",
"@types/yargs": "17.0.3",
"@zeit/ncc": "0.22.3",
"bob-the-bundler": "1.7.3",
"bob-the-bundler": "6.0.0",
"eslint": "8.35.0",
"graphql": "16.6.0",
"graphql-config": "4.5.0",
Expand All @@ -67,7 +84,7 @@
"rimraf": "4.3.1",
"smee-client": "1.2.3",
"strip-ansi": "6.0.1",
"typescript": "4.2.4",
"typescript": "5.0.2",
"vitest": "0.29.7"
},
"sideEffects": false,
Expand Down
8 changes: 4 additions & 4 deletions packages/action/__tests__/run.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import { CheckConclusion } from '@graphql-inspector/github';
import { updateCheckRun } from '../src/checks';
import { fileLoader } from '../src/files';
import { getAssociatedPullRequest } from '../src/git';
import { run } from '../src/run';
import { updateCheckRun } from '../src/checks.js';
import { fileLoader } from '../src/files.js';
import { getAssociatedPullRequest } from '../src/git.js';
import { run } from '../src/run.js';

vi.mock('../src/checks');
vi.mock('../src/git');
Expand Down
45 changes: 32 additions & 13 deletions packages/action/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@graphql-inspector/action",
"version": "3.4.8",
"type": "module",
"description": "GraphQL Inspector functionality for GitHub Actions",
"repository": {
"type": "git",
Expand All @@ -13,22 +14,40 @@
"url": "https://github.com/kamilkisiela"
},
"license": "MIT",
"bin": {
"graphql-inspector-github": "./dist/index.js"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": {
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
},
"default": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs"
}
"require": {
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
"types": "./dist/typings/*.d.ts",
"default": "./dist/esm/*.js"
},
"default": {
"types": "./dist/typings/*.d.ts",
"default": "./dist/esm/*.js"
}
},
"./package.json": "./package.json"
},
"typings": "dist/index.d.ts",
"typings": "dist/typings/index.d.ts",
"keywords": [
"graphql",
"graphql-inspector",
Expand All @@ -38,7 +57,7 @@
"github"
],
"scripts": {
"build": "tsc",
"build": "bob build",
"clean": "rm -rf dist/",
"deploy": "now --docker",
"prebuild": "pnpm clean",
Expand All @@ -64,6 +83,6 @@
},
"sideEffects": false,
"typescript": {
"definition": "dist/index.d.ts"
"definition": "dist/typings/index.d.ts"
}
}
2 changes: 1 addition & 1 deletion packages/action/src/action.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import { run } from './run';
import { run } from './run.js';

(global as any).navigator = {
userAgent: 'node.js',
Expand Down
4 changes: 2 additions & 2 deletions packages/action/src/checks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import { CheckConclusion } from '@graphql-inspector/github';
import { OctokitInstance } from './types';
import { batch } from './utils';
import { OctokitInstance } from './types.js';
import { batch } from './utils.js';

type UpdateCheckRunOptions = Required<
Pick<NonNullable<Parameters<OctokitInstance['checks']['update']>[0]>, 'conclusion' | 'output'>
Expand Down
2 changes: 1 addition & 1 deletion packages/action/src/files.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from 'fs';
import { resolve } from 'path';
import * as core from '@actions/core';
import { OctokitInstance } from './types';
import { OctokitInstance } from './types.js';

export function fileLoader({
octokit,
Expand Down
2 changes: 1 addition & 1 deletion packages/action/src/git.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execSync } from 'child_process';
import * as github from '@actions/github';
import { OctokitInstance } from './types';
import { OctokitInstance } from './types.js';

export function getCurrentCommitSha() {
const sha = execSync(`git rev-parse HEAD`).toString().trim();
Expand Down
2 changes: 1 addition & 1 deletion packages/action/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core';
import { run } from './run';
import { run } from './run.js';

run().catch(e => {
core.setFailed(e.message || e);
Expand Down
8 changes: 4 additions & 4 deletions packages/action/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
printSchemaFromEndpoint,
produceSchema,
} from '@graphql-inspector/github';
import { updateCheckRun } from './checks';
import { fileLoader } from './files';
import { getAssociatedPullRequest, getCurrentCommitSha } from './git';
import { castToBoolean, getInputAsArray, resolveRule } from './utils';
import { updateCheckRun } from './checks.js';
import { fileLoader } from './files.js';
import { getAssociatedPullRequest, getCurrentCommitSha } from './git.js';
import { castToBoolean, getInputAsArray, resolveRule } from './utils.js';

const CHECK_NAME = 'GraphQL Inspector';

Expand Down
52 changes: 32 additions & 20 deletions packages/ci/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@graphql-inspector/ci",
"version": "3.4.5",
"type": "module",
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.",
"repository": {
"type": "git",
Expand All @@ -13,22 +14,40 @@
"url": "https://github.com/kamilkisiela"
},
"license": "MIT",
"bin": {
"graphql-inspector": "dist/index.js"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": {
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
},
"default": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs"
}
"require": {
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
"types": "./dist/typings/*.d.ts",
"default": "./dist/esm/*.js"
},
"default": {
"types": "./dist/typings/*.d.ts",
"default": "./dist/esm/*.js"
}
},
"./package.json": "./package.json"
},
"typings": "dist/index.d.ts",
"typings": "dist/typings/index.d.ts",
"keywords": [
"graphql",
"graphql-inspector",
Expand All @@ -37,7 +56,7 @@
"ci"
],
"scripts": {
"build": "tsc",
"build": "bob build",
"clean": "rm -rf dist/",
"prebuild": "pnpm clean",
"prepack": "bob prepack",
Expand All @@ -60,14 +79,7 @@
"access": "public"
},
"sideEffects": false,
"buildOptions": {
"bin": {
"graphql-inspector": {
"input": "src/index.ts"
}
}
},
"typescript": {
"definition": "dist/index.d.ts"
"definition": "dist/typings/index.d.ts"
}
}
Loading

0 comments on commit 34f84e8

Please sign in to comment.