@mearie/cli 0.1.0 → 0.1.3
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/cli.cjs +12 -38
- package/package.json +17 -12
- /package/dist/{cli.d.ts → cli.d.mts} +0 -0
- /package/dist/{cli.js → cli.mjs} +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//#region rolldown:runtime
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
2
|
let citty = require("citty");
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
__mearie_config = __toESM(__mearie_config);
|
|
29
|
-
let __mearie_codegen = require("@mearie/codegen");
|
|
30
|
-
__mearie_codegen = __toESM(__mearie_codegen);
|
|
3
|
+
let _mearie_config = require("@mearie/config");
|
|
4
|
+
let _mearie_codegen = require("@mearie/codegen");
|
|
31
5
|
|
|
32
6
|
//#region src/cli.ts
|
|
33
7
|
(0, citty.runMain)((0, citty.defineCommand)({
|
|
@@ -47,27 +21,27 @@ __mearie_codegen = __toESM(__mearie_codegen);
|
|
|
47
21
|
} },
|
|
48
22
|
async run({ args }) {
|
|
49
23
|
try {
|
|
50
|
-
const { config, cwd } = await (0,
|
|
24
|
+
const { config, cwd } = await (0, _mearie_config.loadConfig)({ filename: args.config });
|
|
51
25
|
const { schema, document, exclude, scalars } = config;
|
|
52
|
-
const context = new
|
|
26
|
+
const context = new _mearie_codegen.CodegenContext(cwd);
|
|
53
27
|
context.setConfig({ scalars });
|
|
54
|
-
|
|
55
|
-
const schemaFiles = await (0,
|
|
28
|
+
_mearie_codegen.logger.info("Finding schema and document files...");
|
|
29
|
+
const schemaFiles = await (0, _mearie_codegen.findFiles)(cwd, {
|
|
56
30
|
include: schema,
|
|
57
31
|
exclude
|
|
58
32
|
});
|
|
59
|
-
const documentFiles = await (0,
|
|
33
|
+
const documentFiles = await (0, _mearie_codegen.findFiles)(cwd, {
|
|
60
34
|
include: document,
|
|
61
35
|
exclude
|
|
62
36
|
});
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
_mearie_codegen.logger.info(`Found ${schemaFiles.length} schema file(s)`);
|
|
38
|
+
_mearie_codegen.logger.info(`Found ${documentFiles.length} document file(s)`);
|
|
65
39
|
await Promise.all([...schemaFiles.map((file) => context.addSchema(file)), ...documentFiles.map((file) => context.addDocument(file))]);
|
|
66
|
-
|
|
40
|
+
_mearie_codegen.logger.info("Generating code...");
|
|
67
41
|
await context.generate();
|
|
68
|
-
|
|
42
|
+
_mearie_codegen.logger.info("✓ Code generation complete!");
|
|
69
43
|
} catch (error) {
|
|
70
|
-
(0,
|
|
44
|
+
(0, _mearie_codegen.report)(_mearie_codegen.logger, error);
|
|
71
45
|
process.exit(1);
|
|
72
46
|
}
|
|
73
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearie/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Type-safe, zero-overhead GraphQL client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -28,14 +28,19 @@
|
|
|
28
28
|
"type": "module",
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/cli.d.mts",
|
|
33
|
+
"default": "./dist/cli.mjs"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/cli.d.cts",
|
|
37
|
+
"default": "./dist/cli.cjs"
|
|
38
|
+
}
|
|
34
39
|
},
|
|
35
40
|
"./package.json": "./package.json"
|
|
36
41
|
},
|
|
37
42
|
"bin": {
|
|
38
|
-
"mearie": "./dist/cli.
|
|
43
|
+
"mearie": "./dist/cli.mjs"
|
|
39
44
|
},
|
|
40
45
|
"files": [
|
|
41
46
|
"dist",
|
|
@@ -43,13 +48,13 @@
|
|
|
43
48
|
"README.md"
|
|
44
49
|
],
|
|
45
50
|
"dependencies": {
|
|
46
|
-
"citty": "^0.1
|
|
47
|
-
"@mearie/codegen": "0.1.
|
|
48
|
-
"@mearie/config": "0.1.
|
|
51
|
+
"citty": "^0.2.1",
|
|
52
|
+
"@mearie/codegen": "0.1.3",
|
|
53
|
+
"@mearie/config": "0.1.1"
|
|
49
54
|
},
|
|
50
55
|
"devDependencies": {
|
|
51
|
-
"@types/node": "^
|
|
52
|
-
"tsdown": "^0.
|
|
56
|
+
"@types/node": "^25.3.0",
|
|
57
|
+
"tsdown": "^0.20.3",
|
|
53
58
|
"typescript": "^5.9.3"
|
|
54
59
|
},
|
|
55
60
|
"engines": {
|
|
@@ -65,6 +70,6 @@
|
|
|
65
70
|
"typecheck": "tsc"
|
|
66
71
|
},
|
|
67
72
|
"main": "./dist/cli.cjs",
|
|
68
|
-
"module": "./dist/cli.
|
|
69
|
-
"types": "./dist/cli.d.
|
|
73
|
+
"module": "./dist/cli.mjs",
|
|
74
|
+
"types": "./dist/cli.d.mts"
|
|
70
75
|
}
|
|
File without changes
|
/package/dist/{cli.js → cli.mjs}
RENAMED
|
File without changes
|