@soda-gql/swc 0.12.6 → 0.13.1
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.
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soda-gql/swc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "SWC-based native transformer for soda-gql",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -61,24 +61,24 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@ampproject/remapping": "^2.3.0",
|
|
64
|
-
"@soda-gql/builder": "0.
|
|
65
|
-
"@soda-gql/common": "0.
|
|
66
|
-
"@soda-gql/config": "0.
|
|
67
|
-
"@soda-gql/core": "0.
|
|
64
|
+
"@soda-gql/builder": "0.13.1",
|
|
65
|
+
"@soda-gql/common": "0.13.1",
|
|
66
|
+
"@soda-gql/config": "0.13.1",
|
|
67
|
+
"@soda-gql/core": "0.13.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@napi-rs/cli": "^2.18.4",
|
|
71
|
-
"@soda-gql/tsc": "0.
|
|
71
|
+
"@soda-gql/tsc": "0.13.1",
|
|
72
72
|
"prettier": "^3.4.2"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@swc/core": "^1.0.0"
|
|
76
76
|
},
|
|
77
77
|
"optionalDependencies": {
|
|
78
|
-
"@soda-gql/swc-linux-x64-gnu": "0.
|
|
79
|
-
"@soda-gql/swc-linux-x64-musl": "0.
|
|
80
|
-
"@soda-gql/swc-darwin-x64": "0.
|
|
81
|
-
"@soda-gql/swc-darwin-arm64": "0.
|
|
82
|
-
"@soda-gql/swc-win32-x64-msvc": "0.
|
|
78
|
+
"@soda-gql/swc-linux-x64-gnu": "0.13.1",
|
|
79
|
+
"@soda-gql/swc-linux-x64-musl": "0.13.1",
|
|
80
|
+
"@soda-gql/swc-darwin-x64": "0.13.1",
|
|
81
|
+
"@soda-gql/swc-darwin-arm64": "0.13.1",
|
|
82
|
+
"@soda-gql/swc-win32-x64-msvc": "0.13.1"
|
|
83
83
|
}
|
|
84
84
|
}
|
|
Binary file
|
package/src/transform/imports.rs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//! Import management module.
|
|
2
2
|
//!
|
|
3
3
|
//! This module handles:
|
|
4
|
-
//! - Adding the `@soda-gql/runtime` import/require
|
|
4
|
+
//! - Adding the `@soda-gql/core/runtime` import/require
|
|
5
5
|
//! - Removing the `graphql-system` imports
|
|
6
6
|
|
|
7
7
|
use swc_core::common::{SyntaxContext, DUMMY_SP};
|
|
8
8
|
use swc_core::ecma::ast::*;
|
|
9
9
|
use swc_core::ecma::visit::{VisitMut, VisitMutWith};
|
|
10
10
|
|
|
11
|
-
const RUNTIME_MODULE: &str = "@soda-gql/runtime";
|
|
11
|
+
const RUNTIME_MODULE: &str = "@soda-gql/core/runtime";
|
|
12
12
|
const RUNTIME_IMPORT_NAME: &str = "gqlRuntime";
|
|
13
13
|
const CJS_RUNTIME_NAME: &str = "__soda_gql_runtime";
|
|
14
14
|
|
|
@@ -39,7 +39,7 @@ impl ImportManager {
|
|
|
39
39
|
|
|
40
40
|
/// Create the ESM runtime import.
|
|
41
41
|
fn create_esm_import(&self) -> ModuleItem {
|
|
42
|
-
// import { gqlRuntime } from "@soda-gql/runtime";
|
|
42
|
+
// import { gqlRuntime } from "@soda-gql/core/runtime";
|
|
43
43
|
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
|
|
44
44
|
span: DUMMY_SP,
|
|
45
45
|
specifiers: vec![ImportSpecifier::Named(ImportNamedSpecifier {
|
|
@@ -61,7 +61,7 @@ impl ImportManager {
|
|
|
61
61
|
|
|
62
62
|
/// Create the CJS runtime require.
|
|
63
63
|
fn create_cjs_require(&self) -> ModuleItem {
|
|
64
|
-
// const __soda_gql_runtime = require("@soda-gql/runtime");
|
|
64
|
+
// const __soda_gql_runtime = require("@soda-gql/core/runtime");
|
|
65
65
|
ModuleItem::Stmt(Stmt::Decl(Decl::Var(Box::new(VarDecl {
|
|
66
66
|
span: DUMMY_SP,
|
|
67
67
|
ctxt: SyntaxContext::empty(),
|
package/src/transformer.test.ts
CHANGED
|
@@ -123,7 +123,7 @@ describe("swc", async () => {
|
|
|
123
123
|
|
|
124
124
|
// Verify runtime import is added when expected
|
|
125
125
|
if (testCase.expectations.shouldAddRuntimeImport) {
|
|
126
|
-
expect(normalized).toContain("@soda-gql/runtime");
|
|
126
|
+
expect(normalized).toContain("@soda-gql/core/runtime");
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
// Verify gql.default import is removed
|
|
@@ -161,7 +161,7 @@ describe("swc", async () => {
|
|
|
161
161
|
// Verify no runtime calls are added
|
|
162
162
|
expect(result).not.toContain("gqlRuntime.");
|
|
163
163
|
// Verify no runtime import is added
|
|
164
|
-
expect(result).not.toContain("@soda-gql/runtime");
|
|
164
|
+
expect(result).not.toContain("@soda-gql/core/runtime");
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
});
|