@miurajs/miura-data-flow 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miurajs/miura-data-flow",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "dev": "vitest watch"
18
18
  },
19
19
  "dependencies": {
20
- "@miura/miura-debugger": "workspace:*"
20
+ "@miurajs/miura-debugger": "^0.1.0"
21
21
  },
22
22
  "optionalDependencies": {
23
23
  "@aws-sdk/client-s3": "^3.1005.0",
@@ -1,5 +1,4 @@
1
1
  import { DataProvider, ProviderFactory } from './provider';
2
- import { request } from 'graphql-request'; // Example dependency
3
2
 
4
3
  export interface GraphQLProviderOptions {
5
4
  endpoint: string;
@@ -13,22 +12,17 @@ class GraphQLProvider<T> implements DataProvider<T> {
13
12
  this.options = options;
14
13
  }
15
14
 
15
+ private async _request(doc: string, variables?: any): Promise<any> {
16
+ const { request } = await import('graphql-request');
17
+ return request(this.options.endpoint, doc, variables, this.options.headers);
18
+ }
19
+
16
20
  async query(options: { query: string; variables?: any }): Promise<any> {
17
- return request(
18
- this.options.endpoint,
19
- options.query,
20
- options.variables,
21
- this.options.headers
22
- );
21
+ return this._request(options.query, options.variables);
23
22
  }
24
23
 
25
24
  async mutate(options: { mutation: string; variables?: any }): Promise<any> {
26
- return request(
27
- this.options.endpoint,
28
- options.mutation,
29
- options.variables,
30
- this.options.headers
31
- );
25
+ return this._request(options.mutation, options.variables);
32
26
  }
33
27
  }
34
28
 
@@ -7,9 +7,9 @@ import {
7
7
  createCacheMiddleware,
8
8
  createDevToolsMiddleware,
9
9
  StoreState
10
- } from '@miura/miura-data-flow';
11
- import { html } from '@miura/miura-element';
12
- import { MiuraElement } from '@miura/miura-element';
10
+ } from '@miurajs/miura-data-flow';
11
+ import { html } from '@miurajs/miura-element';
12
+ import { MiuraElement } from '@miurajs/miura-element';
13
13
 
14
14
  // Define the store state interface
15
15
  interface DemoStoreState extends StoreState {
@@ -55,7 +55,7 @@ This story demonstrates the comprehensive state management features of miura Dat
55
55
  ## Usage Examples
56
56
 
57
57
  \`\`\`typescript
58
- import { Store, globalState, createLoggerMiddleware } from '@miura/miura-data-flow';
58
+ import { Store, globalState, createLoggerMiddleware } from '@miurajs/miura-data-flow';
59
59
 
60
60
  // Create a store
61
61
  const store = new Store({ count: 0, user: null });
@@ -627,7 +627,7 @@ export const WithInitialData: Story = {
627
627
  `,
628
628
  play: async () => {
629
629
  // Initialize with some data
630
- const { globalState } = await import('@miura/miura-data-flow');
630
+ const { globalState } = await import('@miurajs/miura-data-flow');
631
631
 
632
632
  // Set initial global state
633
633
  globalState.set('theme', 'dark');