@cedarjs/web 5.0.4-next.167 → 5.0.4
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/dist/apollo/fragmentRegistry.d.ts +0 -25
- package/dist/apollo/fragmentRegistry.d.ts.map +1 -1
- package/dist/apollo/fragmentRegistry.js +1 -19
- package/dist/apollo/index.d.ts +70 -50
- package/dist/apollo/index.d.ts.map +1 -1
- package/dist/apollo/index.js +184 -2
- package/dist/apollo/suspense.d.ts +7 -16
- package/dist/apollo/suspense.d.ts.map +1 -1
- package/dist/apollo/suspense.js +26 -9
- package/dist/apollo/typeOverride.d.ts +21 -0
- package/dist/apollo/typeOverride.d.ts.map +1 -0
- package/dist/bundled/apollo-upload-client.js +1 -2899
- package/dist/cjs/apollo/fragmentRegistry.d.ts +43 -0
- package/dist/cjs/apollo/fragmentRegistry.d.ts.map +1 -0
- package/dist/cjs/apollo/fragmentRegistry.js +75 -0
- package/dist/cjs/apollo/index.d.ts +76 -0
- package/dist/cjs/apollo/index.d.ts.map +1 -0
- package/dist/cjs/apollo/index.js +218 -0
- package/dist/cjs/apollo/links.d.ts +27 -0
- package/dist/cjs/apollo/links.d.ts.map +1 -0
- package/dist/cjs/apollo/links.js +122 -0
- package/dist/cjs/apollo/sseLink.d.ts +29 -0
- package/dist/cjs/apollo/sseLink.d.ts.map +1 -0
- package/dist/cjs/apollo/sseLink.js +120 -0
- package/dist/{apollo/apolloLinkTypes.d.ts → cjs/apollo/suspense.d.ts} +22 -22
- package/dist/cjs/apollo/suspense.d.ts.map +1 -0
- package/dist/cjs/apollo/suspense.js +127 -0
- package/dist/cjs/apollo/typeOverride.d.ts +21 -0
- package/dist/cjs/apollo/typeOverride.d.ts.map +1 -0
- package/dist/cjs/apollo/typeOverride.js +16 -0
- package/dist/cjs/apollo/useCache.d.ts +22 -0
- package/dist/cjs/apollo/useCache.d.ts.map +1 -0
- package/dist/cjs/apollo/useCache.js +49 -0
- package/dist/cjs/bins/cedar.d.ts +9 -0
- package/dist/cjs/bins/cedar.d.ts.map +1 -0
- package/dist/cjs/bins/cedar.js +36 -0
- package/dist/cjs/bins/cfw.d.ts +3 -0
- package/dist/cjs/bins/cfw.d.ts.map +1 -0
- package/dist/cjs/bins/cfw.js +36 -0
- package/dist/cjs/bins/cross-env.d.ts +3 -0
- package/dist/cjs/bins/cross-env.d.ts.map +1 -0
- package/dist/cjs/bins/cross-env.js +30 -0
- package/dist/cjs/bins/msw.d.ts +3 -0
- package/dist/cjs/bins/msw.d.ts.map +1 -0
- package/dist/cjs/bins/msw.js +28 -0
- package/dist/cjs/bins/redwood.d.ts +9 -0
- package/dist/cjs/bins/redwood.d.ts.map +1 -0
- package/dist/cjs/bins/redwood.js +36 -0
- package/dist/cjs/bins/storybook.d.ts +3 -0
- package/dist/cjs/bins/storybook.d.ts.map +1 -0
- package/dist/cjs/bins/storybook.js +49 -0
- package/dist/cjs/bins/tsc.d.ts +3 -0
- package/dist/cjs/bins/tsc.d.ts.map +1 -0
- package/dist/cjs/bins/tsc.js +30 -0
- package/dist/cjs/bundled/apollo-upload-client.d.ts +3 -0
- package/dist/cjs/bundled/apollo-upload-client.d.ts.map +1 -0
- package/dist/cjs/bundled/apollo-upload-client.js +2925 -0
- package/dist/cjs/components/DevFatalErrorPage.d.ts +21 -0
- package/dist/cjs/components/DevFatalErrorPage.d.ts.map +1 -0
- package/dist/cjs/components/DevFatalErrorPage.js +552 -0
- package/dist/cjs/components/FatalErrorBoundary.d.ts +24 -0
- package/dist/cjs/components/FatalErrorBoundary.d.ts.map +1 -0
- package/dist/cjs/components/FatalErrorBoundary.js +63 -0
- package/dist/cjs/components/FetchConfigProvider.d.ts +25 -0
- package/dist/cjs/components/FetchConfigProvider.d.ts.map +1 -0
- package/dist/cjs/components/FetchConfigProvider.js +80 -0
- package/dist/cjs/components/GraphQLHooksProvider.d.ts +45 -0
- package/dist/cjs/components/GraphQLHooksProvider.d.ts.map +1 -0
- package/dist/cjs/components/GraphQLHooksProvider.js +135 -0
- package/dist/cjs/components/MetaTags.d.ts +52 -0
- package/dist/cjs/components/MetaTags.d.ts.map +1 -0
- package/dist/cjs/components/MetaTags.js +68 -0
- package/dist/cjs/components/Metadata.d.ts +9 -0
- package/dist/cjs/components/Metadata.d.ts.map +1 -0
- package/dist/cjs/components/Metadata.js +94 -0
- package/dist/cjs/components/PortalHead.d.ts +4 -0
- package/dist/cjs/components/PortalHead.d.ts.map +1 -0
- package/dist/cjs/components/PortalHead.js +59 -0
- package/dist/cjs/components/RedwoodProvider.d.ts +9 -0
- package/dist/cjs/components/RedwoodProvider.d.ts.map +1 -0
- package/dist/cjs/components/RedwoodProvider.js +57 -0
- package/dist/cjs/components/ServerInject.d.ts +26 -0
- package/dist/cjs/components/ServerInject.d.ts.map +1 -0
- package/dist/cjs/components/ServerInject.js +75 -0
- package/dist/cjs/components/cell/CellCacheContext.d.ts +20 -0
- package/dist/cjs/components/cell/CellCacheContext.d.ts.map +1 -0
- package/dist/cjs/components/cell/CellCacheContext.js +53 -0
- package/dist/cjs/components/cell/CellErrorBoundary.d.ts +25 -0
- package/dist/cjs/components/cell/CellErrorBoundary.d.ts.map +1 -0
- package/dist/cjs/components/cell/CellErrorBoundary.js +66 -0
- package/dist/cjs/components/cell/cellTypes.d.ts +152 -0
- package/dist/cjs/components/cell/cellTypes.d.ts.map +1 -0
- package/dist/cjs/components/cell/cellTypes.js +16 -0
- package/dist/cjs/components/cell/createCell.d.ts +10 -0
- package/dist/cjs/components/cell/createCell.d.ts.map +1 -0
- package/dist/cjs/components/cell/createCell.js +165 -0
- package/dist/cjs/components/cell/createCell.test.js +351 -0
- package/dist/cjs/components/cell/createServerCell.d.ts +15 -0
- package/dist/cjs/components/cell/createServerCell.d.ts.map +1 -0
- package/dist/cjs/components/cell/createServerCell.js +91 -0
- package/dist/cjs/components/cell/createSuspendingCell.d.ts +11 -0
- package/dist/cjs/components/cell/createSuspendingCell.d.ts.map +1 -0
- package/dist/cjs/components/cell/createSuspendingCell.js +152 -0
- package/dist/cjs/components/cell/createSuspendingCell.test.js +115 -0
- package/dist/cjs/components/cell/isCellEmpty.d.ts +41 -0
- package/dist/cjs/components/cell/isCellEmpty.d.ts.map +1 -0
- package/dist/cjs/components/cell/isCellEmpty.js +35 -0
- package/dist/cjs/components/htmlTags.d.ts +52 -0
- package/dist/cjs/components/htmlTags.d.ts.map +1 -0
- package/dist/cjs/components/htmlTags.js +88 -0
- package/dist/cjs/config.d.ts +2 -0
- package/dist/cjs/config.d.ts.map +1 -0
- package/dist/cjs/config.js +6 -0
- package/dist/cjs/global.web-auto-imports.d.ts +30 -0
- package/dist/cjs/global.web-auto-imports.d.ts.map +1 -0
- package/dist/cjs/global.web-auto-imports.js +16 -0
- package/dist/cjs/graphql.d.ts +23 -0
- package/dist/cjs/graphql.d.ts.map +1 -0
- package/dist/cjs/graphql.js +36 -0
- package/dist/cjs/index.d.ts +19 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +69 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/routeHooks.types.d.ts +12 -0
- package/dist/cjs/routeHooks.types.d.ts.map +1 -0
- package/dist/cjs/routeHooks.types.js +16 -0
- package/dist/cjs/server/MiddlewareRequest.d.ts +28 -0
- package/dist/cjs/server/MiddlewareRequest.d.ts.map +1 -0
- package/dist/cjs/server/MiddlewareRequest.js +71 -0
- package/dist/cjs/server/MiddlewareResponse.d.ts +44 -0
- package/dist/cjs/server/MiddlewareResponse.d.ts.map +1 -0
- package/dist/cjs/server/MiddlewareResponse.js +130 -0
- package/dist/cjs/server/middleware.d.ts +17 -0
- package/dist/cjs/server/middleware.d.ts.map +1 -0
- package/dist/cjs/server/middleware.js +24 -0
- package/dist/cjs/server/request.d.ts +2 -0
- package/dist/cjs/server/request.d.ts.map +1 -0
- package/dist/cjs/server/request.js +34 -0
- package/dist/cjs/streamUtils/useDocumentReady.d.ts +11 -0
- package/dist/cjs/streamUtils/useDocumentReady.d.ts.map +1 -0
- package/dist/cjs/streamUtils/useDocumentReady.js +41 -0
- package/dist/cjs/toast/index.d.ts +3 -0
- package/dist/cjs/toast/index.d.ts.map +1 -0
- package/dist/cjs/toast/index.js +41 -0
- package/dist/components/FetchConfigProvider.d.ts +2 -3
- package/dist/components/FetchConfigProvider.d.ts.map +1 -1
- package/dist/components/GraphQLHooksProvider.d.ts +45 -0
- package/dist/components/GraphQLHooksProvider.d.ts.map +1 -0
- package/dist/components/GraphQLHooksProvider.js +94 -0
- package/dist/components/cell/CellErrorBoundary.d.ts +2 -3
- package/dist/components/cell/CellErrorBoundary.d.ts.map +1 -1
- package/dist/components/cell/cellTypes.d.ts +4 -17
- package/dist/components/cell/cellTypes.d.ts.map +1 -1
- package/dist/components/cell/createCell.d.ts +7 -1
- package/dist/components/cell/createCell.d.ts.map +1 -1
- package/dist/components/cell/createCell.js +3 -22
- package/dist/components/cell/createCell.test.js +328 -0
- package/dist/components/cell/createSuspendingCell.d.ts.map +1 -1
- package/dist/components/cell/createSuspendingCell.js +3 -12
- package/dist/components/cell/createSuspendingCell.test.js +92 -0
- package/dist/global.web-auto-imports.d.ts +16 -0
- package/dist/global.web-auto-imports.d.ts.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/package.json +1 -0
- package/package.json +106 -48
- package/dist/apollo/ApolloProviderWithFetchConfig.d.ts +0 -15
- package/dist/apollo/ApolloProviderWithFetchConfig.d.ts.map +0 -1
- package/dist/apollo/ApolloProviderWithFetchConfig.js +0 -134
- package/dist/apollo/CedarApolloProvider.d.ts +0 -14
- package/dist/apollo/CedarApolloProvider.d.ts.map +0 -1
- package/dist/apollo/CedarApolloProvider.js +0 -35
- package/dist/apollo/ErrorBoundary.d.ts +0 -13
- package/dist/apollo/ErrorBoundary.d.ts.map +0 -1
- package/dist/apollo/ErrorBoundary.js +0 -13
- package/dist/apollo/apolloLinkTypes.d.ts.map +0 -1
- package/dist/bins/cedar.js +0 -14
- package/dist/bins/cfw.js +0 -14
- package/dist/bins/cross-env.js +0 -8
- package/dist/bins/msw.js +0 -6
- package/dist/bins/redwood.js +0 -14
- package/dist/bins/storybook.js +0 -27
- package/dist/bins/tsc.js +0 -8
- package/dist/components/cell/createFragmentCell.d.ts +0 -19
- package/dist/components/cell/createFragmentCell.d.ts.map +0 -1
- package/dist/components/cell/createFragmentCell.js +0 -73
- /package/dist/apollo/{apolloLinkTypes.js → typeOverride.js} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var sseLink_exports = {};
|
|
20
|
+
__export(sseLink_exports, {
|
|
21
|
+
SSELink: () => SSELink,
|
|
22
|
+
isLiveQuery: () => isLiveQuery,
|
|
23
|
+
isSubscription: () => isSubscription
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(sseLink_exports);
|
|
26
|
+
var import_core = require("@apollo/client/link/core/core.cjs");
|
|
27
|
+
var import_utilities = require("@apollo/client/utilities/utilities.cjs");
|
|
28
|
+
var import_graphql = require("graphql");
|
|
29
|
+
var import_graphql_sse = require("graphql-sse");
|
|
30
|
+
const mapCredentialsHeader = (httpLinkCredentials) => {
|
|
31
|
+
if (!httpLinkCredentials) {
|
|
32
|
+
return void 0;
|
|
33
|
+
}
|
|
34
|
+
switch (httpLinkCredentials) {
|
|
35
|
+
case "omit":
|
|
36
|
+
case "same-origin":
|
|
37
|
+
case "include":
|
|
38
|
+
return httpLinkCredentials;
|
|
39
|
+
default:
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const mapReferrerPolicyHeader = (referrerPolicy) => {
|
|
44
|
+
if (!referrerPolicy) {
|
|
45
|
+
return void 0;
|
|
46
|
+
}
|
|
47
|
+
switch (referrerPolicy) {
|
|
48
|
+
case "no-referrer":
|
|
49
|
+
case "no-referrer-when-downgrade":
|
|
50
|
+
case "same-origin":
|
|
51
|
+
case "origin":
|
|
52
|
+
case "strict-origin":
|
|
53
|
+
case "origin-when-cross-origin":
|
|
54
|
+
case "strict-origin-when-cross-origin":
|
|
55
|
+
case "unsafe-url":
|
|
56
|
+
return referrerPolicy;
|
|
57
|
+
default:
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const hasTrustedDocument = (operation) => {
|
|
62
|
+
return operation.extensions?.persistedQuery?.sha256Hash;
|
|
63
|
+
};
|
|
64
|
+
const isSubscription = (definition) => {
|
|
65
|
+
return definition.kind === import_graphql.Kind.OPERATION_DEFINITION && definition.operation === import_graphql.OperationTypeNode.SUBSCRIPTION;
|
|
66
|
+
};
|
|
67
|
+
const isLiveQuery = (definition) => {
|
|
68
|
+
if (definition.kind !== import_graphql.Kind.OPERATION_DEFINITION || definition.operation !== import_graphql.OperationTypeNode.QUERY) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return !!definition.directives?.find((d) => d.name.value === "live");
|
|
72
|
+
};
|
|
73
|
+
class SSELink extends import_core.ApolloLink {
|
|
74
|
+
client;
|
|
75
|
+
constructor(options) {
|
|
76
|
+
super();
|
|
77
|
+
const { url, auth, headers, httpLinkConfig } = options;
|
|
78
|
+
const { credentials, referrer, referrerPolicy, ...customHeaders } = httpLinkConfig?.headers || {};
|
|
79
|
+
this.client = (0, import_graphql_sse.createClient)({
|
|
80
|
+
url,
|
|
81
|
+
headers: async () => {
|
|
82
|
+
const token = await auth.tokenFn();
|
|
83
|
+
return {
|
|
84
|
+
...token && { Authorization: `Bearer ${token}` },
|
|
85
|
+
...token && { "auth-provider": auth.authProviderType },
|
|
86
|
+
...headers,
|
|
87
|
+
...customHeaders
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
credentials: mapCredentialsHeader(credentials),
|
|
91
|
+
referrer,
|
|
92
|
+
referrerPolicy: mapReferrerPolicyHeader(referrerPolicy)
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
request(operation) {
|
|
96
|
+
return new import_utilities.Observable((sink) => {
|
|
97
|
+
let request;
|
|
98
|
+
if (hasTrustedDocument(operation)) {
|
|
99
|
+
delete operation.query;
|
|
100
|
+
request = { ...operation };
|
|
101
|
+
} else {
|
|
102
|
+
request = {
|
|
103
|
+
...operation,
|
|
104
|
+
query: (0, import_graphql.print)(operation.query)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return this.client.subscribe(request, {
|
|
108
|
+
next: sink.next.bind(sink),
|
|
109
|
+
complete: sink.complete.bind(sink),
|
|
110
|
+
error: sink.error.bind(sink)
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
SSELink,
|
|
118
|
+
isLiveQuery,
|
|
119
|
+
isSubscription
|
|
120
|
+
});
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ApolloClientOptions, ApolloLink, HttpOptions, InMemoryCacheConfig, setLogVerbosity } from '@apollo/client';
|
|
3
|
+
import { InMemoryCache } from '@apollo/client-react-streaming';
|
|
4
|
+
import type { UseAuth } from '@cedarjs/auth';
|
|
5
|
+
import './typeOverride.js';
|
|
6
|
+
import type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks } from './links.js';
|
|
2
7
|
export type ApolloClientCacheConfig = InMemoryCacheConfig;
|
|
3
|
-
export type
|
|
4
|
-
export type CedarApolloLink<Name extends CedarApolloLinkName, Link extends ApolloLink = ApolloLink> = {
|
|
5
|
-
name: Name;
|
|
6
|
-
link: Link;
|
|
7
|
-
};
|
|
8
|
-
export type CedarApolloLinks = [
|
|
9
|
-
CedarApolloLink<'withToken'>,
|
|
10
|
-
CedarApolloLink<'authMiddleware'>,
|
|
11
|
-
CedarApolloLink<'updateDataApolloLink'>,
|
|
12
|
-
CedarApolloLink<'httpLink', ApolloLink | HttpLink>
|
|
13
|
-
];
|
|
14
|
-
export type CedarApolloLinkFactory = (links: CedarApolloLinks) => ApolloLink;
|
|
8
|
+
export type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks, };
|
|
15
9
|
export type GraphQLClientConfigProp = Omit<ApolloClientOptions<unknown>, 'cache' | 'link'> & {
|
|
16
|
-
cache?:
|
|
10
|
+
cache?: InMemoryCache;
|
|
17
11
|
/**
|
|
18
12
|
* Configuration for Apollo Client's `InMemoryCache`.
|
|
19
13
|
* See https://www.apollographql.com/docs/react/caching/cache-configuration/.
|
|
@@ -26,28 +20,28 @@ export type GraphQLClientConfigProp = Omit<ApolloClientOptions<unknown>, 'cache'
|
|
|
26
20
|
* For example, you can use this prop to set the credentials policy so that cookies can be sent to other domains:
|
|
27
21
|
*
|
|
28
22
|
* ```js
|
|
29
|
-
* <
|
|
23
|
+
* <RedwoodApolloProvider graphQLClientConfig={{
|
|
30
24
|
* httpLinkConfig: { credentials: 'include' }
|
|
31
25
|
* }}>
|
|
32
26
|
* ```
|
|
33
27
|
*/
|
|
34
28
|
httpLinkConfig?: HttpOptions;
|
|
35
29
|
/**
|
|
36
|
-
* Extend or overwrite `
|
|
30
|
+
* Extend or overwrite `RedwoodApolloProvider`'s Apollo Link.
|
|
37
31
|
*
|
|
38
|
-
* To overwrite
|
|
32
|
+
* To overwrite Redwood's Apollo Link, just provide your own `ApolloLink`.
|
|
39
33
|
*
|
|
40
|
-
* To extend
|
|
34
|
+
* To extend Redwood's Apollo Link, provide a function—it'll get passed an array of Redwood's Apollo Links
|
|
41
35
|
* which are objects with a name and link property:
|
|
42
36
|
*
|
|
43
37
|
* ```js
|
|
44
|
-
* const link = (
|
|
38
|
+
* const link = (redwoodApolloLinks) => {
|
|
45
39
|
* const consoleLink = new ApolloLink((operation, forward) => {
|
|
46
40
|
* console.log(operation.operationName)
|
|
47
41
|
* return forward(operation)
|
|
48
42
|
* })
|
|
49
43
|
*
|
|
50
|
-
* return ApolloLink.from([consoleLink, ...
|
|
44
|
+
* return ApolloLink.from([consoleLink, ...redwoodApolloLinks.map(({ link }) => link)])
|
|
51
45
|
* }
|
|
52
46
|
* ```
|
|
53
47
|
*
|
|
@@ -55,6 +49,12 @@ export type GraphQLClientConfigProp = Omit<ApolloClientOptions<unknown>, 'cache'
|
|
|
55
49
|
* - your function should return a single link (e.g., using `ApolloLink.from`; see https://www.apollographql.com/docs/react/api/link/introduction/#additive-composition)
|
|
56
50
|
* - the `HttpLink` should come last (https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link)
|
|
57
51
|
*/
|
|
58
|
-
link?: ApolloLink |
|
|
52
|
+
link?: ApolloLink | RedwoodApolloLinkFactory;
|
|
59
53
|
};
|
|
60
|
-
|
|
54
|
+
export declare const RedwoodApolloProvider: React.FunctionComponent<{
|
|
55
|
+
graphQLClientConfig?: GraphQLClientConfigProp;
|
|
56
|
+
useAuth?: UseAuth;
|
|
57
|
+
logLevel?: ReturnType<typeof setLogVerbosity>;
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
}>;
|
|
60
|
+
//# sourceMappingURL=suspense.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../../src/apollo/suspense.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAA;AAUvB,OAAO,EAEL,aAAa,EAEd,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,mBAAmB,CAAA;AAS1B,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,YAAY,CAAA;AASnB,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAEzD,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GACnB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,CAAC,OAAO,CAAC,EAC5B,OAAO,GAAG,MAAM,CACjB,GAAG;IACF,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,wBAAwB,CAAA;CAC7C,CAAA;AAkFD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC1D,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAoCA,CAAA"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var suspense_exports = {};
|
|
31
|
+
__export(suspense_exports, {
|
|
32
|
+
RedwoodApolloProvider: () => RedwoodApolloProvider
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(suspense_exports);
|
|
35
|
+
var import_react = __toESM(require("react"), 1);
|
|
36
|
+
var import_core = require("@apollo/client/core/index.js");
|
|
37
|
+
var import_hooks = require("@apollo/client/react/hooks/index.js");
|
|
38
|
+
var import_client_react_streaming = require("@apollo/client-react-streaming");
|
|
39
|
+
var import_manual_transport = require("@apollo/client-react-streaming/manual-transport");
|
|
40
|
+
var import_auth = require("@cedarjs/auth");
|
|
41
|
+
var import_ServerAuthProvider = require("@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js");
|
|
42
|
+
var import_typeOverride = require("./typeOverride.js");
|
|
43
|
+
var import_FetchConfigProvider = require("../components/FetchConfigProvider.js");
|
|
44
|
+
var import_GraphQLHooksProvider = require("../components/GraphQLHooksProvider.js");
|
|
45
|
+
var import_ServerInject = require("../components/ServerInject.js");
|
|
46
|
+
var import_links = require("./links.js");
|
|
47
|
+
const WrappedApolloProvider = (0, import_client_react_streaming.WrapApolloProvider)(
|
|
48
|
+
(0, import_manual_transport.buildManualDataTransport)({
|
|
49
|
+
useInsertHtml() {
|
|
50
|
+
return import_react.default.useContext(import_ServerInject.ServerHtmlContext);
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
const ApolloProviderWithFetchConfig = ({ config, children, logLevel, useAuth = import_auth.useNoAuth }) => {
|
|
55
|
+
(0, import_core.setLogVerbosity)(logLevel);
|
|
56
|
+
const { uri, headers } = (0, import_FetchConfigProvider.useFetchConfig)();
|
|
57
|
+
const { getToken, type: authProviderType } = useAuth();
|
|
58
|
+
const isDev = process.env.NODE_ENV === "development";
|
|
59
|
+
const serverAuthState = (0, import_react.useContext)(import_ServerAuthProvider.ServerAuthContext);
|
|
60
|
+
const getGraphqlUrl = () => {
|
|
61
|
+
return typeof window === "undefined" ? RWJS_ENV.RWJS_EXP_SSR_GRAPHQL_ENDPOINT : uri;
|
|
62
|
+
};
|
|
63
|
+
const { httpLinkConfig, link: userPassedLink, ...otherConfig } = config ?? {};
|
|
64
|
+
const redwoodApolloLinks = [
|
|
65
|
+
// @MARK REMOVE: We will not need these for cookie based auth ~~~~
|
|
66
|
+
{ name: "withToken", link: (0, import_links.createTokenLink)(getToken) },
|
|
67
|
+
{
|
|
68
|
+
name: "authMiddleware",
|
|
69
|
+
link: (0, import_links.createAuthApolloLink)(authProviderType, headers)
|
|
70
|
+
},
|
|
71
|
+
// ~~~~ @END REMOVE ~~~~
|
|
72
|
+
isDev && { name: "enhanceErrorLink", link: (0, import_links.createUpdateDataLink)() },
|
|
73
|
+
{
|
|
74
|
+
name: "httpLink",
|
|
75
|
+
link: (0, import_links.createHttpLink)(
|
|
76
|
+
getGraphqlUrl(),
|
|
77
|
+
httpLinkConfig,
|
|
78
|
+
serverAuthState?.cookieHeader
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
].filter((link) => !!link);
|
|
82
|
+
function makeClient() {
|
|
83
|
+
return new import_client_react_streaming.ApolloClient({
|
|
84
|
+
link: (0, import_links.createFinalLink)({
|
|
85
|
+
userConfiguredLink: userPassedLink,
|
|
86
|
+
defaultLinks: redwoodApolloLinks
|
|
87
|
+
}),
|
|
88
|
+
...otherConfig
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return /* @__PURE__ */ import_react.default.createElement(WrappedApolloProvider, { makeClient }, children);
|
|
92
|
+
};
|
|
93
|
+
const RedwoodApolloProvider = ({
|
|
94
|
+
graphQLClientConfig,
|
|
95
|
+
useAuth = import_auth.useNoAuth,
|
|
96
|
+
logLevel = "debug",
|
|
97
|
+
children
|
|
98
|
+
}) => {
|
|
99
|
+
const { cacheConfig, ...config } = graphQLClientConfig ?? {};
|
|
100
|
+
const cache = new import_client_react_streaming.InMemoryCache(cacheConfig).restore(
|
|
101
|
+
globalThis?.__REDWOOD__APOLLO_STATE ?? {}
|
|
102
|
+
);
|
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement(import_FetchConfigProvider.FetchConfigProvider, { useAuth }, /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
ApolloProviderWithFetchConfig,
|
|
105
|
+
{
|
|
106
|
+
config: { cache, ...config },
|
|
107
|
+
useAuth,
|
|
108
|
+
logLevel
|
|
109
|
+
},
|
|
110
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
import_GraphQLHooksProvider.GraphQLHooksProvider,
|
|
112
|
+
{
|
|
113
|
+
useQuery: import_hooks.useQuery,
|
|
114
|
+
useMutation: import_hooks.useMutation,
|
|
115
|
+
useSubscription: import_hooks.useSubscription,
|
|
116
|
+
useSuspenseQuery: import_hooks.useSuspenseQuery,
|
|
117
|
+
useBackgroundQuery: import_hooks.useBackgroundQuery,
|
|
118
|
+
useReadQuery: import_hooks.useReadQuery
|
|
119
|
+
},
|
|
120
|
+
children
|
|
121
|
+
)
|
|
122
|
+
));
|
|
123
|
+
};
|
|
124
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
+
0 && (module.exports = {
|
|
126
|
+
RedwoodApolloProvider
|
|
127
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QueryHookOptions, QueryResult, MutationHookOptions, MutationTuple, OperationVariables, SubscriptionHookOptions, SubscriptionResult, UseSuspenseQueryResult, SuspenseQueryHookOptions } from '@apollo/client';
|
|
2
|
+
declare global {
|
|
3
|
+
interface QueryOperationResult<TData = any, TVariables extends OperationVariables = OperationVariables> extends QueryResult<TData, TVariables> {
|
|
4
|
+
}
|
|
5
|
+
interface MutationOperationResult<TData, TVariables> extends MutationTuple<TData, TVariables> {
|
|
6
|
+
}
|
|
7
|
+
interface SubscriptionOperationResult<TData = any, TVariables extends OperationVariables = OperationVariables> extends SubscriptionResult<TData, TVariables> {
|
|
8
|
+
}
|
|
9
|
+
interface GraphQLQueryHookOptions<TData, TVariables extends OperationVariables> extends QueryHookOptions<TData, TVariables> {
|
|
10
|
+
}
|
|
11
|
+
interface GraphQLMutationHookOptions<TData, TVariables> extends MutationHookOptions<TData, TVariables> {
|
|
12
|
+
}
|
|
13
|
+
interface GraphQLSubscriptionHookOptions<TData, TVariables extends OperationVariables> extends SubscriptionHookOptions<TData, TVariables> {
|
|
14
|
+
}
|
|
15
|
+
interface SuspenseQueryOperationResult<TData = any, TVariables extends OperationVariables = OperationVariables> extends UseSuspenseQueryResult<TData, TVariables> {
|
|
16
|
+
}
|
|
17
|
+
interface GraphQLSuspenseQueryHookOptions<TData, TVariables extends OperationVariables> extends SuspenseQueryHookOptions<TData, TVariables> {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=typeOverride.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeOverride.d.ts","sourceRoot":"","sources":["../../../src/apollo/typeOverride.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,oBAAoB,CAC5B,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,CAC1D,SAAQ,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;IAG3C,UAAU,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAE,SAAQ,aAAa,CACxE,KAAK,EACL,UAAU,CACX;KAAG;IAGJ,UAAU,2BAA2B,CACnC,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,CAC1D,SAAQ,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;IAGlD,UAAU,uBAAuB,CAC/B,KAAK,EACL,UAAU,SAAS,kBAAkB,CACrC,SAAQ,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;IAGhD,UAAU,0BAA0B,CAClC,KAAK,EACL,UAAU,CACV,SAAQ,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;IAGnD,UAAU,8BAA8B,CACtC,KAAK,EACL,UAAU,SAAS,kBAAkB,CACrC,SAAQ,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;IAGvD,UAAU,4BAA4B,CACpC,KAAK,GAAG,GAAG,EACX,UAAU,SAAS,kBAAkB,GAAG,kBAAkB,CAC1D,SAAQ,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;IAGtD,UAAU,+BAA+B,CACvC,KAAK,EACL,UAAU,SAAS,kBAAkB,CACrC,SAAQ,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC;KAAG;CACzD;AAED,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var typeOverride_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(typeOverride_exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ApolloCache, Reference, StoreObject } from '@apollo/client';
|
|
2
|
+
import type { NormalizedCacheObject } from '@apollo/client/cache/inmemory/types.js';
|
|
3
|
+
import type { ApolloQueryResult } from '@apollo/client/core';
|
|
4
|
+
type useCacheType = {
|
|
5
|
+
cache: ApolloCache<object>;
|
|
6
|
+
evict: (object: StoreObject | Reference) => boolean;
|
|
7
|
+
extract: (optimistic?: boolean) => NormalizedCacheObject;
|
|
8
|
+
identify: (object: StoreObject | Reference) => {
|
|
9
|
+
id: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
modify: (object: StoreObject | Reference, fields: Record<string, any>) => boolean;
|
|
12
|
+
resetStore: () => Promise<ApolloQueryResult<any>[] | null>;
|
|
13
|
+
clearStore: () => Promise<ApolloQueryResult<any>[] | null>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Apollo Client stores the results of your GraphQL queries in a local, normalized, in-memory cache.
|
|
17
|
+
*
|
|
18
|
+
* useCache is a custom hook that returns the cache object and some useful methods to interact with the cache.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useCache: () => useCacheType;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=useCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCache.d.ts","sourceRoot":"","sources":["../../../src/apollo/useCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAG5D,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,KAAK,OAAO,CAAA;IACnD,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,OAAO,KAAK,qBAAqB,CAAA;IACxD,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,KAAK;QAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;IACzE,MAAM,EAAE,CACN,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACxB,OAAO,CAAA;IACZ,UAAU,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IAC1D,UAAU,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;CAC3D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,QAAO,YAmE3B,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useCache_exports = {};
|
|
20
|
+
__export(useCache_exports, {
|
|
21
|
+
useCache: () => useCache
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useCache_exports);
|
|
24
|
+
var import_hooks = require("@apollo/client/react/hooks/hooks.cjs");
|
|
25
|
+
const useCache = () => {
|
|
26
|
+
const client = (0, import_hooks.useApolloClient)();
|
|
27
|
+
const cache = client.cache;
|
|
28
|
+
const extract = (optimistic = false) => cache.extract(optimistic);
|
|
29
|
+
const identify = (object) => {
|
|
30
|
+
return { id: cache.identify(object) };
|
|
31
|
+
};
|
|
32
|
+
const modify = (object, fields) => {
|
|
33
|
+
return cache.modify({ ...identify(object), fields });
|
|
34
|
+
};
|
|
35
|
+
const evict = (object) => {
|
|
36
|
+
return cache.evict(identify(object));
|
|
37
|
+
};
|
|
38
|
+
const resetStore = () => {
|
|
39
|
+
return client.resetStore();
|
|
40
|
+
};
|
|
41
|
+
const clearStore = () => {
|
|
42
|
+
return client.clearStore();
|
|
43
|
+
};
|
|
44
|
+
return { cache, evict, extract, identify, modify, resetStore, clearStore };
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
useCache
|
|
49
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* This file lets users run the Cedar CLI commands inside the /web directory
|
|
4
|
+
* in their projects.
|
|
5
|
+
* This works because of the "bin" field in the @cedarjs/web package.json file
|
|
6
|
+
* that points to this file.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=cedar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cedar.d.ts","sourceRoot":"","sources":["../../../src/bins/cedar.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var import_node_module = require("node:module");
|
|
26
|
+
var import_node_url = require("node:url");
|
|
27
|
+
const cliPackageJsonFileUrl = (0, import_node_url.pathToFileURL)(
|
|
28
|
+
require.resolve("@cedarjs/cli/package.json")
|
|
29
|
+
);
|
|
30
|
+
const requireFromCli = (0, import_node_module.createRequire)(cliPackageJsonFileUrl);
|
|
31
|
+
const bins = requireFromCli("./package.json")["bin"];
|
|
32
|
+
const cliEntryPointUrl = new URL(bins["cedar"], cliPackageJsonFileUrl);
|
|
33
|
+
if (process.env.PROJECT_CWD) {
|
|
34
|
+
process.chdir(process.env.PROJECT_CWD);
|
|
35
|
+
}
|
|
36
|
+
import(cliEntryPointUrl.toString());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cfw.d.ts","sourceRoot":"","sources":["../../../src/bins/cfw.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var import_node_module = require("node:module");
|
|
26
|
+
var import_node_url = require("node:url");
|
|
27
|
+
const cliPackageJsonFileUrl = (0, import_node_url.pathToFileURL)(
|
|
28
|
+
require.resolve("@cedarjs/cli/package.json")
|
|
29
|
+
);
|
|
30
|
+
const requireFromCli = (0, import_node_module.createRequire)(cliPackageJsonFileUrl);
|
|
31
|
+
const bins = requireFromCli("./package.json")["bin"];
|
|
32
|
+
const cliEntryPointUrl = new URL(bins["cfw"], cliPackageJsonFileUrl);
|
|
33
|
+
if (process.env.PROJECT_CWD) {
|
|
34
|
+
process.chdir(process.env.PROJECT_CWD);
|
|
35
|
+
}
|
|
36
|
+
import(cliEntryPointUrl.toString());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-env.d.ts","sourceRoot":"","sources":["../../../src/bins/cross-env.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var import_module = require("module");
|
|
26
|
+
const requireFromCrossEnv = (0, import_module.createRequire)(
|
|
27
|
+
require.resolve("cross-env/package.json")
|
|
28
|
+
);
|
|
29
|
+
const bins = requireFromCrossEnv("./package.json")["bin"];
|
|
30
|
+
requireFromCrossEnv(`./${bins["cross-env"]}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msw.d.ts","sourceRoot":"","sources":["../../../src/bins/msw.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var import_module = require("module");
|
|
26
|
+
const requireFromMSW = (0, import_module.createRequire)(require.resolve("msw"));
|
|
27
|
+
const bins = requireFromMSW("../package.json")["bin"];
|
|
28
|
+
requireFromMSW(`../${bins["msw"]}`);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* This file lets users run the Cedar CLI commands inside the /web directory
|
|
4
|
+
* in their projects.
|
|
5
|
+
* This works because of the "bin" field in the @cedarjs/web package.json file
|
|
6
|
+
* that points to this file.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=redwood.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redwood.d.ts","sourceRoot":"","sources":["../../../src/bins/redwood.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
|