Skip to content

Commit

Permalink
fix: move grapqhl client stories to examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Bansal committed Jul 9, 2024
1 parent 8272e46 commit 78a3b57
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 25 deletions.
4 changes: 4 additions & 0 deletions common/config/rush/browser-approved-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
"name": "@stonecrop/desktop",
"allowedCategories": [ "prototype" ]
},
{
"name": "@stonecrop/graphql-client",
"allowedCategories": [ "prototype" ]
},
{
"name": "@stonecrop/node-editor",
"allowedCategories": [ "prototype" ]
Expand Down
3 changes: 3 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions common/reviews/api/graphql-client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
```ts

import type { Meta } from './types';
import type { MetaParser } from './types';
import type { MetaResponse } from './types';
import type { Meta } from '@/types';
import type { MetaParser } from '@/types';
import type { MetaResponse } from '@/types';
import { queries } from './queries';

export { Meta }

Expand All @@ -19,6 +20,8 @@ export const methods: {
getMeta: (doctype: string, url?: string) => Promise<MetaResponse>;
};

export { queries }

// (No @packageDocumentation comment for this package)

```
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { queries } from '@stonecrop/graphql-client'
import { useStonecrop } from '@stonecrop/stonecrop'
import { queries } from '../src/queries'
import { onMounted, ref } from 'vue'
const data = ref({})
const schema = ref({})
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRouter, createWebHistory } from 'vue-router'

import { Stonecrop } from '@stonecrop/stonecrop'

import { methods } from '../src'
import { methods } from '../../graphql_client/src'
import { makeServer } from './server'
import App from './App.vue'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createGraphQLHandler, mirageGraphQLFieldResolver } from '@miragejs/graphql'
import { createServer, Model } from 'miragejs'

import typeDefs from '../src/gql/schema'
import typeDefs from '../../graphql_client/src/gql/schema'
// import graphQLSchema from '@/gql/schema.gql'

export function makeServer() {
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dev:builder": "vite serve docbuilder/ --config docbuilder/vite.config.ts",
"dev:code_editor": "cd code_editor/ && histoire dev",
"dev:desktop": "vite dev desktop/ --config desktop/vite.config.ts",
"dev:graphql_client": "vite dev graphql_client/ --config graphql_client/vite.config.ts",
"dev:node_editor": "cd node_editor/ && histoire dev"
},
"dependencies": {
Expand All @@ -26,6 +27,7 @@
"@stonecrop/beam": "workspace:*",
"@stonecrop/code-editor": "workspace:*",
"@stonecrop/desktop": "workspace:*",
"@stonecrop/graphql-client": "workspace:*",
"@stonecrop/node-editor": "workspace:*",
"@stonecrop/stonecrop": "workspace:*",
"@stonecrop/themes": "workspace:*",
Expand Down
11 changes: 11 additions & 0 deletions graphql_client/config/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@
"docModel": {
"enabled": true,
"projectFolderUrl": "https://github.com/agritheory/stonecrop/tree/development/graphql_client"
},

"messages": {
"extractorMessageReporting": {
// Disable this validation at your own risk: Processing an incorrect file type
// may lead to other errors. Function bodies may incorrectly get emitted in the
// .d.ts rollup.
"ae-wrong-input-file-type": {
"logLevel": "none"
}
}
}
}
Empty file removed graphql_client/env.d.ts
Empty file.
4 changes: 1 addition & 3 deletions graphql_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"dev": "vite",
"docs": "api-documenter markdown -i temp -o ../docs/graphql_client",
"lint": "eslint . --ext .ts,.vue",
"preview": "vite preview",
"story:build": "vite build stories/ -c stories/vite.config.ts",
"story:dev": "vite dev stories/ -c stories/vite.config.ts"
"preview": "vite preview"
},
"dependencies": {
"@stonecrop/stonecrop": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions graphql_client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Decimal } from 'decimal.js'
import { GraphQLClient } from 'graphql-request'

import { queries } from '@/queries'
import type { Meta, MetaParser, MetaResponse } from './types'
import { queries } from './queries'
import type { Meta, MetaParser, MetaResponse } from '@/types'

/**
* Parse the response from the GraphQL server. Converts the stringified JSON to JSON and converts the stringified numbers to Decimal.
Expand Down Expand Up @@ -61,4 +61,4 @@ export const methods = {
},
}

export { Meta, MetaParser, MetaResponse }
export { Meta, MetaParser, MetaResponse, queries }
12 changes: 1 addition & 11 deletions graphql_client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,5 @@
"types/*": ["./src/types/*"]
}
},
"include": [
"env.d.ts",
"src/**/*",
"src/**/*.ts",
"src/**/*.vue",
"stories/**/*.json",
"stories/**/*.story.vue",
"tests/**/*.spec.ts",
"tests/**/*.ts",
"tests/**/*.vue"
]
"include": ["src/**/*", "src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
}

0 comments on commit 78a3b57

Please sign in to comment.