@tachybase/plugin-adapter-remix 0.23.8

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 (37) hide show
  1. package/.turbo/turbo-build.log +6 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/index.d.ts +4 -0
  6. package/dist/client/index.js +1 -0
  7. package/dist/externalVersion.js +4 -0
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.js +39 -0
  10. package/dist/node_modules/@remix-run/express/dist/index.d.ts +2 -0
  11. package/dist/node_modules/@remix-run/express/dist/index.js +362 -0
  12. package/dist/node_modules/@remix-run/express/dist/server.d.ts +24 -0
  13. package/dist/node_modules/@remix-run/express/dist/server.js +118 -0
  14. package/dist/node_modules/@remix-run/express/node_modules/.bin/tsc +17 -0
  15. package/dist/node_modules/@remix-run/express/node_modules/.bin/tsserver +17 -0
  16. package/dist/node_modules/@remix-run/express/package.json +1 -0
  17. package/dist/node_modules/express/LICENSE +24 -0
  18. package/dist/node_modules/express/index.js +313 -0
  19. package/dist/node_modules/express/lib/application.js +661 -0
  20. package/dist/node_modules/express/lib/express.js +116 -0
  21. package/dist/node_modules/express/lib/middleware/init.js +43 -0
  22. package/dist/node_modules/express/lib/middleware/query.js +47 -0
  23. package/dist/node_modules/express/lib/request.js +525 -0
  24. package/dist/node_modules/express/lib/response.js +1179 -0
  25. package/dist/node_modules/express/lib/router/index.js +673 -0
  26. package/dist/node_modules/express/lib/router/layer.js +181 -0
  27. package/dist/node_modules/express/lib/router/route.js +230 -0
  28. package/dist/node_modules/express/lib/utils.js +303 -0
  29. package/dist/node_modules/express/lib/view.js +182 -0
  30. package/dist/node_modules/express/package.json +1 -0
  31. package/dist/server/index.d.ts +1 -0
  32. package/dist/server/index.js +33 -0
  33. package/dist/server/plugin.d.ts +11 -0
  34. package/dist/server/plugin.js +84 -0
  35. package/package.json +24 -0
  36. package/server.d.ts +2 -0
  37. package/server.js +1 -0
