@rivetkit/sql-loader 0.0.0-pr.4600.8dee603
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/README.md +11 -0
- package/dist/hook.cjs +17 -0
- package/dist/hook.cjs.map +1 -0
- package/dist/hook.js +17 -0
- package/dist/hook.js.map +1 -0
- package/dist/register.cjs +9 -0
- package/dist/register.cjs.map +1 -0
- package/dist/register.js +9 -0
- package/dist/register.js.map +1 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# RivetKit SQL Loader
|
|
2
|
+
|
|
3
|
+
_Lightweight Libraries for Backends_
|
|
4
|
+
|
|
5
|
+
[Learn More →](https://github.com/rivet-dev/rivet)
|
|
6
|
+
|
|
7
|
+
[Discord](https://rivet.dev/discord) — [Documentation](https://rivetkit.org) — [Issues](https://github.com/rivet-dev/rivet/issues)
|
|
8
|
+
|
|
9
|
+
## License
|
|
10
|
+
|
|
11
|
+
Apache 2.0
|
package/dist/hook.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/hook.ts
|
|
2
|
+
var _fs = require('fs');
|
|
3
|
+
var _url = require('url');
|
|
4
|
+
var load = async (url, context, nextLoad) => {
|
|
5
|
+
if (url.endsWith(".sql")) {
|
|
6
|
+
return {
|
|
7
|
+
shortCircuit: true,
|
|
8
|
+
format: "module",
|
|
9
|
+
source: `export default ${JSON.stringify(_fs.readFileSync.call(void 0, _url.fileURLToPath.call(void 0, url), "utf-8"))};`
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return nextLoad(url, context);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.load = load;
|
|
17
|
+
//# sourceMappingURL=hook.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/sql-loader/dist/hook.cjs","../src/hook.ts"],"names":[],"mappings":"AAAA;ACAA,wBAA6B;AAE7B,0BAA8B;AAEvB,IAAM,KAAA,EAAiB,MAAA,CAAO,GAAA,EAAK,OAAA,EAAS,QAAA,EAAA,GAAa;AAC/D,EAAA,GAAA,CAAI,GAAA,CAAI,QAAA,CAAS,MAAM,CAAA,EAAG;AACzB,IAAA,OAAO;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,MAAA,EAAQ,QAAA;AAAA,MACR,MAAA,EAAQ,CAAA,eAAA,EAAkB,IAAA,CAAK,SAAA,CAAU,8BAAA,gCAAa,GAAiB,CAAA,EAAG,OAAO,CAAC,CAAC,CAAA,CAAA;AAAA,IACpF,CAAA;AAAA,EACD;AACA,EAAA,OAAO,QAAA,CAAS,GAAA,EAAK,OAAO,CAAA;AAC7B,CAAA;ADAA;AACE;AACF,oBAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/sql-loader/dist/hook.cjs","sourcesContent":[null,"import { readFileSync } from \"node:fs\";\nimport type { LoadHook } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\n\nexport const load: LoadHook = async (url, context, nextLoad) => {\n\tif (url.endsWith(\".sql\")) {\n\t\treturn {\n\t\t\tshortCircuit: true,\n\t\t\tformat: \"module\",\n\t\t\tsource: `export default ${JSON.stringify(readFileSync(fileURLToPath(url), \"utf-8\"))};`,\n\t\t};\n\t}\n\treturn nextLoad(url, context);\n};\n"]}
|
package/dist/hook.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/hook.ts
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
var load = async (url, context, nextLoad) => {
|
|
5
|
+
if (url.endsWith(".sql")) {
|
|
6
|
+
return {
|
|
7
|
+
shortCircuit: true,
|
|
8
|
+
format: "module",
|
|
9
|
+
source: `export default ${JSON.stringify(readFileSync(fileURLToPath(url), "utf-8"))};`
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return nextLoad(url, context);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
load
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=hook.js.map
|
package/dist/hook.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hook.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type { LoadHook } from \"node:module\";\nimport { fileURLToPath } from \"node:url\";\n\nexport const load: LoadHook = async (url, context, nextLoad) => {\n\tif (url.endsWith(\".sql\")) {\n\t\treturn {\n\t\t\tshortCircuit: true,\n\t\t\tformat: \"module\",\n\t\t\tsource: `export default ${JSON.stringify(readFileSync(fileURLToPath(url), \"utf-8\"))};`,\n\t\t};\n\t}\n\treturn nextLoad(url, context);\n};\n"],"mappings":";AAAA,SAAS,oBAAoB;AAE7B,SAAS,qBAAqB;AAEvB,IAAM,OAAiB,OAAO,KAAK,SAAS,aAAa;AAC/D,MAAI,IAAI,SAAS,MAAM,GAAG;AACzB,WAAO;AAAA,MACN,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,QAAQ,kBAAkB,KAAK,UAAU,aAAa,cAAc,GAAG,GAAG,OAAO,CAAC,CAAC;AAAA,IACpF;AAAA,EACD;AACA,SAAO,SAAS,KAAK,OAAO;AAC7B;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";// src/register.ts
|
|
2
|
+
var _module = require('module');
|
|
3
|
+
var _url = require('url');
|
|
4
|
+
var isCJS = typeof module !== "undefined" && typeof exports !== "undefined";
|
|
5
|
+
_module.register.call(void 0,
|
|
6
|
+
isCJS ? "./hook.cjs" : "./hook.js",
|
|
7
|
+
_url.pathToFileURL.call(void 0, import.meta.filename)
|
|
8
|
+
);
|
|
9
|
+
//# sourceMappingURL=register.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/sql-loader/dist/register.cjs","../src/register.ts"],"names":[],"mappings":"AAAA;ACAA,gCAAyB;AACzB,0BAA8B;AAE9B,IAAM,MAAA,EAAQ,OAAO,OAAA,IAAW,YAAA,GAAe,OAAO,QAAA,IAAY,WAAA;AAElE,8BAAA;AAAA,EACC,MAAA,EAAQ,aAAA,EAAe,WAAA;AAAA,EACvB,gCAAA,MAAc,CAAA,IAAA,CAAY,QAAQ;AACnC,CAAA","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/sql-loader/dist/register.cjs","sourcesContent":[null,"import { register } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\n\nconst isCJS = typeof module !== \"undefined\" && typeof exports !== \"undefined\";\n\nregister(\n\tisCJS ? \"./hook.cjs\" : \"./hook.js\",\n\tpathToFileURL(import.meta.filename),\n);\n"]}
|
package/dist/register.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/register.ts
|
|
2
|
+
import { register } from "module";
|
|
3
|
+
import { pathToFileURL } from "url";
|
|
4
|
+
var isCJS = typeof module !== "undefined" && typeof exports !== "undefined";
|
|
5
|
+
register(
|
|
6
|
+
isCJS ? "./hook.cjs" : "./hook.js",
|
|
7
|
+
pathToFileURL(import.meta.filename)
|
|
8
|
+
);
|
|
9
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/register.ts"],"sourcesContent":["import { register } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\n\nconst isCJS = typeof module !== \"undefined\" && typeof exports !== \"undefined\";\n\nregister(\n\tisCJS ? \"./hook.cjs\" : \"./hook.js\",\n\tpathToFileURL(import.meta.filename),\n);\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAE9B,IAAM,QAAQ,OAAO,WAAW,eAAe,OAAO,YAAY;AAElE;AAAA,EACC,QAAQ,eAAe;AAAA,EACvB,cAAc,YAAY,QAAQ;AACnC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rivetkit/sql-loader",
|
|
3
|
+
"version": "0.0.0-pr.4600.8dee603",
|
|
4
|
+
"description": "SQL file loader and migration utilities for RivetKit",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./dist/chunk-*.js",
|
|
8
|
+
"./dist/chunk-*.cjs"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"package.json"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"default": "./dist/register.js"
|
|
19
|
+
},
|
|
20
|
+
"require": {
|
|
21
|
+
"default": "./dist/register.cjs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup src/hook.ts src/register.ts",
|
|
27
|
+
"check-types": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^22.10.5",
|
|
31
|
+
"tsup": "^8.5.0"
|
|
32
|
+
}
|
|
33
|
+
}
|