Skip to content

Commit b2ad226

Browse files
authored
Update dependencies in compiler-rs (#2878)
1 parent 7f78698 commit b2ad226

File tree

16 files changed

+93524
-93491
lines changed

16 files changed

+93524
-93491
lines changed

Diff for: compiler-rs/Cargo.lock

+181-161
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: compiler-rs/Cargo.toml

+24
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ members = [
77
"compiler-wasm-lib",
88
]
99

10+
[workspace.dependencies]
11+
anyhow = "1"
12+
arcstr = "1"
13+
clap = "4"
14+
console_error_panic_hook = "0.1"
15+
convert_case = "0.6"
16+
derive_more = "1.0.0-beta.6"
17+
either_n = "0.2"
18+
icu_segmenter = "1"
19+
indexmap = "2"
20+
maplit = "1"
21+
once_cell = "1.16"
22+
openapiv3 = "2"
23+
quantiles = "0.7"
24+
serde = "1"
25+
serde_ignored = "0.1"
26+
serde_json = "1"
27+
serde_path_to_error = "0.1"
28+
testresult = "0.4"
29+
tracing = "0.1"
30+
tracing-subscriber = "0.3"
31+
wasm-bindgen = "0.2"
32+
wasm-bindgen-test = "0.3"
33+
1034
[profile.release]
1135
lto = true
1236
# Tell `rustc` to optimize for small code size.

Diff for: compiler-rs/clients_schema/Cargo.toml

+11-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ edition = "2021"
55
publish = false
66

77
[dependencies]
8-
derive_more = { version = "1.0.0-beta.6", features = ["from"] }
9-
serde = { version = "1.0", features=["derive", 'rc']}
10-
serde_json = "1.0"
11-
typed-builder = "0.11"
12-
once_cell = "1.16"
13-
anyhow = "1.0"
14-
indexmap = { version="1.9.3", features = ["serde"] }
8+
derive_more = { workspace = true, features = ["from"] }
9+
serde = { workspace = true, features = ["derive", "rc"] }
10+
serde_json = { workspace = true }
11+
once_cell = { workspace = true }
12+
anyhow = { workspace = true }
13+
indexmap = { workspace = true, features = ["serde"] }
1514

16-
arcstr = { version = "1.1.5", features = ["serde", "substr"] }
17-
clap = { version = "4.5.9", features = ["derive"] }
15+
arcstr = { workspace = true, features = ["serde", "substr"] }
16+
clap = { workspace = true, features = ["derive"] }
1817

1918
[dev-dependencies]
20-
serde_path_to_error = "0.1"
21-
serde_ignored = "0.1"
22-
testresult = "0.3.0"
19+
serde_path_to_error = { workspace = true }
20+
serde_ignored = { workspace = true }
21+
testresult = { workspace = true }

Diff for: compiler-rs/clients_schema/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ use std::fmt::{Debug, Display, Formatter};
2020
use anyhow::anyhow;
2121
use derive_more::From;
2222
use indexmap::IndexMap;
23+
2324
// Re-export crates whose types we expose publicly
24-
pub use once_cell;
25+
pub use ::once_cell;
26+
pub use ::indexmap;
27+
pub use ::anyhow;
2528

2629
// Child modules
2730
pub mod builtins;

Diff for: compiler-rs/clients_schema_to_openapi/Cargo.toml

+9-16
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,14 @@ publish = false
77
[dependencies]
88
clients_schema = {path="../clients_schema"}
99

10-
serde = {version = "1.0", features=["derive"]}
11-
serde_json = "1.0"
12-
serde_path_to_error = "0.1"
13-
serde_ignored = "0.1"
14-
icu_segmenter = "1.5.0"
15-
openapiv3 = "1.0"
16-
anyhow = "1.0"
17-
indexmap = "1.9"
18-
convert_case = "0.6"
19-
either_n = "0.2.0"
20-
maplit = "1.0"
10+
serde_json = { workspace = true }
11+
serde_ignored = { workspace = true }
12+
icu_segmenter = { workspace = true }
13+
openapiv3 = { workspace = true }
14+
anyhow = { workspace = true }
15+
indexmap = { workspace = true }
2116

22-
tracing = "0.1.37"
23-
tracing-subscriber = "0.3.16"
24-
clap = { version = "4.4.2", features = ["derive"] }
17+
tracing = { workspace = true }
18+
tracing-subscriber = { workspace = true }
19+
clap = { workspace = true, features = ["derive"] }
2520

26-
27-
quantiles = "0.7.1"

Diff for: compiler-rs/clients_schema_to_openapi/src/paths.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ pub fn add_endpoint(
208208
responses: responses.clone(),
209209
extensions: Default::default(),
210210
},
211+
callbacks: Default::default(),
211212
deprecated: endpoint.deprecation.is_some(),
212213
security: None,
213214
servers: vec![],
@@ -317,7 +318,7 @@ fn get_path_parameters(template: &str) -> Vec<&str> {
317318

318319
// Splits the original endpoint description into OpenAPI summary and description, where summary
319320
// is the first sentence of the original description with no trailing `.`, and description contains
320-
// the remaining sentences, if there are any left.
321+
// the remaining sentences, if there are any left.
321322
fn split_summary_desc(desc: &str) -> SplitDesc{
322323
let segmenter = SentenceSegmenter::new();
323324

Diff for: compiler-rs/clients_schema_to_openapi/src/schemas.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<'a> TypesAndComponents<'a> {
143143
max_length: None,
144144
})
145145
.into_schema_ref()),
146-
"boolean" => Ok(Type::Boolean {}.into_schema_ref()),
146+
"boolean" => Ok(Type::Boolean(Default::default()).into_schema_ref()),
147147
"number" => Ok(Type::Number(NumberType::default()).into_schema_ref()),
148148
"void" => {
149149
// Empty object

Diff for: compiler-rs/compiler-wasm-lib/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "compiler-wasm-lib"
33
version = "0.1.0"
44
edition = "2021"
55
description = "WASM library to manipulate and convert schema.json files"
6+
publish = false
67

78
[lib]
89
crate-type = ["cdylib", "rlib"]
@@ -11,17 +12,16 @@ crate-type = ["cdylib", "rlib"]
1112
default = ["console_error_panic_hook"]
1213

1314
[dependencies]
14-
wasm-bindgen = "0.2.87"
15+
wasm-bindgen = { workspace = true }
1516
clients_schema = {path="../clients_schema"}
1617
clients_schema_to_openapi = {path="../clients_schema_to_openapi"}
17-
serde_json = "1.0.107"
18-
anyhow = "1.0.75"
18+
serde_json = { workspace = true }
19+
anyhow = { workspace = true }
1920

20-
console_error_panic_hook = { version = "0.1.7", optional = true }
21-
web-sys = { version = "0.3.64", features = ["console"] }
21+
console_error_panic_hook = { workspace = true, optional = true }
2222

2323
[dev-dependencies]
24-
wasm-bindgen-test = "0.3.37"
24+
wasm-bindgen-test = { workspace = true }
2525

2626
[package.metadata.wasm-pack.profile.release]
2727
opt-level = 'z'

Diff for: compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
let imports = {};
23
imports['__wbindgen_placeholder__'] = module.exports;
34
let wasm;
@@ -7,18 +8,18 @@ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true
78

89
cachedTextDecoder.decode();
910

10-
let cachedUint8Memory0 = null;
11+
let cachedUint8ArrayMemory0 = null;
1112

12-
function getUint8Memory0() {
13-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
14-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
13+
function getUint8ArrayMemory0() {
14+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1516
}
16-
return cachedUint8Memory0;
17+
return cachedUint8ArrayMemory0;
1718
}
1819

1920
function getStringFromWasm0(ptr, len) {
2021
ptr = ptr >>> 0;
21-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
22+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2223
}
2324

2425
const heap = new Array(128).fill(undefined);
@@ -72,15 +73,15 @@ function passStringToWasm0(arg, malloc, realloc) {
7273
if (realloc === undefined) {
7374
const buf = cachedTextEncoder.encode(arg);
7475
const ptr = malloc(buf.length, 1) >>> 0;
75-
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
76+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
7677
WASM_VECTOR_LEN = buf.length;
7778
return ptr;
7879
}
7980

8081
let len = arg.length;
8182
let ptr = malloc(len, 1) >>> 0;
8283

83-
const mem = getUint8Memory0();
84+
const mem = getUint8ArrayMemory0();
8485

8586
let offset = 0;
8687

@@ -95,7 +96,7 @@ function passStringToWasm0(arg, malloc, realloc) {
9596
arg = arg.slice(offset);
9697
}
9798
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
98-
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
99+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
99100
const ret = encodeString(arg, view);
100101

101102
offset += ret.written;
@@ -106,13 +107,13 @@ function passStringToWasm0(arg, malloc, realloc) {
106107
return ptr;
107108
}
108109

109-
let cachedInt32Memory0 = null;
110+
let cachedDataViewMemory0 = null;
110111

111-
function getInt32Memory0() {
112-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
113-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
112+
function getDataViewMemory0() {
113+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
114+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
114115
}
115-
return cachedInt32Memory0;
116+
return cachedDataViewMemory0;
116117
}
117118
/**
118119
* @param {string} json
@@ -129,10 +130,10 @@ module.exports.convert_schema_to_openapi = function(json, flavor) {
129130
const ptr1 = passStringToWasm0(flavor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
130131
const len1 = WASM_VECTOR_LEN;
131132
wasm.convert_schema_to_openapi(retptr, ptr0, len0, ptr1, len1);
132-
var r0 = getInt32Memory0()[retptr / 4 + 0];
133-
var r1 = getInt32Memory0()[retptr / 4 + 1];
134-
var r2 = getInt32Memory0()[retptr / 4 + 2];
135-
var r3 = getInt32Memory0()[retptr / 4 + 3];
133+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
134+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
135+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
136+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
136137
var ptr3 = r0;
137138
var len3 = r1;
138139
if (r3) {
@@ -162,8 +163,8 @@ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
162163
const ret = getObject(arg1).stack;
163164
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
164165
const len1 = WASM_VECTOR_LEN;
165-
getInt32Memory0()[arg0 / 4 + 1] = len1;
166-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
166+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
167+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
167168
};
168169

169170
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
8.3 KB
Binary file not shown.

Diff for: compiler-rs/compiler-wasm-lib/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ use clients_schema::{Availabilities, Visibility};
2020
use wasm_bindgen::prelude::*;
2121
use clients_schema::transform::ExpandConfig;
2222

23-
#[cfg(all(not(target_arch = "wasm32"), not(feature = "cargo-clippy")))]
24-
compile_error!("To build this crate use `make compiler-wasm-lib`");
25-
2623
#[wasm_bindgen]
2724
pub fn convert_schema_to_openapi(json: &str, flavor: &str) -> Result<String, String> {
2825
set_panic_hook();

Diff for: compiler-rs/openapi_to_clients_schema/Cargo.toml

+8-11
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ publish = false
99
[dependencies]
1010
clients_schema = {path="../clients_schema"}
1111

12-
serde = {version = "1.0", features=["derive"]}
13-
serde_json = "1.0"
14-
serde_path_to_error = "0.1"
15-
serde_ignored = "0.1"
16-
openapiv3 = "1.0"
17-
anyhow = "1.0"
18-
indexmap = "1.9"
19-
convert_case = "0.6"
20-
either_n = "0.2.0"
12+
serde_json = { workspace = true }
13+
serde_ignored = { workspace = true }
14+
openapiv3 = { workspace = true }
15+
anyhow = { workspace = true }
16+
indexmap = { workspace = true }
17+
convert_case = { workspace = true }
2118

22-
tracing = "0.1.37"
23-
tracing-subscriber = "0.3.16"
19+
tracing = { workspace = true }
20+
tracing-subscriber = { workspace = true }
2421

2522
# Some json schema implementations
2623
#boon = "0.3.1"

Diff for: compiler-rs/openapi_to_clients_schema/src/openapi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ pub fn any_to_schema(any: AnySchema) -> anyhow::Result<SchemaKind> {
326326
enumeration: vec![], // TODO: not supported in schema.json
327327
}))),
328328

329-
"boolean" => Ok(SchemaKind::Type(Type::Boolean {})),
329+
"boolean" => Ok(SchemaKind::Type(Type::Boolean(Default::default()))),
330330

331331
"array" => Ok(SchemaKind::Type(Type::Array(ArrayType {
332332
items: any.items,

Diff for: compiler-rs/openapi_to_clients_schema/src/types.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ fn generate_schema_kind_type(
225225
String(_) => types.add(id, alias(base, builtins::STRING.clone())),
226226

227227
//---------------------------------------------------------------------
228-
Boolean {} => types.add(id, alias(base, builtins::BOOLEAN.clone())),
228+
Boolean(_) => types.add(id, alias(base, builtins::BOOLEAN.clone())),
229229

230230
//---------------------------------------------------------------------
231231
Integer(_) =>
@@ -323,7 +323,7 @@ fn generate_schema_kind_one_of(
323323
let mut variants: Option<TypeAliasVariants> = None;
324324

325325
// TODO: do we want to allow untagged unions (those that are disambiguated by inspecting property names)?
326-
326+
327327
if let Some(discriminator) = discriminator {
328328
variants = Some(TypeAliasVariants::InternalTag(InternalTag {
329329
default_tag: None,
@@ -406,8 +406,6 @@ fn generate_interface_def(
406406
description: None,
407407
aliases: Vec::default(),
408408
deprecation: None,
409-
stability: None,
410-
since: None,
411409
container_property: false,
412410
es_quirk: None,
413411
server_default: None,

0 commit comments

Comments
 (0)