@ngrok/ngrok 0.1.1 → 0.3.0

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.
Files changed (135) hide show
  1. package/.prettierrc.json +3 -0
  2. package/CHANGELOG.md +10 -0
  3. package/Cargo.toml +1 -1
  4. package/README.md +51 -10
  5. package/RELEASE.md +3 -3
  6. package/docs/assets/highlight.css +13 -6
  7. package/docs/assets/main.js +3 -3
  8. package/docs/assets/search.js +1 -1
  9. package/docs/assets/style.css +447 -362
  10. package/docs/classes/NgrokHttpTunnel.html +112 -77
  11. package/docs/classes/NgrokHttpTunnelBuilder.html +235 -199
  12. package/docs/classes/NgrokLabeledTunnel.html +107 -72
  13. package/docs/classes/NgrokLabeledTunnelBuilder.html +84 -49
  14. package/docs/classes/NgrokSession.html +99 -66
  15. package/docs/classes/NgrokSessionBuilder.html +171 -138
  16. package/docs/classes/NgrokTcpTunnel.html +112 -77
  17. package/docs/classes/NgrokTcpTunnelBuilder.html +115 -80
  18. package/docs/classes/NgrokTlsTunnel.html +112 -77
  19. package/docs/classes/NgrokTlsTunnelBuilder.html +133 -98
  20. package/docs/classes/UpdateRequest.html +69 -33
  21. package/docs/functions/authtoken.html +88 -0
  22. package/docs/functions/connect.html +88 -0
  23. package/docs/functions/consoleLog.html +50 -34
  24. package/docs/functions/disconnect.html +88 -0
  25. package/docs/functions/kill.html +83 -0
  26. package/docs/functions/listen.html +52 -36
  27. package/docs/functions/listenable.html +51 -35
  28. package/docs/functions/loggingCallback.html +56 -40
  29. package/docs/index.html +115 -84
  30. package/docs/interfaces/Config.html +608 -0
  31. package/docs/modules.html +74 -47
  32. package/examples/express/ngrok-express-quickstart.js +11 -0
  33. package/examples/express/ngrok-express.js +28 -0
  34. package/examples/express/package.json +7 -0
  35. package/examples/fastify/ngrok-fastify.js +26 -0
  36. package/examples/fastify/package.json +7 -0
  37. package/examples/hapi/ngrok-hapi.js +35 -0
  38. package/examples/hapi/package.json +7 -0
  39. package/examples/koa/ngrok-koa.js +12 -0
  40. package/examples/koa/package.json +7 -0
  41. package/examples/nestjs/.eslintrc.js +25 -0
  42. package/examples/nestjs/.prettierrc +4 -0
  43. package/examples/nestjs/README.md +73 -0
  44. package/examples/nestjs/nest-cli.json +8 -0
  45. package/examples/nestjs/package-lock.json +12138 -0
  46. package/examples/nestjs/package.json +70 -0
  47. package/examples/nestjs/src/app.controller.spec.ts +22 -0
  48. package/examples/nestjs/src/app.controller.ts +12 -0
  49. package/examples/nestjs/src/app.module.ts +10 -0
  50. package/examples/nestjs/src/app.service.ts +8 -0
  51. package/examples/nestjs/src/main.ts +17 -0
  52. package/examples/nestjs/test/app.e2e-spec.ts +24 -0
  53. package/examples/nestjs/test/jest-e2e.json +9 -0
  54. package/examples/nestjs/tsconfig.build.json +4 -0
  55. package/examples/nestjs/tsconfig.json +21 -0
  56. package/examples/nextjs/next.config.js +12 -0
  57. package/examples/nextjs/ngrok.config.js +23 -0
  58. package/examples/nextjs/package.json +6 -0
  59. package/examples/nextjs/pages/index.js +5 -0
  60. package/examples/ngrok-connect-full.js +64 -0
  61. package/examples/ngrok-connect-minimal.js +16 -0
  62. package/examples/ngrok-http-full.js +28 -22
  63. package/examples/ngrok-http-minimum.js +17 -13
  64. package/examples/ngrok-labeled.js +22 -18
  65. package/examples/ngrok-listen.js +6 -7
  66. package/examples/ngrok-tcp.js +22 -19
  67. package/examples/ngrok-tls.js +23 -20
  68. package/examples/ngrok-typescript.ts +32 -27
  69. package/examples/ngrok-windows-pipe.js +22 -14
  70. package/examples/ngrok-winston.js +9 -9
  71. package/examples/package.json +11 -0
  72. package/examples/remix/.eslintrc.js +4 -0
  73. package/examples/remix/README.md +53 -0
  74. package/examples/remix/app/entry.client.tsx +18 -0
  75. package/examples/remix/app/entry.server.tsx +101 -0
  76. package/examples/remix/app/root.tsx +20 -0
  77. package/examples/remix/app/routes/_index.tsx +30 -0
  78. package/examples/remix/ngrok.config.js +16 -0
  79. package/examples/remix/package.json +30 -0
  80. package/examples/remix/public/favicon.ico +0 -0
  81. package/examples/remix/remix.config.js +16 -0
  82. package/examples/remix/remix.env.d.ts +2 -0
  83. package/examples/remix/tsconfig.json +22 -0
  84. package/examples/svelte/README.md +38 -0
  85. package/examples/svelte/jsconfig.json +17 -0
  86. package/examples/svelte/ngrok.config.cjs +18 -0
  87. package/examples/svelte/package.json +22 -0
  88. package/examples/svelte/src/app.d.ts +12 -0
  89. package/examples/svelte/src/app.html +12 -0
  90. package/examples/svelte/src/routes/+page.svelte +2 -0
  91. package/examples/svelte/static/favicon.png +0 -0
  92. package/examples/svelte/svelte.config.js +14 -0
  93. package/examples/svelte/vite.config.js +6 -0
  94. package/examples/vue/.vscode/extensions.json +3 -0
  95. package/examples/vue/README.md +40 -0
  96. package/examples/vue/env.d.ts +1 -0
  97. package/examples/vue/index.html +13 -0
  98. package/examples/vue/ngrok.config.ts +18 -0
  99. package/examples/vue/package.json +25 -0
  100. package/examples/vue/public/favicon.ico +0 -0
  101. package/examples/vue/src/App.vue +47 -0
  102. package/examples/vue/src/assets/base.css +74 -0
  103. package/examples/vue/src/assets/logo.svg +1 -0
  104. package/examples/vue/src/assets/main.css +35 -0
  105. package/examples/vue/src/components/HelloWorld.vue +40 -0
  106. package/examples/vue/src/components/TheWelcome.vue +86 -0
  107. package/examples/vue/src/components/WelcomeItem.vue +86 -0
  108. package/examples/vue/src/components/icons/IconCommunity.vue +7 -0
  109. package/examples/vue/src/components/icons/IconDocumentation.vue +7 -0
  110. package/examples/vue/src/components/icons/IconEcosystem.vue +7 -0
  111. package/examples/vue/src/components/icons/IconSupport.vue +7 -0
  112. package/examples/vue/src/components/icons/IconTooling.vue +19 -0
  113. package/examples/vue/src/main.ts +6 -0
  114. package/examples/vue/tsconfig.json +16 -0
  115. package/examples/vue/tsconfig.node.json +8 -0
  116. package/examples/vue/vite.config.ts +15 -0
  117. package/flake.nix +1 -1
  118. package/index.d.ts +243 -19
  119. package/index.js +145 -29
  120. package/package.json +20 -21
  121. package/post-build.js +18 -11
  122. package/scripts/gc-node-drop.js +38 -31
  123. package/scripts/gc-rust-drop.js +44 -38
  124. package/src/config.rs +182 -0
  125. package/src/connect.rs +328 -0
  126. package/src/http.rs +5 -4
  127. package/src/lib.rs +2 -0
  128. package/src/session.rs +61 -4
  129. package/src/tls.rs +1 -1
  130. package/src/tunnel.rs +105 -37
  131. package/src/tunnel_builder.rs +8 -0
  132. package/trailer.d.ts +9 -4
  133. package/trailer.js +140 -28
  134. package/examples/ngrok-express-quickstart.js +0 -11
  135. package/examples/ngrok-express.js +0 -26
