Skip to content

Commit

Permalink
Merge pull request #39 from ConrabOpto/feature/mst-query-generator-pu…
Browse files Browse the repository at this point in the history
…blish

generator: Fix types and publish info
  • Loading branch information
dsnn authored Feb 8, 2023
2 parents 77e4230 + a887df4 commit 0350627
Show file tree
Hide file tree
Showing 7 changed files with 1,926 additions and 8,876 deletions.
2 changes: 2 additions & 0 deletions packages/mst-query-generator/generator/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class Generate implements GenerateProps {
this.typeHandler = params.typeHandler ? params.typeHandler : defaultTypeHandler;
this.files = [] as GeneratedFile[];
this.config = params.config ?? undefined;
this.knownTypes = [];
this.refs = [];

const excludes = params.excludes ? params.excludes : [];
this.excludes = [...excludes, ...reservedGraphqlNames];
Expand Down
10,746 changes: 1,897 additions & 8,849 deletions packages/mst-query-generator/package-lock.json

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions packages/mst-query-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
{
"name": "mst-query-generator",
"version": "1.0.0-alpha.0",
"version": "1.0.2",
"description": "Code generator for mst-query",
"source": "src/index.ts",
"main": "dist/generate.cjs",
"module": "dist/generate.module.js",
"type": "module",
"main": "dist/src/index.js",
"target": "node",
"bin": {
"mst-query-generator": "./dist/src/index.js"
},
"scripts": {
"watch": "vitest",
"test": "vitest run",
"build": "microbundle --target node --tsconfig tsconfig.build.json --no-compress --external mobx,mobx-state-tree,react,react-dom,graphql"
"build": "tsc -p tsconfig.build.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ConrabOpto/mst-query.git"
},
"author": "Conrab Opto (www.conrabopto.se)",
"license": "MIT",
"files": [
"dist"
],
"dependencies": {
"arg": "^5.0.0",
"camelcase": "^6.2.0",
"pluralize": "^8.0.0",
"cosmiconfig": "^7.0.0",
"graphql": "16.6.0",
"cosmiconfig": "^7.0.0"
"pluralize": "^8.0.0"
},
"devDependencies": {
"@types/graphql": "^14.5.0",
"@types/node": "^17.0.38",
"@types/node": "^18.13.0",
"@types/pluralize": "^0.0.29",
"microbundle": "^0.13.3",
"mobx": "^6.2.0",
"mobx-react": "^7.1.0",
"mobx-state-tree": "^5.0.1",
"nodemon": "^2.0.20",
"prettier": "^2.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.4.4",
"mst-query": "1.0.10",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"vitest": "^0.18.0"
},
"volta": {
Expand Down
2 changes: 2 additions & 0 deletions packages/mst-query-generator/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

import run from '../generator/scaffold';

run();
2 changes: 1 addition & 1 deletion packages/mst-query-generator/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import camelcase from 'camelcase';
import { RootType } from './models';

export const primitiveFieldNames = {
export const primitiveFieldNames: { [key: string]: string } = {
ID: 'identifier',
Int: 'integer',
String: 'string',
Expand Down
4 changes: 4 additions & 0 deletions packages/mst-query-generator/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["./src"]
}
15 changes: 5 additions & 10 deletions packages/mst-query-generator/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"jsx": "react",
"lib": ["ESNext", "dom"],
"module": "commonjs",
"lib": ["es6", "es2015", "dom"],
"declaration": true,
"skipLibCheck": true,
"outDir": "dist",
"strict": true,
"noImplicitAny": true,
"alwaysStrict": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"downlevelIteration": true,
"types": ["node"],
"esModuleInterop": true,
"allowJs": true
"resolveJsonModule": true
},
"include": ["./src", "./tests"]
}

0 comments on commit 0350627

Please sign in to comment.