Skip to content

Commit

Permalink
fix: Remove gqm code from dist (#57)
Browse files Browse the repository at this point in the history
* fix: Remove gqm code from dist

* fix linting
  • Loading branch information
nicola-smartive authored Sep 6, 2023
1 parent 9046c0e commit e4d28db
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["./tsconfig.json"]
"project": ["./tsconfig.eslint.json"]
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build": "npm run build:esm && npm run build:cjs && npm run build:bin",
"build:esm": "tsc",
"build:cjs": "esbuild src/index.ts --bundle --platform=node --outdir=dist/cjs --out-extension:.js=.cjs --format=cjs --packages=external",
"build:bin": "esbuild src/bin/gqm.ts --bundle --platform=node --outdir=dist/bin --out-extension:.js=.cjs --format=cjs --packages=external"
"build:bin": "esbuild src/bin/gqm/index.ts --bundle --platform=node --outdir=dist/bin --out-extension:.js=.cjs --format=cjs --packages=external"
},
"bin": {
"gqm": "dist/bin/gqm.cjs"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/bin/gqm.ts → src/bin/gqm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
generateMutations,
getMigrationDate,
printSchemaFromModels,
} from '..';
} from '../..';
import { generateGraphqlApiTypes, generateGraphqlClientTypes } from '../gqm/codegen';
import { KNEXFILE_PATH, parseKnexfile } from '../gqm/parse-knexfile';
import { parseModels } from '../gqm/parse-models';
Expand Down Expand Up @@ -115,7 +115,7 @@ program
.action(async () => {
const git = simpleGit();

let name = process.argv[2] || (await git.branch()).current.split('/').pop();
let name = process.argv[process.argv.indexOf('gqm') + 1] || (await git.branch()).current.split('/').pop();

if (name && ['staging', 'production'].includes(name)) {
name = await readLine('Migration name:');
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/gqm/parse-models.ts → src/bin/gqm/parse-models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IndentationText, Project } from 'ts-morph';
import { RawModels } from '..';
import { RawModels } from '../..';
import { getSetting, writeToFile } from './settings';
import { staticEval } from './static-eval';
import { findDeclarationInFile } from './utils';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/gqm/visitor.ts → src/bin/gqm/visitor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { KindToNodeMappings, Node, SyntaxKind } from 'ts-morph';
import { get } from '..';
import { get } from '../..';

export type Visitor<T, C> = {
undefined?: () => T;
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "dist"],
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"exclude": ["node_modules", "dist"],
"exclude": ["node_modules", "dist", "src/bin"],
"compilerOptions": {
"outDir": "./dist/esm",
"rootDir": "./src",
Expand Down

0 comments on commit e4d28db

Please sign in to comment.