@@ -1,13 +1,13 @@
1
- // Run with 'ts-node examples/ngrok-typescript.ts'
1
+ // Run with 'ts-node ngrok-typescript.ts'
2
2
 
3
3
  import * as http from "http";
4
- const httpServer = http.createServer(
5
- function(req,res){res.writeHead(200);
6
- res.write('Hello');
4
+ const httpServer = http.createServer(function (req, res) {
5
+ res.writeHead(200);
6
+ res.write("Hello");
7
7
  res.end();
8
- } );
8
+ });
9
9
 
10
- import * as ngrok from "../index";
10
+ import * as ngrok from "@ngrok/ngrok";
11
11
  ngrok.consoleLog();
12
12
 
13
13
  const run = async (): Promise<void> => {
@@ -15,12 +15,12 @@ const run = async (): Promise<void> => {
15
15
  // await listenable();
16
16
  // await listen();
17
17
  await standardConfig();
18
- }
18
+ };
19
19
 
20
20
  async function listenServer() {
21
21
  const tunnel = await ngrok.listen(httpServer);
22
- if ( typeof tunnel['url'] === 'function') {
23
- console.log("tunnel at: " + tunnel['url']());
22
+ if (typeof tunnel["url"] === "function") {
23
+ console.log("Ingress established at: ", tunnel["url"]());
24
24
  }
25
25
  }
26
26
 
@@ -30,32 +30,37 @@ async function listenable() {
30
30
  }
31
31
 
32
32
  async function listen() {
33
- const sessionBuilder = new ngrok.NgrokSessionBuilder().authtokenFromEnv()
33
+ const sessionBuilder = new ngrok.NgrokSessionBuilder().authtokenFromEnv();
34
34
  const session = await sessionBuilder.connect();
35
35
  const tunnel = await session.httpEndpoint().listen();
36
- httpServer.listen(tunnel);
36
+ httpServer.listen(tunnel);
37
37
  }
38
38
 
39
39
  async function standardConfig() {
40
- ngrok.loggingCallback(function(level, target, message) {
41
- console.log(`${level} ${target} - ${message}`);
42
- });
43
- const sessionBuilder = new ngrok.NgrokSessionBuilder().authtokenFromEnv()
44
- .handleStopCommand(() => {
45
- console.log("stop command");
46
- })
47
- .handleRestartCommand(() => {
48
- console.log("restart command");
49
- })
50
- .handleUpdateCommand((update) => {
51
- console.log("update command, version: " + update.version
52
- + " permitMajorVersion: " + update.permitMajorVersion);
40
+ ngrok.loggingCallback(function (level, target, message) {
41
+ console.log(level, target, "-", message);
53
42
  });
43
+ const sessionBuilder = new ngrok.NgrokSessionBuilder()
44
+ .authtokenFromEnv()
45
+ .handleStopCommand(() => {
46
+ console.log("stop command");
47
+ })
48
+ .handleRestartCommand(() => {
49
+ console.log("restart command");
50
+ })
51
+ .handleUpdateCommand((update) => {
52
+ console.log(
53
+ "update command, version: " +
54
+ update.version +
55
+ " permitMajorVersion: " +
56
+ update.permitMajorVersion
57
+ );
58
+ });
54
59
  const session = await sessionBuilder.connect();
55
60
  const tunnel = await session.httpEndpoint().listen();
56
- console.log('tunnel at: ' + tunnel.url());
57
- httpServer.listen(8081);
58
- tunnel.forwardTcp('localhost:8081');
61
+ console.log("Ingress established at:", tunnel.url());
62
+ httpServer.listen(8081);
63
+ tunnel.forwardTcp("localhost:8081");
59
64
 
60
65
  // unregister logging callback
61
66
  ngrok.loggingCallback();
@@ -1,17 +1,25 @@
1
- const PIPE = '\\\\.\\pipe\\ngrok_pipe';
1
+ const PIPE = "\\\\.\\pipe\\ngrok_pipe";
2
2
 
3
- const http = require('http');
4
- http.createServer(
5
- function(req,res){res.writeHead(200);
6
- res.write('Hello');
7
- res.end();
8
- } ).listen(PIPE);
3
+ const http = require("http");
4
+ http
5
+ .createServer(function (req, res) {
6
+ res.writeHead(200);
7
+ res.write("Hello");
8
+ res.end();
9
+ })
10
+ .listen(PIPE);
9
11
 
10
- const ngrok = require('@ngrok/ngrok');
12
+ const ngrok = require("@ngrok/ngrok");
11
13
  ngrok.consoleLog(); // turn on debug logging
12
- new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect().then((session) => {
13
- session.httpEndpoint().listen().then((tunnel) => {
14
- console.log('tunnel at: ' + tunnel.url());
15
- tunnel.forwardPipe(PIPE);
16
- })
17
- });
14
+ new ngrok.NgrokSessionBuilder()
15
+ .authtokenFromEnv()
16
+ .connect()
17
+ .then((session) => {
18
+ session
19
+ .httpEndpoint()
20
+ .listen()
21
+ .then((tunnel) => {
22
+ console.log("Ingress established at:", tunnel.url());
23
+ tunnel.forwardPipe(PIPE);
24
+ });
25
+ });
@@ -1,24 +1,24 @@
1
1
  // create winston logger
2
- const { createLogger, format, transports } = require('winston');
2
+ const { createLogger, format, transports } = require("winston");
3
3
  const logger = createLogger({
4
4
  format: format.combine(format.timestamp(), format.json()),
5
- level: 'silly',
5
+ level: "silly",
6
6
  transports: [new transports.Console({})],
7
7
  });
8
8
 
9
9
  // plumb ngrok logging to winston
10
- var ngrok = require('@ngrok/ngrok');
10
+ const ngrok = require("@ngrok/ngrok");
11
11
  ngrok.loggingCallback(function (level, target, message) {
12
12
  level = level == "TRACE" ? "silly" : level.toLowerCase();
13
- logger.log(level, message, {"target": target});
13
+ logger.log(level, message, { target: target });
14
14
  }, "TRACE");
15
15
 
16
16
  // set up tunnel
17
- const server = require('http').createServer(
18
- function(req,res){res.writeHead(200);
19
- res.write('Hello');
17
+ const server = require("http").createServer(function (req, res) {
18
+ res.writeHead(200);
19
+ res.write("Hello");
20
20
  res.end();
21
21
  });
22
- ngrok.listen(server).then((tunnel) => {
23
- console.log("url: " + tunnel.url());
22
+ ngrok.listen(server).then((socket) => {
23
+ logger.info("Ingress established at:", socket.tunnel.url());
24
24
  });
@@ -0,0 +1,11 @@
1
+ {
2
+ "devDependencies": {
3
+ "@ngrok/ngrok": "^0.2.0",
4
+ "create-remix": "1.15.0",
5
+ "create-svelte": "3.3.0",
6
+ "create-vue": "3.6.1",
7
+ "ts-node": "^10.9.1",
8
+ "winston": "^3.8.2"
9
+ },
10
+ "packageManager": "yarn@3.3.1"
11
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import('eslint').Linter.Config} */
2
+ module.exports = {
3
+ extends: ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
4
+ };
@@ -0,0 +1,53 @@
1
+ # Welcome to Remix!
2
+
3
+ - [Remix Docs](https://remix.run/docs)
4
+
5
+ ## Development
6
+
7
+ From your terminal:
8
+
9
+ ```sh
10
+ npm run dev
11
+ ```
12
+
13
+ This starts your app in development mode, rebuilding assets on file changes.
14
+
15
+ ## Deployment
16
+
17
+ First, build your app for production:
18
+
19
+ ```sh
20
+ npm run build
21
+ ```
22
+
23
+ Then run the app in production mode:
24
+
25
+ ```sh
26
+ npm start
27
+ ```
28
+
29
+ Now you'll need to pick a host to deploy it to.
30
+
31
+ ### DIY
32
+
33
+ If you're familiar with deploying node applications, the built-in Remix app server is production-ready.
34
+
35
+ Make sure to deploy the output of `remix build`
36
+
37
+ - `build/`
38
+ - `public/build/`
39
+
40
+ ### Using a Template
41
+
42
+ When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over your `app/` folder to the new project that's pre-configured for your target server.
43
+
44
+ ```sh
45
+ cd ..
46
+ # create a new project, and pick a pre-configured host
47
+ npx create-remix@latest
48
+ cd my-new-remix-app
49
+ # remove the new project's app (not the old one!)
50
+ rm -rf app
51
+ # copy your app over
52
+ cp -R ../my-old-remix-app/app app
53
+ ```
@@ -0,0 +1,18 @@
1
+ /**
2
+ * By default, Remix will handle hydrating your app on the client for you.
3
+ * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
4
+ * For more information, see https://remix.run/docs/en/main/file-conventions/entry.client
5
+ */
6
+
7
+ import { RemixBrowser } from "@remix-run/react";
8
+ import { startTransition, StrictMode } from "react";
9
+ import { hydrateRoot } from "react-dom/client";
10
+
11
+ startTransition(() => {
12
+ hydrateRoot(
13
+ document,
14
+ <StrictMode>
15
+ <RemixBrowser />
16
+ </StrictMode>
17
+ );
18
+ });
@@ -0,0 +1,101 @@
1
+ /**
2
+ * By default, Remix will handle generating the HTTP Response for you.
3
+ * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
4
+ * For more information, see https://remix.run/docs/en/main/file-conventions/entry.server
5
+ */
6
+
7
+ import { PassThrough } from "node:stream";
8
+ import type { EntryContext } from "@remix-run/node";
9
+ import { Response } from "@remix-run/node";
10
+ import { RemixServer } from "@remix-run/react";
11
+ import isbot from "isbot";
12
+ import { renderToPipeableStream } from "react-dom/server";
13
+
14
+ const ABORT_DELAY = 5_000;
15
+
16
+ export default function handleRequest(
17
+ request: Request,
18
+ responseStatusCode: number,
19
+ responseHeaders: Headers,
20
+ remixContext: EntryContext
21
+ ) {
22
+ return isbot(request.headers.get("user-agent"))
23
+ ? handleBotRequest(request, responseStatusCode, responseHeaders, remixContext)
24
+ : handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext);
25
+ }
26
+
27
+ function handleBotRequest(
28
+ request: Request,
29
+ responseStatusCode: number,
30
+ responseHeaders: Headers,
31
+ remixContext: EntryContext
32
+ ) {
33
+ return new Promise((resolve, reject) => {
34
+ const { pipe, abort } = renderToPipeableStream(
35
+ <RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />,
36
+ {
37
+ onAllReady() {
38
+ const body = new PassThrough();
39
+
40
+ responseHeaders.set("Content-Type", "text/html");
41
+
42
+ resolve(
43
+ new Response(body, {
44
+ headers: responseHeaders,
45
+ status: responseStatusCode,
46
+ })
47
+ );
48
+
49
+ pipe(body);
50
+ },
51
+ onShellError(error: unknown) {
52
+ reject(error);
53
+ },
54
+ onError(error: unknown) {
55
+ responseStatusCode = 500;
56
+ console.error(error);
57
+ },
58
+ }
59
+ );
60
+
61
+ setTimeout(abort, ABORT_DELAY);
62
+ });
63
+ }
64
+
65
+ function handleBrowserRequest(
66
+ request: Request,
67
+ responseStatusCode: number,
68
+ responseHeaders: Headers,
69
+ remixContext: EntryContext
70
+ ) {
71
+ return new Promise((resolve, reject) => {
72
+ const { pipe, abort } = renderToPipeableStream(
73
+ <RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />,
74
+ {
75
+ onShellReady() {
76
+ const body = new PassThrough();
77
+
78
+ responseHeaders.set("Content-Type", "text/html");
79
+
80
+ resolve(
81
+ new Response(body, {
82
+ headers: responseHeaders,
83
+ status: responseStatusCode,
84
+ })
85
+ );
86
+
87
+ pipe(body);
88
+ },
89
+ onShellError(error: unknown) {
90
+ reject(error);
91
+ },
92
+ onError(error: unknown) {
93
+ console.error(error);
94
+ responseStatusCode = 500;
95
+ },
96
+ }
97
+ );
98
+
99
+ setTimeout(abort, ABORT_DELAY);
100
+ });
101
+ }
@@ -0,0 +1,20 @@
1
+ import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from "@remix-run/react";
2
+
3
+ export default function App() {
4
+ return (
5
+ <html lang="en">
6
+ <head>
7
+ <meta charSet="utf-8" />
8
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
9
+ <Meta />
10
+ <Links />
11
+ </head>
12
+ <body>
13
+ <Outlet />
14
+ <ScrollRestoration />
15
+ <Scripts />
16
+ <LiveReload />
17
+ </body>
18
+ </html>
19
+ );
20
+ }
@@ -0,0 +1,30 @@
1
+ import type { V2_MetaFunction } from "@remix-run/react";
2
+
3
+ export const meta: V2_MetaFunction = () => {
4
+ return [{ title: "New Remix App" }];
5
+ };
6
+
7
+ export default function Index() {
8
+ return (
9
+ <div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
10
+ <h1>Welcome to Remix</h1>
11
+ <ul>
12
+ <li>
13
+ <a target="_blank" href="https://remix.run/tutorials/blog" rel="noreferrer">
14
+ 15m Quickstart Blog Tutorial
15
+ </a>
16
+ </li>
17
+ <li>
18
+ <a target="_blank" href="https://remix.run/tutorials/jokes" rel="noreferrer">
19
+ Deep Dive Jokes App Tutorial
20
+ </a>
21
+ </li>
22
+ <li>
23
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
24
+ Remix Docs
25
+ </a>
26
+ </li>
27
+ </ul>
28
+ </div>
29
+ );
30
+ }
@@ -0,0 +1,16 @@
1
+ const ngrok = require("@ngrok/ngrok");
2
+
3
+ // setup ngrok ingress in the parent process
4
+ var port = process.env.PORT || "3000";
5
+ process.argv.forEach((item, index) => {
6
+ if (["--port", "-p"].includes(item)) port = process.argv[index + 1];
7
+ });
8
+
9
+ async function setup() {
10
+ const session = await new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect();
11
+ const tunnel = await session.httpEndpoint().listen();
12
+ console.log(`Forwarding to: localhost:${port} from ingress at: ${tunnel.url()}`);
13
+ tunnel.forwardTcp(`localhost:${port}`);
14
+ }
15
+
16
+ setup();
@@ -0,0 +1,30 @@
1
+ {
2
+ "private": true,
3
+ "sideEffects": false,
4
+ "scripts": {
5
+ "build": "remix build",
6
+ "dev": "remix dev",
7
+ "start": "remix-serve build",
8
+ "typecheck": "tsc"
9
+ },
10
+ "dependencies": {
11
+ "@ngrok/ngrok": "^0.2.0",
12
+ "@remix-run/node": "^1.15.0",
13
+ "@remix-run/react": "^1.15.0",
14
+ "@remix-run/serve": "^1.15.0",
15
+ "isbot": "^3.6.5",
16
+ "react": "^18.2.0",
17
+ "react-dom": "^18.2.0"
18
+ },
19
+ "devDependencies": {
20
+ "@remix-run/dev": "^1.15.0",
21
+ "@remix-run/eslint-config": "^1.15.0",
22
+ "@types/react": "^18.0.25",
23
+ "@types/react-dom": "^18.0.8",
24
+ "eslint": "^8.27.0",
25
+ "typescript": "^4.8.4"
26
+ },
27
+ "engines": {
28
+ "node": ">=14"
29
+ }
30
+ }
@@ -0,0 +1,16 @@
1
+ require("./ngrok.config.js");
2
+
3
+ /** @type {import('@remix-run/dev').AppConfig} */
4
+ module.exports = {
5
+ ignoredRouteFiles: ["**/.*"],
6
+ // appDirectory: "app",
7
+ // assetsBuildDirectory: "public/build",
8
+ // serverBuildPath: "build/index.js",
9
+ // publicPath: "/build/",
10
+ future: {
11
+ v2_errorBoundary: true,
12
+ v2_meta: true,
13
+ v2_normalizeFormMethod: true,
14
+ v2_routeConvention: true,
15
+ },
16
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="@remix-run/dev" />
2
+ /// <reference types="@remix-run/node" />
@@ -0,0 +1,22 @@
1
+ {
2
+ "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
3
+ "compilerOptions": {
4
+ "lib": ["DOM", "DOM.Iterable", "ES2019"],
5
+ "isolatedModules": true,
6
+ "esModuleInterop": true,
7
+ "jsx": "react-jsx",
8
+ "moduleResolution": "node",
9
+ "resolveJsonModule": true,
10
+ "target": "ES2019",
11
+ "strict": true,
12
+ "allowJs": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "baseUrl": ".",
15
+ "paths": {
16
+ "~/*": ["./app/*"]
17
+ },
18
+
19
+ // Remix takes care of building everything in `remix build`.
20
+ "noEmit": true
21
+ }
22
+ }
@@ -0,0 +1,38 @@
1
+ # create-svelte
2
+
3
+ Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4
+
5
+ ## Creating a project
6
+
7
+ If you're seeing this, you've probably already done this step. Congrats!
8
+
9
+ ```bash
10
+ # create a new project in the current directory
11
+ npm create svelte@latest
12
+
13
+ # create a new project in my-app
14
+ npm create svelte@latest my-app
15
+ ```
16
+
17
+ ## Developing
18
+
19
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20
+
21
+ ```bash
22
+ npm run dev
23
+
24
+ # or start the server and open the app in a new browser tab
25
+ npm run dev -- --open
26
+ ```
27
+
28
+ ## Building
29
+
30
+ To create a production version of your app:
31
+
32
+ ```bash
33
+ npm run build
34
+ ```
35
+
36
+ You can preview the production build with `npm run preview`.
37
+
38
+ > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "./.svelte-kit/tsconfig.json",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "checkJs": true,
6
+ "esModuleInterop": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "resolveJsonModule": true,
9
+ "skipLibCheck": true,
10
+ "sourceMap": true,
11
+ "strict": true
12
+ }
13
+ // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
14
+ //
15
+ // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16
+ // from the referenced tsconfig.json - TypeScript does not merge them in
17
+ }
@@ -0,0 +1,18 @@
1
+ const ngrok = require("@ngrok/ngrok");
2
+
3
+ // setup ngrok ingress in the parent process
4
+ var host = "localhost";
5
+ var port = "5173";
6
+ process.argv.forEach((item, index) => {
7
+ if (item == "--host") host = process.argv[index + 1];
8
+ if (item == "--port") port = process.argv[index + 1];
9
+ });
10
+
11
+ async function setup() {
12
+ const session = await new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect();
13
+ const tunnel = await session.httpEndpoint().listen();
14
+ console.log(`Forwarding to: ${host}:${port} from ingress at: ${tunnel.url()}`);
15
+ tunnel.forwardTcp(`${host}:${port}`);
16
+ }
17
+
18
+ setup();
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "svelte",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "vite dev",
7
+ "build": "vite build",
8
+ "preview": "vite preview",
9
+ "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
10
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
11
+ },
12
+ "devDependencies": {
13
+ "@ngrok/ngrok": "^0.2.0",
14
+ "@sveltejs/adapter-auto": "^2.0.0",
15
+ "@sveltejs/kit": "^1.5.0",
16
+ "svelte": "^3.54.0",
17
+ "svelte-check": "^3.0.1",
18
+ "typescript": "^5.0.0",
19
+ "vite": "^4.2.0"
20
+ },
21
+ "type": "module"
22
+ }
@@ -0,0 +1,12 @@
1
+ // See https://kit.svelte.dev/docs/types#app
2
+ // for information about these interfaces
3
+ declare global {
4
+ namespace App {
5
+ // interface Error {}
6
+ // interface Locals {}
7
+ // interface PageData {}
8
+ // interface Platform {}
9
+ }
10
+ }
11
+
12
+ export {};
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%sveltekit.assets%/favicon.png" />
6
+ <meta name="viewport" content="width=device-width" />
7
+ %sveltekit.head%
8
+ </head>
9
+ <body data-sveltekit-preload-data="hover">
10
+ <div style="display: contents">%sveltekit.body%</div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,2 @@
1
+ <h1>Welcome to SvelteKit</h1>
2
+ <p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
@@ -0,0 +1,14 @@
1
+ import adapter from "@sveltejs/adapter-auto";
2
+ import "./ngrok.config.cjs";
3
+
4
+ /** @type {import('@sveltejs/kit').Config} */
5
+ const config = {
6
+ kit: {
7
+ // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
8
+ // If your environment is not supported or you settled on a specific environment, switch out the adapter.
9
+ // See https://kit.svelte.dev/docs/adapters for more information about adapters.
10
+ adapter: adapter(),
11
+ },
12
+ };
13
+
14
+ export default config;
@@ -0,0 +1,6 @@
1
+ import { sveltekit } from "@sveltejs/kit/vite";
2
+ import { defineConfig } from "vite";
3
+
4
+ export default defineConfig({
5
+ plugins: [sveltekit()],
6
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3
+ }