@fastly/remix-server-adapter 0.1.5
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/LICENSE +27 -0
- package/README.md +61 -0
- package/SECURITY.md +13 -0
- package/build/src/implementation.d.ts +40 -0
- package/build/src/implementation.d.ts.map +1 -0
- package/build/src/implementation.js +77 -0
- package/build/src/implementation.js.map +1 -0
- package/build/src/index.d.ts +3 -0
- package/build/src/index.d.ts.map +1 -0
- package/build/src/index.js +12 -0
- package/build/src/index.js.map +1 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@fastly/remix-server-adapter is licensed for use as follows:
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
MIT License
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2022 Fastly, Inc.
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Remix Adapter for Fastly Compute@Edge
|
|
2
|
+
|
|
3
|
+
An adapter that allows the Compute@Edge JavaScript entry point program to start Remix.
|
|
4
|
+
This adapter package we have created is designed to be used with Fastly Compute@Edge alongside
|
|
5
|
+
[`@fastly/compute-js-static-publish`](https://github.com/fastly/compute-js-static-publish).
|
|
6
|
+
|
|
7
|
+
(`@fastly/compute-js-static-publish` is set up automatically for you if you set up your Remix
|
|
8
|
+
project using [`remix-template`](/packages/remix-template).)
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
The simplest usage is the `createEventHandler` function, which simply needs to be passed the
|
|
13
|
+
`staticAssets` object exported from `./statics`. This file is generated automatically by
|
|
14
|
+
`@fastly/compute-js-static-publish`.
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
/// <reference types="@fastly/js-compute" />
|
|
18
|
+
import { createEventHandler } from '@fastly/remix-server-adapter';
|
|
19
|
+
import { staticAssets } from './statics';
|
|
20
|
+
|
|
21
|
+
addEventListener("fetch", createEventHandler({ staticAssets }));
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If you need more granular control over the `ServerBuild` module to use with Remix, or whether to handle static assets,
|
|
25
|
+
you may use the lower-level `createEventHandler` and `handleAsset` functions:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
/// <reference types="@fastly/js-compute" />
|
|
29
|
+
import { createRequestHandler, handleAsset } from '@fastly/remix-server-adapter';
|
|
30
|
+
import { staticAssets } from './statics';
|
|
31
|
+
|
|
32
|
+
/** @type {import('@remix-run/server-runtime').ServerBuild} */
|
|
33
|
+
const build = staticAssets.getAsset('/build/index.js').module;
|
|
34
|
+
const requestHandler = createRequestHandler({build});
|
|
35
|
+
|
|
36
|
+
addEventListener("fetch", (event) => event.respondWith(handleRequest(event)));
|
|
37
|
+
async function handleRequest(event) {
|
|
38
|
+
let response = await handleAsset(event, staticAssets);
|
|
39
|
+
|
|
40
|
+
if (!response) {
|
|
41
|
+
response = requestHandler(event);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Issues
|
|
49
|
+
|
|
50
|
+
If you encounter any non-security-related bug or unexpected behavior, please [file an issue][bug]
|
|
51
|
+
using the bug report template.
|
|
52
|
+
|
|
53
|
+
[bug]: https://github.com/fastly/remix-compute-js/issues/new?labels=bug
|
|
54
|
+
|
|
55
|
+
### Security issues
|
|
56
|
+
|
|
57
|
+
Please see our [SECURITY.md](./SECURITY.md) for guidance on reporting security-related issues.
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
[MIT](./LICENSE).
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Report a security issue
|
|
2
|
+
|
|
3
|
+
The project team welcomes security reports and is committed to providing prompt attention to security issues. Security
|
|
4
|
+
issues should be reported privately via [Fastly’s security issue reporting process](https://www.fastly.com/security/report-security-issue).
|
|
5
|
+
|
|
6
|
+
## Security advisories
|
|
7
|
+
|
|
8
|
+
Remediation of security vulnerabilities is prioritized by the project team. The project team endeavors to coordinate
|
|
9
|
+
remediation with third-party stakeholders, and is committed to transparency in the disclosure process. The team announces
|
|
10
|
+
security issues via [GitHub](https://github.com/fastly/remix-compute-js/releases) on a best-effort basis.
|
|
11
|
+
|
|
12
|
+
Note that communications related to security issues in Fastly-maintained OSS as described here are distinct from
|
|
13
|
+
[Fastly Security Advisories](https://www.fastly.com/security-advisories).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="@fastly/js-compute" />
|
|
2
|
+
import type { StaticAssets } from "@fastly/compute-js-static-publish";
|
|
3
|
+
import type { AppLoadContext, ServerBuild } from "@fastly/remix-server-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* A function that returns the value to use as `context` in route `loader` and
|
|
6
|
+
* `action` functions.
|
|
7
|
+
*
|
|
8
|
+
* You can think of this as an escape hatch that allows you to pass
|
|
9
|
+
* environment/platform-specific values through to your loader/action.
|
|
10
|
+
*/
|
|
11
|
+
export type GetLoadContextFunction = (event: FetchEvent) => AppLoadContext;
|
|
12
|
+
export type RequestHandler = ReturnType<typeof createRequestHandler>;
|
|
13
|
+
/**
|
|
14
|
+
* Generates a Response that would serve a static asset corresponding to the URL requested
|
|
15
|
+
* by the passed-in FetchEvent.
|
|
16
|
+
* @param event { FetchEvent }
|
|
17
|
+
* @param staticAssets { StaticAssets }
|
|
18
|
+
*/
|
|
19
|
+
export declare function handleAsset(event: FetchEvent, staticAssets: StaticAssets): Promise<Response | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns a request handler for the Fastly Compute@Edge runtime that serves the
|
|
22
|
+
* Remix SSR response.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createRequestHandler({ build, getLoadContext, mode, }: {
|
|
25
|
+
build: ServerBuild;
|
|
26
|
+
getLoadContext?: GetLoadContextFunction;
|
|
27
|
+
mode?: string;
|
|
28
|
+
}): (event: FetchEvent) => Promise<Response>;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a simplified event handler that can be used on Fastly Compute@Edge.
|
|
31
|
+
* @param staticAssets { StaticAssets }
|
|
32
|
+
* @param getLoadContext { GetLoadContextFunction }
|
|
33
|
+
* @param mode
|
|
34
|
+
*/
|
|
35
|
+
export declare function createEventHandler({ staticAssets, getLoadContext, mode, }: {
|
|
36
|
+
staticAssets: StaticAssets;
|
|
37
|
+
getLoadContext?: GetLoadContextFunction;
|
|
38
|
+
mode?: string;
|
|
39
|
+
}): (event: FetchEvent) => void;
|
|
40
|
+
//# sourceMappingURL=implementation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../src/implementation.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhF;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,cAAc,CAAC;AAE3E,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAEzG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAClC,KAAK,EACL,cAAc,EACd,IAAI,GACN,EAAE;IACD,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,WAGgB,UAAU,uBAgB1B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,cAAc,EACd,IAAI,GACL,EAAE;IACD,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,WAmBgB,UAAU,UAgB1B"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Fastly, Inc.
|
|
4
|
+
* Licensed under the MIT license. See LICENSE file for details.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createEventHandler = exports.createRequestHandler = exports.handleAsset = void 0;
|
|
8
|
+
const remix_server_runtime_1 = require("@fastly/remix-server-runtime");
|
|
9
|
+
/**
|
|
10
|
+
* Generates a Response that would serve a static asset corresponding to the URL requested
|
|
11
|
+
* by the passed-in FetchEvent.
|
|
12
|
+
* @param event { FetchEvent }
|
|
13
|
+
* @param staticAssets { StaticAssets }
|
|
14
|
+
*/
|
|
15
|
+
async function handleAsset(event, staticAssets) {
|
|
16
|
+
return staticAssets.serveAssetForEvent(event, '/public');
|
|
17
|
+
}
|
|
18
|
+
exports.handleAsset = handleAsset;
|
|
19
|
+
/**
|
|
20
|
+
* Returns a request handler for the Fastly Compute@Edge runtime that serves the
|
|
21
|
+
* Remix SSR response.
|
|
22
|
+
*/
|
|
23
|
+
function createRequestHandler({ build, getLoadContext, mode, }) {
|
|
24
|
+
let handleRequest = (0, remix_server_runtime_1.createRequestHandler)(build, mode);
|
|
25
|
+
return (event) => {
|
|
26
|
+
let loadContext = getLoadContext?.(event);
|
|
27
|
+
// HACK: Until js-compute supports AbortSignal on Request
|
|
28
|
+
// we add a fake AbortSignal that doesn't actually abort
|
|
29
|
+
const request = event.request;
|
|
30
|
+
if (request.signal == null) {
|
|
31
|
+
request.signal = {
|
|
32
|
+
aborted: false,
|
|
33
|
+
addEventHandler: () => { },
|
|
34
|
+
removeEventHandler: () => { },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return handleRequest(request, loadContext);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.createRequestHandler = createRequestHandler;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a simplified event handler that can be used on Fastly Compute@Edge.
|
|
43
|
+
* @param staticAssets { StaticAssets }
|
|
44
|
+
* @param getLoadContext { GetLoadContextFunction }
|
|
45
|
+
* @param mode
|
|
46
|
+
*/
|
|
47
|
+
function createEventHandler({ staticAssets, getLoadContext, mode, }) {
|
|
48
|
+
const build = staticAssets.getAsset('/build/index.js').module;
|
|
49
|
+
let handleRequest = createRequestHandler({
|
|
50
|
+
build,
|
|
51
|
+
getLoadContext,
|
|
52
|
+
mode,
|
|
53
|
+
});
|
|
54
|
+
let handleEvent = async (event) => {
|
|
55
|
+
let response = await handleAsset(event, staticAssets);
|
|
56
|
+
if (!response) {
|
|
57
|
+
response = await handleRequest(event);
|
|
58
|
+
}
|
|
59
|
+
return response;
|
|
60
|
+
};
|
|
61
|
+
return (event) => {
|
|
62
|
+
try {
|
|
63
|
+
event.respondWith(handleEvent(event));
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
if (process.env.NODE_ENV === "development") {
|
|
67
|
+
event.respondWith(new Response(e.message || e.toString(), {
|
|
68
|
+
status: 500,
|
|
69
|
+
}));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
event.respondWith(new Response("Internal Error", { status: 500 }));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
exports.createEventHandler = createEventHandler;
|
|
77
|
+
//# sourceMappingURL=implementation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../src/implementation.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,uEAAiG;AAajG;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAAC,KAAiB,EAAE,YAA0B;IAC7E,OAAO,YAAY,CAAC,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC3D,CAAC;AAFD,kCAEC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,EAClC,KAAK,EACL,cAAc,EACd,IAAI,GAKN;IACC,IAAI,aAAa,GAAG,IAAA,2CAAyB,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAE3D,OAAO,CAAC,KAAiB,EAAE,EAAE;QAC3B,IAAI,WAAW,GAAG,cAAc,EAAE,CAAC,KAAK,CAAC,CAAC;QAE1C,yDAAyD;QACzD,wDAAwD;QACxD,MAAM,OAAO,GAAQ,KAAK,CAAC,OAAO,CAAC;QACnC,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE;YAC1B,OAAO,CAAC,MAAM,GAAG;gBACf,OAAO,EAAE,KAAK;gBACd,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;gBACzB,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;aAC7B,CAAC;SACH;QAED,OAAO,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC;AA3BD,oDA2BC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,cAAc,EACd,IAAI,GAKL;IACC,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,MAAqB,CAAC;IAE7E,IAAI,aAAa,GAAG,oBAAoB,CAAC;QACvC,KAAK;QACL,cAAc;QACd,IAAI;KACL,CAAC,CAAC;IAEH,IAAI,WAAW,GAAG,KAAK,EAAE,KAAiB,EAAE,EAAE;QAC5C,IAAI,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAEtD,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC;SACvC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CAAC,KAAiB,EAAE,EAAE;QAC3B,IAAI;YACF,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACvC;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;gBAC1C,KAAK,CAAC,WAAW,CACf,IAAI,QAAQ,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;oBACtC,MAAM,EAAE,GAAG;iBACZ,CAAC,CACH,CAAC;gBACF,OAAO;aACR;YAED,KAAK,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SACpE;IACH,CAAC,CAAC;AACJ,CAAC;AA3CD,gDA2CC","sourcesContent":["/*\n * Copyright Fastly, Inc.\n * Licensed under the MIT license. See LICENSE file for details.\n */\n\nimport type { StaticAssets } from \"@fastly/compute-js-static-publish\";\n\nimport type { AppLoadContext, ServerBuild } from \"@fastly/remix-server-runtime\";\nimport { createRequestHandler as createRemixRequestHandler } from \"@fastly/remix-server-runtime\";\n\n/**\n * A function that returns the value to use as `context` in route `loader` and\n * `action` functions.\n *\n * You can think of this as an escape hatch that allows you to pass\n * environment/platform-specific values through to your loader/action.\n */\nexport type GetLoadContextFunction = (event: FetchEvent) => AppLoadContext;\n\nexport type RequestHandler = ReturnType<typeof createRequestHandler>;\n\n/**\n * Generates a Response that would serve a static asset corresponding to the URL requested\n * by the passed-in FetchEvent.\n * @param event { FetchEvent }\n * @param staticAssets { StaticAssets }\n */\nexport async function handleAsset(event: FetchEvent, staticAssets: StaticAssets): Promise<Response | null> {\n return staticAssets.serveAssetForEvent(event, '/public');\n}\n\n/**\n * Returns a request handler for the Fastly Compute@Edge runtime that serves the\n * Remix SSR response.\n */\nexport function createRequestHandler({\n build,\n getLoadContext,\n mode,\n}: {\n build: ServerBuild;\n getLoadContext?: GetLoadContextFunction;\n mode?: string;\n}) {\n let handleRequest = createRemixRequestHandler(build, mode);\n\n return (event: FetchEvent) => {\n let loadContext = getLoadContext?.(event);\n\n // HACK: Until js-compute supports AbortSignal on Request\n // we add a fake AbortSignal that doesn't actually abort\n const request: any = event.request;\n if (request.signal == null) {\n request.signal = {\n aborted: false,\n addEventHandler: () => {},\n removeEventHandler: () => {},\n };\n }\n\n return handleRequest(request, loadContext);\n };\n}\n\n/**\n * Creates a simplified event handler that can be used on Fastly Compute@Edge.\n * @param staticAssets { StaticAssets }\n * @param getLoadContext { GetLoadContextFunction }\n * @param mode\n */\nexport function createEventHandler({\n staticAssets,\n getLoadContext,\n mode,\n}: {\n staticAssets: StaticAssets;\n getLoadContext?: GetLoadContextFunction;\n mode?: string;\n}) {\n const build = staticAssets.getAsset('/build/index.js').module as ServerBuild;\n\n let handleRequest = createRequestHandler({\n build,\n getLoadContext,\n mode,\n });\n\n let handleEvent = async (event: FetchEvent) => {\n let response = await handleAsset(event, staticAssets);\n\n if (!response) {\n response = await handleRequest(event);\n }\n\n return response;\n };\n\n return (event: FetchEvent) => {\n try {\n event.respondWith(handleEvent(event));\n } catch (e: any) {\n if (process.env.NODE_ENV === \"development\") {\n event.respondWith(\n new Response(e.message || e.toString(), {\n status: 500,\n })\n );\n return;\n }\n\n event.respondWith(new Response(\"Internal Error\", { status: 500 }));\n }\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,GACZ,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Fastly, Inc.
|
|
4
|
+
* Licensed under the MIT license. See LICENSE file for details.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.handleAsset = exports.createRequestHandler = exports.createEventHandler = void 0;
|
|
8
|
+
var implementation_1 = require("./implementation");
|
|
9
|
+
Object.defineProperty(exports, "createEventHandler", { enumerable: true, get: function () { return implementation_1.createEventHandler; } });
|
|
10
|
+
Object.defineProperty(exports, "createRequestHandler", { enumerable: true, get: function () { return implementation_1.createRequestHandler; } });
|
|
11
|
+
Object.defineProperty(exports, "handleAsset", { enumerable: true, get: function () { return implementation_1.handleAsset; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,mDAI0B;AAHxB,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA;AACpB,6GAAA,WAAW,OAAA","sourcesContent":["/*\n * Copyright Fastly, Inc.\n * Licensed under the MIT license. See LICENSE file for details.\n */\n\n/// <reference types='@fastly/js-compute' />\n\nexport type { GetLoadContextFunction, RequestHandler } from \"./implementation\";\nexport {\n createEventHandler,\n createRequestHandler,\n handleAsset,\n} from \"./implementation\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fastly/remix-server-adapter",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Remix Adapter for Fastly Compute@Edge",
|
|
6
|
+
"types": "./build/src/index.d.ts",
|
|
7
|
+
"main": "./build/src/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./build/src/index.js"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@fastly/compute-js-static-publish": "^2.3.1",
|
|
13
|
+
"@fastly/js-compute": "^0.5.12",
|
|
14
|
+
"@fastly/remix-server-runtime": "^0.1.5"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepack": "npm run clean && npm run compile",
|
|
18
|
+
"compile": "tsc --build tsconfig.json",
|
|
19
|
+
"clean": "rm -rf build"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"build/src/**/*.js",
|
|
23
|
+
"build/src/**/*.js.map",
|
|
24
|
+
"build/src/**/*.d.ts",
|
|
25
|
+
"build/src/**/*.d.ts.map",
|
|
26
|
+
"resources/**/*",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"README.md",
|
|
29
|
+
"SECURITY.md"
|
|
30
|
+
]
|
|
31
|
+
}
|