@mearie/vite 0.1.0 → 0.1.2
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/index.cjs +25 -23
- package/dist/index.d.cts +0 -1
- package/dist/{index.d.ts → index.d.mts} +0 -1
- package/package.json +6 -6
- /package/dist/{index.js → index.mjs} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,12 +7,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
21
|
return to;
|
|
17
22
|
};
|
|
@@ -24,11 +29,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
29
|
let node_path = require("node:path");
|
|
25
30
|
node_path = __toESM(node_path);
|
|
26
31
|
let node_fs_promises = require("node:fs/promises");
|
|
27
|
-
|
|
28
|
-
let
|
|
29
|
-
__mearie_config = __toESM(__mearie_config);
|
|
30
|
-
let __mearie_codegen = require("@mearie/codegen");
|
|
31
|
-
__mearie_codegen = __toESM(__mearie_codegen);
|
|
32
|
+
let _mearie_config = require("@mearie/config");
|
|
33
|
+
let _mearie_codegen = require("@mearie/codegen");
|
|
32
34
|
|
|
33
35
|
//#region src/plugin.ts
|
|
34
36
|
const VIRTUAL_MODULE_ID = "$mearie";
|
|
@@ -45,17 +47,17 @@ const mearie = (options = {}) => {
|
|
|
45
47
|
let generateTimer = null;
|
|
46
48
|
const ensureInitialized = async () => {
|
|
47
49
|
if (context) return;
|
|
48
|
-
const { config, cwd } = await (0,
|
|
50
|
+
const { config, cwd } = await (0, _mearie_config.loadConfig)({ filename: options.config });
|
|
49
51
|
projectRoot = cwd;
|
|
50
|
-
mearieConfig = (0,
|
|
52
|
+
mearieConfig = (0, _mearie_config.mergeConfig)(config, options);
|
|
51
53
|
const { schema, document, exclude, scalars } = mearieConfig;
|
|
52
|
-
context = new
|
|
54
|
+
context = new _mearie_codegen.CodegenContext(projectRoot);
|
|
53
55
|
context.setConfig({ scalars });
|
|
54
|
-
const schemaFiles = await (0,
|
|
56
|
+
const schemaFiles = await (0, _mearie_codegen.findFiles)(projectRoot, {
|
|
55
57
|
include: schema,
|
|
56
58
|
exclude
|
|
57
59
|
});
|
|
58
|
-
const documentFiles = await (0,
|
|
60
|
+
const documentFiles = await (0, _mearie_codegen.findFiles)(projectRoot, {
|
|
59
61
|
include: document,
|
|
60
62
|
exclude
|
|
61
63
|
});
|
|
@@ -71,7 +73,7 @@ const mearie = (options = {}) => {
|
|
|
71
73
|
const virtualModule = server.moduleGraph.getModuleById(RESOLVED_VIRTUAL_MODULE_ID);
|
|
72
74
|
if (virtualModule) await server.reloadModule(virtualModule);
|
|
73
75
|
} catch (error) {
|
|
74
|
-
(0,
|
|
76
|
+
(0, _mearie_codegen.report)(_mearie_codegen.logger, error);
|
|
75
77
|
}
|
|
76
78
|
})();
|
|
77
79
|
}, 100);
|
|
@@ -84,14 +86,14 @@ const mearie = (options = {}) => {
|
|
|
84
86
|
await ensureInitialized();
|
|
85
87
|
await context?.generate();
|
|
86
88
|
} catch (error) {
|
|
87
|
-
(0,
|
|
89
|
+
(0, _mearie_codegen.report)(_mearie_codegen.logger, error);
|
|
88
90
|
if (config.command === "build") throw error;
|
|
89
91
|
}
|
|
90
92
|
},
|
|
91
93
|
async configureServer(server) {
|
|
92
94
|
await ensureInitialized();
|
|
93
95
|
const { schema, exclude } = mearieConfig;
|
|
94
|
-
const schemaFiles = await (0,
|
|
96
|
+
const schemaFiles = await (0, _mearie_codegen.findFiles)(projectRoot, {
|
|
95
97
|
include: schema,
|
|
96
98
|
exclude
|
|
97
99
|
});
|
|
@@ -101,11 +103,11 @@ const mearie = (options = {}) => {
|
|
|
101
103
|
await ensureInitialized();
|
|
102
104
|
const { schema, document, exclude } = mearieConfig;
|
|
103
105
|
const relativePath = node_path.default.relative(projectRoot, file);
|
|
104
|
-
const schemaMatcher = (0,
|
|
106
|
+
const schemaMatcher = (0, _mearie_codegen.createMatcher)({
|
|
105
107
|
include: schema,
|
|
106
108
|
exclude
|
|
107
109
|
});
|
|
108
|
-
const documentMatcher = (0,
|
|
110
|
+
const documentMatcher = (0, _mearie_codegen.createMatcher)({
|
|
109
111
|
include: document,
|
|
110
112
|
exclude
|
|
111
113
|
});
|
|
@@ -122,7 +124,7 @@ const mearie = (options = {}) => {
|
|
|
122
124
|
}
|
|
123
125
|
scheduleGenerate(server);
|
|
124
126
|
} catch (error) {
|
|
125
|
-
(0,
|
|
127
|
+
(0, _mearie_codegen.report)(_mearie_codegen.logger, error);
|
|
126
128
|
}
|
|
127
129
|
},
|
|
128
130
|
resolveId(id) {
|
package/dist/index.d.cts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearie/vite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Type-safe, zero-overhead GraphQL client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"README.md"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@mearie/
|
|
44
|
-
"@mearie/
|
|
43
|
+
"@mearie/codegen": "0.1.2",
|
|
44
|
+
"@mearie/config": "0.1.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"tsdown": "^0.
|
|
48
|
-
"tsx": "^4.
|
|
47
|
+
"tsdown": "^0.20.3",
|
|
48
|
+
"tsx": "^4.21.0",
|
|
49
49
|
"typescript": "^5.9.3",
|
|
50
|
-
"vite": "^7.1
|
|
50
|
+
"vite": "^7.3.1"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"bun": ">=1.2.0",
|
|
File without changes
|