@suss/packs 0.15.0 → 0.17.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.
- package/dist/activerecord.d.ts +3 -0
- package/dist/activerecord.js +2 -0
- package/dist/apollo-client.js +2 -0
- package/dist/apollo.js +2 -0
- package/dist/aws-dynamodb.js +2 -0
- package/dist/aws-eventbridge.js +2 -0
- package/dist/aws-lambda.js +2 -0
- package/dist/aws-s3.js +2 -0
- package/dist/aws-sqs.js +2 -0
- package/dist/axios.js +2 -0
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/cloudflare-workers.js +2 -0
- package/dist/drizzle.js +2 -0
- package/dist/express.js +2 -0
- package/dist/fastapi.js +2 -0
- package/dist/fastify.js +2 -0
- package/dist/fetch.js +2 -0
- package/dist/flask-restx.js +2 -0
- package/dist/gcs.js +2 -0
- package/dist/graphql-ruby.js +2 -0
- package/dist/hono.js +2 -0
- package/dist/mongoose.js +2 -0
- package/dist/nestjs-graphql.js +2 -0
- package/dist/nestjs-microservices.d.ts +1 -0
- package/dist/nestjs-microservices.js +59 -0
- package/dist/nestjs-rest.js +2 -0
- package/dist/nextjs.js +268558 -0
- package/dist/node.js +2 -0
- package/dist/package-exports.d.ts +1 -0
- package/dist/package-exports.js +37 -0
- package/dist/prisma.js +2 -0
- package/dist/react-query.d.ts +1 -0
- package/dist/react-query.js +143 -0
- package/dist/react-router.js +2 -0
- package/dist/react.js +2 -0
- package/dist/redis.js +2 -0
- package/dist/sqlalchemy.js +2 -0
- package/dist/ts-rest.js +2 -0
- package/package.json +25 -10
package/dist/node.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@suss/framework-package-exports';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "./chunk-3RG5ZIWI.js";
|
|
2
|
+
|
|
3
|
+
// ../framework/package-exports/dist/index.js
|
|
4
|
+
function packageExportsFramework() {
|
|
5
|
+
return {
|
|
6
|
+
name: "package-exports",
|
|
7
|
+
languages: ["typescript"],
|
|
8
|
+
protocol: "in-process",
|
|
9
|
+
discovery: [
|
|
10
|
+
{
|
|
11
|
+
kind: "library",
|
|
12
|
+
match: { type: "packageExports", workspaces: true }
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
kind: "caller",
|
|
16
|
+
match: { type: "packageImport", workspaces: true }
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
terminals: [
|
|
20
|
+
{
|
|
21
|
+
kind: "return",
|
|
22
|
+
match: { type: "returnStatement" },
|
|
23
|
+
extraction: {}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
kind: "throw",
|
|
27
|
+
match: { type: "throwExpression" },
|
|
28
|
+
extraction: {}
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
inputMapping: { type: "allPositional" }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var index_default = packageExportsFramework;
|
|
35
|
+
export {
|
|
36
|
+
index_default as default
|
|
37
|
+
};
|
package/dist/prisma.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@suss/framework-react-query';
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import "./chunk-3RG5ZIWI.js";
|
|
2
|
+
|
|
3
|
+
// ../framework/react-query/dist/index.js
|
|
4
|
+
import { Node } from "ts-morph";
|
|
5
|
+
import { functionCallBinding } from "@suss/behavioral-ir";
|
|
6
|
+
var QUERY_MODULES = ["@tanstack/react-query", "react-query"];
|
|
7
|
+
var HOOK_CALLBACK_PROPERTY = {
|
|
8
|
+
useQuery: "queryFn",
|
|
9
|
+
useSuspenseQuery: "queryFn",
|
|
10
|
+
useInfiniteQuery: "queryFn",
|
|
11
|
+
useSuspenseInfiniteQuery: "queryFn",
|
|
12
|
+
useMutation: "mutationFn"
|
|
13
|
+
};
|
|
14
|
+
function importedHooksOf(sourceFile) {
|
|
15
|
+
const hooks = /* @__PURE__ */ new Map();
|
|
16
|
+
for (const decl of sourceFile.getImportDeclarations()) {
|
|
17
|
+
if (!QUERY_MODULES.includes(decl.getModuleSpecifierValue())) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
for (const named of decl.getNamedImports()) {
|
|
21
|
+
const name = named.getName();
|
|
22
|
+
if (name in HOOK_CALLBACK_PROPERTY) {
|
|
23
|
+
hooks.set(named.getAliasNode()?.getText() ?? name, name);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return hooks;
|
|
28
|
+
}
|
|
29
|
+
function hookOf(call) {
|
|
30
|
+
const callee = call.getExpression();
|
|
31
|
+
if (!Node.isIdentifier(callee)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const local = callee.getText();
|
|
35
|
+
const hook = importedHooksOf(call.getSourceFile()).get(local);
|
|
36
|
+
return hook === void 0 ? null : { local, hook };
|
|
37
|
+
}
|
|
38
|
+
function callbackExpressionOf(call, hook) {
|
|
39
|
+
const property = HOOK_CALLBACK_PROPERTY[hook];
|
|
40
|
+
for (const arg of call.getArguments()) {
|
|
41
|
+
if (Node.isObjectLiteralExpression(arg)) {
|
|
42
|
+
const prop = arg.getProperty(property);
|
|
43
|
+
if (prop !== void 0 && Node.isPropertyAssignment(prop)) {
|
|
44
|
+
return prop.getInitializer() ?? null;
|
|
45
|
+
}
|
|
46
|
+
if (prop !== void 0 && Node.isShorthandPropertyAssignment(prop)) {
|
|
47
|
+
return prop.getNameNode();
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (Node.isArrowFunction(arg) || Node.isFunctionExpression(arg) || Node.isIdentifier(arg)) {
|
|
52
|
+
if (call.getArguments().indexOf(arg) > 0 || hook === "useMutation") {
|
|
53
|
+
return arg;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function callbackRefOf(expression) {
|
|
60
|
+
if (expression === null) {
|
|
61
|
+
return { type: "opaque", reason: "missing-query-function" };
|
|
62
|
+
}
|
|
63
|
+
if (Node.isArrowFunction(expression) || Node.isFunctionExpression(expression)) {
|
|
64
|
+
return { type: "literal" };
|
|
65
|
+
}
|
|
66
|
+
if (Node.isIdentifier(expression)) {
|
|
67
|
+
return { type: "identifier", name: expression.getText() };
|
|
68
|
+
}
|
|
69
|
+
return { type: "opaque", reason: "non-literal-query-function" };
|
|
70
|
+
}
|
|
71
|
+
var queryHookRecognizer = (call, _ctx) => {
|
|
72
|
+
const c = call;
|
|
73
|
+
if (!Node.isCallExpression(c)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const found = hookOf(c);
|
|
77
|
+
if (found === null) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const effect = {
|
|
81
|
+
type: "interaction",
|
|
82
|
+
binding: functionCallBinding({
|
|
83
|
+
transport: "in-process",
|
|
84
|
+
recognition: "react-query"
|
|
85
|
+
}),
|
|
86
|
+
callee: found.local,
|
|
87
|
+
interaction: {
|
|
88
|
+
class: "schedule",
|
|
89
|
+
via: found.local,
|
|
90
|
+
callbackRef: callbackRefOf(callbackExpressionOf(c, found.hook)),
|
|
91
|
+
hasDelay: false
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return [effect];
|
|
95
|
+
};
|
|
96
|
+
function reactQuerySubUnits(parent, _ctx) {
|
|
97
|
+
const parentFunc = parent.func;
|
|
98
|
+
const out = [];
|
|
99
|
+
const counters = /* @__PURE__ */ new Map();
|
|
100
|
+
parentFunc.forEachDescendant((node, traversal) => {
|
|
101
|
+
if (node !== parentFunc && (Node.isFunctionDeclaration(node) || Node.isMethodDeclaration(node))) {
|
|
102
|
+
traversal.skip();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!Node.isCallExpression(node)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const found = hookOf(node);
|
|
109
|
+
if (found === null) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const expression = callbackExpressionOf(node, found.hook);
|
|
113
|
+
if (expression === null || !(Node.isArrowFunction(expression) || Node.isFunctionExpression(expression))) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const idx = counters.get(found.local) ?? 0;
|
|
117
|
+
counters.set(found.local, idx + 1);
|
|
118
|
+
out.push({
|
|
119
|
+
func: expression,
|
|
120
|
+
kind: "scheduled-callback",
|
|
121
|
+
name: `${parent.name}.${found.local}#${idx}`,
|
|
122
|
+
inputMapping: { type: "positionalParams", params: [] }
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
function reactQueryFramework() {
|
|
128
|
+
return {
|
|
129
|
+
name: "react-query",
|
|
130
|
+
languages: ["typescript"],
|
|
131
|
+
protocol: "in-process",
|
|
132
|
+
discovery: [],
|
|
133
|
+
terminals: [],
|
|
134
|
+
inputMapping: { type: "positionalParams", params: [] },
|
|
135
|
+
requiresImport: QUERY_MODULES,
|
|
136
|
+
invocationRecognizers: [queryHookRecognizer],
|
|
137
|
+
subUnits: reactQuerySubUnits
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
var index_default = reactQueryFramework;
|
|
141
|
+
export {
|
|
142
|
+
index_default as default
|
|
143
|
+
};
|
package/dist/react-router.js
CHANGED
package/dist/react.js
CHANGED
package/dist/redis.js
CHANGED
package/dist/sqlalchemy.js
CHANGED
package/dist/ts-rest.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suss/packs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Every pack suss ships, as one package with a subpath per pack.",
|
|
6
6
|
"keywords": [
|
|
@@ -104,6 +104,10 @@
|
|
|
104
104
|
"types": "./dist/nestjs-graphql.d.ts",
|
|
105
105
|
"import": "./dist/nestjs-graphql.js"
|
|
106
106
|
},
|
|
107
|
+
"./nestjs-microservices": {
|
|
108
|
+
"types": "./dist/nestjs-microservices.d.ts",
|
|
109
|
+
"import": "./dist/nestjs-microservices.js"
|
|
110
|
+
},
|
|
107
111
|
"./nestjs-rest": {
|
|
108
112
|
"types": "./dist/nestjs-rest.d.ts",
|
|
109
113
|
"import": "./dist/nestjs-rest.js"
|
|
@@ -116,6 +120,10 @@
|
|
|
116
120
|
"types": "./dist/node.d.ts",
|
|
117
121
|
"import": "./dist/node.js"
|
|
118
122
|
},
|
|
123
|
+
"./package-exports": {
|
|
124
|
+
"types": "./dist/package-exports.d.ts",
|
|
125
|
+
"import": "./dist/package-exports.js"
|
|
126
|
+
},
|
|
119
127
|
"./prisma": {
|
|
120
128
|
"types": "./dist/prisma.d.ts",
|
|
121
129
|
"import": "./dist/prisma.js"
|
|
@@ -124,6 +132,10 @@
|
|
|
124
132
|
"types": "./dist/react.d.ts",
|
|
125
133
|
"import": "./dist/react.js"
|
|
126
134
|
},
|
|
135
|
+
"./react-query": {
|
|
136
|
+
"types": "./dist/react-query.d.ts",
|
|
137
|
+
"import": "./dist/react-query.js"
|
|
138
|
+
},
|
|
127
139
|
"./react-router": {
|
|
128
140
|
"types": "./dist/react-router.d.ts",
|
|
129
141
|
"import": "./dist/react-router.js"
|
|
@@ -157,15 +169,15 @@
|
|
|
157
169
|
"ts-morph": "^23.0.0"
|
|
158
170
|
},
|
|
159
171
|
"dependencies": {
|
|
160
|
-
"@suss/adapter-python": "0.
|
|
161
|
-
"@suss/adapter-ruby": "0.
|
|
162
|
-
"@suss/adapter-typescript": "0.
|
|
163
|
-
"@suss/behavioral-ir": "0.
|
|
164
|
-
"@suss/contract-graphql": "0.
|
|
165
|
-
"@suss/extractor": "0.
|
|
166
|
-
"@suss/manifest-aws": "0.
|
|
167
|
-
"@suss/recognize": "0.
|
|
168
|
-
"@suss/sql": "0.
|
|
172
|
+
"@suss/adapter-python": "0.17.0",
|
|
173
|
+
"@suss/adapter-ruby": "0.17.0",
|
|
174
|
+
"@suss/adapter-typescript": "0.17.0",
|
|
175
|
+
"@suss/behavioral-ir": "0.17.0",
|
|
176
|
+
"@suss/contract-graphql": "0.17.0",
|
|
177
|
+
"@suss/extractor": "0.17.0",
|
|
178
|
+
"@suss/manifest-aws": "0.17.0",
|
|
179
|
+
"@suss/recognize": "0.17.0",
|
|
180
|
+
"@suss/sql": "0.17.0"
|
|
169
181
|
},
|
|
170
182
|
"devDependencies": {
|
|
171
183
|
"@suss/client-apollo": "*",
|
|
@@ -189,10 +201,13 @@
|
|
|
189
201
|
"@suss/framework-hono": "*",
|
|
190
202
|
"@suss/framework-mongoose": "*",
|
|
191
203
|
"@suss/framework-nestjs-graphql": "*",
|
|
204
|
+
"@suss/framework-nestjs-microservices": "*",
|
|
192
205
|
"@suss/framework-nestjs-rest": "*",
|
|
193
206
|
"@suss/framework-nextjs": "*",
|
|
207
|
+
"@suss/framework-package-exports": "*",
|
|
194
208
|
"@suss/framework-prisma": "*",
|
|
195
209
|
"@suss/framework-react": "*",
|
|
210
|
+
"@suss/framework-react-query": "*",
|
|
196
211
|
"@suss/framework-react-router": "*",
|
|
197
212
|
"@suss/framework-redis": "*",
|
|
198
213
|
"@suss/framework-sqlalchemy": "*",
|