@@ -0,0 +1,182 @@
1
+ /*!
2
+ * express
3
+ * Copyright(c) 2009-2013 TJ Holowaychuk
4
+ * Copyright(c) 2013 Roman Shtylman
5
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
6
+ * MIT Licensed
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ /**
12
+ * Module dependencies.
13
+ * @private
14
+ */
15
+
16
+ var debug = require('debug')('express:view');
17
+ var path = require('path');
18
+ var fs = require('fs');
19
+
20
+ /**
21
+ * Module variables.
22
+ * @private
23
+ */
24
+
25
+ var dirname = path.dirname;
26
+ var basename = path.basename;
27
+ var extname = path.extname;
28
+ var join = path.join;
29
+ var resolve = path.resolve;
30
+
31
+ /**
32
+ * Module exports.
33
+ * @public
34
+ */
35
+
36
+ module.exports = View;
37
+
38
+ /**
39
+ * Initialize a new `View` with the given `name`.
40
+ *
41
+ * Options:
42
+ *
43
+ * - `defaultEngine` the default template engine name
44
+ * - `engines` template engine require() cache
45
+ * - `root` root path for view lookup
46
+ *
47
+ * @param {string} name
48
+ * @param {object} options
49
+ * @public
50
+ */
51
+
52
+ function View(name, options) {
53
+ var opts = options || {};
54
+
55
+ this.defaultEngine = opts.defaultEngine;
56
+ this.ext = extname(name);
57
+ this.name = name;
58
+ this.root = opts.root;
59
+
60
+ if (!this.ext && !this.defaultEngine) {
61
+ throw new Error('No default engine was specified and no extension was provided.');
62
+ }
63
+
64
+ var fileName = name;
65
+
66
+ if (!this.ext) {
67
+ // get extension from default engine name
68
+ this.ext = this.defaultEngine[0] !== '.'
69
+ ? '.' + this.defaultEngine
70
+ : this.defaultEngine;
71
+
72
+ fileName += this.ext;
73
+ }
74
+
75
+ if (!opts.engines[this.ext]) {
76
+ // load engine
77
+ var mod = this.ext.slice(1)
78
+ debug('require "%s"', mod)
79
+
80
+ // default engine export
81
+ var fn = require(mod).__express
82
+
83
+ if (typeof fn !== 'function') {
84
+ throw new Error('Module "' + mod + '" does not provide a view engine.')
85
+ }
86
+
87
+ opts.engines[this.ext] = fn
88
+ }
89
+
90
+ // store loaded engine
91
+ this.engine = opts.engines[this.ext];
92
+
93
+ // lookup path
94
+ this.path = this.lookup(fileName);
95
+ }
96
+
97
+ /**
98
+ * Lookup view by the given `name`
99
+ *
100
+ * @param {string} name
101
+ * @private
102
+ */
103
+
104
+ View.prototype.lookup = function lookup(name) {
105
+ var path;
106
+ var roots = [].concat(this.root);
107
+
108
+ debug('lookup "%s"', name);
109
+
110
+ for (var i = 0; i < roots.length && !path; i++) {
111
+ var root = roots[i];
112
+
113
+ // resolve the path
114
+ var loc = resolve(root, name);
115
+ var dir = dirname(loc);
116
+ var file = basename(loc);
117
+
118
+ // resolve the file
119
+ path = this.resolve(dir, file);
120
+ }
121
+
122
+ return path;
123
+ };
124
+
125
+ /**
126
+ * Render with the given options.
127
+ *
128
+ * @param {object} options
129
+ * @param {function} callback
130
+ * @private
131
+ */
132
+
133
+ View.prototype.render = function render(options, callback) {
134
+ debug('render "%s"', this.path);
135
+ this.engine(this.path, options, callback);
136
+ };
137
+
138
+ /**
139
+ * Resolve the file within the given directory.
140
+ *
141
+ * @param {string} dir
142
+ * @param {string} file
143
+ * @private
144
+ */
145
+
146
+ View.prototype.resolve = function resolve(dir, file) {
147
+ var ext = this.ext;
148
+
149
+ // <path>.<ext>
150
+ var path = join(dir, file);
151
+ var stat = tryStat(path);
152
+
153
+ if (stat && stat.isFile()) {
154
+ return path;
155
+ }
156
+
157
+ // <path>/index.<ext>
158
+ path = join(dir, basename(file, ext), 'index' + ext);
159
+ stat = tryStat(path);
160
+
161
+ if (stat && stat.isFile()) {
162
+ return path;
163
+ }
164
+ };
165
+
166
+ /**
167
+ * Return a stat, maybe.
168
+ *
169
+ * @param {string} path
170
+ * @return {fs.Stats}
171
+ * @private
172
+ */
173
+
174
+ function tryStat(path) {
175
+ debug('stat "%s"', path);
176
+
177
+ try {
178
+ return fs.statSync(path);
179
+ } catch (e) {
180
+ return undefined;
181
+ }
182
+ }
@@ -0,0 +1 @@
1
+ {"name":"express","description":"Fast, unopinionated, minimalist web framework","version":"4.21.2","author":"TJ Holowaychuk <tj@vision-media.ca>","contributors":["Aaron Heckmann <aaron.heckmann+github@gmail.com>","Ciaran Jessup <ciaranj@gmail.com>","Douglas Christopher Wilson <doug@somethingdoug.com>","Guillermo Rauch <rauchg@gmail.com>","Jonathan Ong <me@jongleberry.com>","Roman Shtylman <shtylman+expressjs@gmail.com>","Young Jae Sim <hanul@hanul.me>"],"license":"MIT","repository":"expressjs/express","homepage":"http://expressjs.com/","funding":{"type":"opencollective","url":"https://opencollective.com/express"},"keywords":["express","framework","sinatra","web","http","rest","restful","router","app","api"],"dependencies":{"accepts":"~1.3.8","array-flatten":"1.1.1","body-parser":"1.20.3","content-disposition":"0.5.4","content-type":"~1.0.4","cookie":"0.7.1","cookie-signature":"1.0.6","debug":"2.6.9","depd":"2.0.0","encodeurl":"~2.0.0","escape-html":"~1.0.3","etag":"~1.8.1","finalhandler":"1.3.1","fresh":"0.5.2","http-errors":"2.0.0","merge-descriptors":"1.0.3","methods":"~1.1.2","on-finished":"2.4.1","parseurl":"~1.3.3","path-to-regexp":"0.1.12","proxy-addr":"~2.0.7","qs":"6.13.0","range-parser":"~1.2.1","safe-buffer":"5.2.1","send":"0.19.0","serve-static":"1.16.2","setprototypeof":"1.2.0","statuses":"2.0.1","type-is":"~1.6.18","utils-merge":"1.0.1","vary":"~1.1.2"},"devDependencies":{"after":"0.8.2","connect-redis":"3.4.2","cookie-parser":"1.4.6","cookie-session":"2.0.0","ejs":"3.1.9","eslint":"8.47.0","express-session":"1.17.2","hbs":"4.2.0","marked":"0.7.0","method-override":"3.0.0","mocha":"10.2.0","morgan":"1.10.0","nyc":"15.1.0","pbkdf2-password":"1.2.1","supertest":"6.3.0","vhost":"~3.0.2"},"engines":{"node":">= 0.10.0"},"files":["LICENSE","History.md","Readme.md","index.js","lib/"],"scripts":{"lint":"eslint .","test":"mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/","test-ci":"nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test","test-cov":"nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test","test-tap":"mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"},"_lastModified":"2024-12-22T16:05:19.368Z"}
@@ -0,0 +1 @@
1
+ export { default } from './plugin';
@@ -0,0 +1,33 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var server_exports = {};
29
+ __export(server_exports, {
30
+ default: () => import_plugin.default
31
+ });
32
+ module.exports = __toCommonJS(server_exports);
33
+ var import_plugin = __toESM(require("./plugin"));
@@ -0,0 +1,11 @@
1
+ import { Plugin } from '@tachybase/server';
2
+ export declare class PluginAdapterRemixServer extends Plugin {
3
+ afterAdd(): Promise<void>;
4
+ beforeLoad(): Promise<void>;
5
+ load(): Promise<void>;
6
+ install(): Promise<void>;
7
+ afterEnable(): Promise<void>;
8
+ afterDisable(): Promise<void>;
9
+ remove(): Promise<void>;
10
+ }
11
+ export default PluginAdapterRemixServer;
@@ -0,0 +1,84 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var plugin_exports = {};
29
+ __export(plugin_exports, {
30
+ PluginAdapterRemixServer: () => PluginAdapterRemixServer,
31
+ default: () => plugin_default
32
+ });
33
+ module.exports = __toCommonJS(plugin_exports);
34
+ var import_node_fs = __toESM(require("node:fs"));
35
+ var import_node_path = __toESM(require("node:path"));
36
+ var import_node_process = __toESM(require("node:process"));
37
+ var import_server = require("@tachybase/server");
38
+ var import_express = require("@remix-run/express");
39
+ var import_express2 = __toESM(require("express"));
40
+ class PluginAdapterRemixServer extends import_server.Plugin {
41
+ async afterAdd() {
42
+ }
43
+ async beforeLoad() {
44
+ }
45
+ async load() {
46
+ const callback = (0, import_express2.default)();
47
+ const prefix = "/adapters/remix";
48
+ const remixPath = import_node_path.default.join(import_node_process.default.cwd(), "storage/remix");
49
+ if (!import_node_fs.default.existsSync(remixPath)) {
50
+ import_node_fs.default.mkdirSync(remixPath, { recursive: true });
51
+ }
52
+ const demoCode = "demo2";
53
+ const demoPath = import_node_path.default.join(remixPath, demoCode);
54
+ const build = await import(import_node_path.default.join(demoPath, "server/index.js"));
55
+ const router = import_express2.default.Router();
56
+ router.use(import_express2.default.static(import_node_path.default.join(demoPath, "client")));
57
+ router.all(
58
+ "*",
59
+ (0, import_express.createRequestHandler)({
60
+ build
61
+ })
62
+ );
63
+ callback.use(prefix + "/" + demoCode, router);
64
+ import_server.Gateway.getInstance().registerHandler({
65
+ name: "remix",
66
+ prefix,
67
+ callback
68
+ });
69
+ }
70
+ async install() {
71
+ }
72
+ async afterEnable() {
73
+ }
74
+ async afterDisable() {
75
+ import_server.Gateway.getInstance().unregisterHandler("red-node");
76
+ }
77
+ async remove() {
78
+ }
79
+ }
80
+ var plugin_default = PluginAdapterRemixServer;
81
+ // Annotate the CommonJS export names for ESM import in node:
82
+ 0 && (module.exports = {
83
+ PluginAdapterRemixServer
84
+ });
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@tachybase/plugin-adapter-remix",
3
+ "version": "0.23.8",
4
+ "main": "dist/server/index.js",
5
+ "devDependencies": {
6
+ "@remix-run/express": "^2.15.2",
7
+ "@remix-run/react": "^2.15.2",
8
+ "cross-env": "^7.0.3",
9
+ "express": "^4.21.2",
10
+ "isbot": "^5.1.18",
11
+ "match-sorter": "^7.0.0",
12
+ "react": "^18.3.1",
13
+ "sort-by": "^1.2.0",
14
+ "tiny-invariant": "^1.3.3"
15
+ },
16
+ "peerDependencies": {
17
+ "@tachybase/client": "0.23.8",
18
+ "@tachybase/server": "0.23.8",
19
+ "@tachybase/test": "0.23.8"
20
+ },
21
+ "scripts": {
22
+ "build": "tachybase-build --no-dts @tachybase/plugin-adapter-remix"
23
+ }
24
+ }
package/server.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/server';
2
+ export { default } from './dist/server';
package/server.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/server/index.js');