mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
Rename crate_ops to extensions (#10431)
This commit is contained in:
parent
abaec7a88e
commit
684c357136
97 changed files with 55 additions and 55 deletions
16
Cargo.toml
16
Cargo.toml
|
@ -8,14 +8,14 @@ members = [
|
||||||
"serde_v8",
|
"serde_v8",
|
||||||
"test_plugin",
|
"test_plugin",
|
||||||
"test_util",
|
"test_util",
|
||||||
"op_crates/crypto",
|
"extensions/crypto",
|
||||||
"op_crates/fetch",
|
"extensions/fetch",
|
||||||
"op_crates/timers",
|
"extensions/timers",
|
||||||
"op_crates/url",
|
"extensions/url",
|
||||||
"op_crates/web",
|
"extensions/web",
|
||||||
"op_crates/webgpu",
|
"extensions/webgpu",
|
||||||
"op_crates/webidl",
|
"extensions/webidl",
|
||||||
"op_crates/websocket",
|
"extensions/websocket",
|
||||||
]
|
]
|
||||||
exclude = [
|
exclude = [
|
||||||
"std/hash/_wasm"
|
"std/hash/_wasm"
|
||||||
|
|
4
cli/dts/lib.deno.window.d.ts
vendored
4
cli/dts/lib.deno.window.d.ts
vendored
|
@ -62,7 +62,7 @@ declare function confirm(message?: string): boolean;
|
||||||
*/
|
*/
|
||||||
declare function prompt(message?: string, defaultValue?: string): string | null;
|
declare function prompt(message?: string, defaultValue?: string): string | null;
|
||||||
|
|
||||||
// TODO(nayeemrmn): Move this to `op_crates/web` where its implementation is.
|
// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is.
|
||||||
// The types there must first be split into window, worker and global types.
|
// The types there must first be split into window, worker and global types.
|
||||||
/** The location (URL) of the object it is linked to. Changes done on it are
|
/** The location (URL) of the object it is linked to. Changes done on it are
|
||||||
* reflected on the object it relates to. Accessible via
|
* reflected on the object it relates to. Accessible via
|
||||||
|
@ -130,6 +130,6 @@ declare class Location {
|
||||||
replace(url: string): void;
|
replace(url: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(nayeemrmn): Move this to `op_crates/web` where its implementation is.
|
// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is.
|
||||||
// The types there must first be split into window, worker and global types.
|
// The types there must first be split into window, worker and global types.
|
||||||
declare var location: Location;
|
declare var location: Location;
|
||||||
|
|
4
cli/dts/lib.deno.worker.d.ts
vendored
4
cli/dts/lib.deno.worker.d.ts
vendored
|
@ -71,7 +71,7 @@ declare var close: () => void;
|
||||||
declare var name: string;
|
declare var name: string;
|
||||||
declare var postMessage: (message: any) => void;
|
declare var postMessage: (message: any) => void;
|
||||||
|
|
||||||
// TODO(nayeemrmn): Move this to `op_crates/web` where its implementation is.
|
// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is.
|
||||||
// The types there must first be split into window, worker and global types.
|
// The types there must first be split into window, worker and global types.
|
||||||
/** The absolute location of the script executed by the Worker. Such an object
|
/** The absolute location of the script executed by the Worker. Such an object
|
||||||
* is initialized for each worker and is available via the
|
* is initialized for each worker and is available via the
|
||||||
|
@ -90,6 +90,6 @@ declare class WorkerLocation {
|
||||||
readonly search: string;
|
readonly search: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(nayeemrmn): Move this to `op_crates/web` where its implementation is.
|
// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is.
|
||||||
// The types there must first be split into window, worker and global types.
|
// The types there must first be split into window, worker and global types.
|
||||||
declare var location: WorkerLocation;
|
declare var location: WorkerLocation;
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
new Event();
|
new Event();
|
||||||
^
|
^
|
||||||
at [WILDCARD]
|
at [WILDCARD]
|
||||||
at new Event (deno:op_crates/web/[WILDCARD])
|
at new Event (deno:extensions/web/[WILDCARD])
|
||||||
at [WILDCARD]
|
at [WILDCARD]
|
|
@ -3109,9 +3109,9 @@ console.log("finish");
|
||||||
output: "error_008_checkjs.js.out",
|
output: "error_008_checkjs.js.out",
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(error_009_op_crates_error {
|
itest!(error_009_extensions_error {
|
||||||
args: "run error_009_op_crates_error.js",
|
args: "run error_009_extensions_error.js",
|
||||||
output: "error_009_op_crates_error.js.out",
|
output: "error_009_extensions_error.js.out",
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ unitTest(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// Test that ops from op_crates have metrics (via OpMiddleware)
|
// Test that ops from extensions have metrics (via OpMiddleware)
|
||||||
unitTest(function metricsForOpCrates(): void {
|
unitTest(function metricsForOpCrates(): void {
|
||||||
const _ = new URL("https://deno.land");
|
const _ = new URL("https://deno.land");
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ impl ExtensionBuilder {
|
||||||
/// Example:
|
/// Example:
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// include_js_files!(
|
/// include_js_files!(
|
||||||
/// prefix "deno:op_crates/hello",
|
/// prefix "deno:extensions/hello",
|
||||||
/// "01_hello.js",
|
/// "01_hello.js",
|
||||||
/// "02_goodbye.js",
|
/// "02_goodbye.js",
|
||||||
/// )
|
/// )
|
||||||
|
|
|
@ -905,8 +905,8 @@
|
||||||
if (customInspect in value && typeof value[customInspect] === "function") {
|
if (customInspect in value && typeof value[customInspect] === "function") {
|
||||||
return String(value[customInspect]());
|
return String(value[customInspect]());
|
||||||
}
|
}
|
||||||
// This non-unique symbol is used to support op_crates, ie.
|
// This non-unique symbol is used to support extensions, ie.
|
||||||
// in op_crates/web we don't want to depend on unique "Deno.customInspect"
|
// in extensions/web we don't want to depend on unique "Deno.customInspect"
|
||||||
// symbol defined in the public API. Internal only, shouldn't be used
|
// symbol defined in the public API. Internal only, shouldn't be used
|
||||||
// by users.
|
// by users.
|
||||||
const nonUniqueCustomInspect = Symbol.for("Deno.customInspect");
|
const nonUniqueCustomInspect = Symbol.for("Deno.customInspect");
|
||||||
|
@ -915,7 +915,7 @@
|
||||||
typeof value[nonUniqueCustomInspect] === "function"
|
typeof value[nonUniqueCustomInspect] === "function"
|
||||||
) {
|
) {
|
||||||
// TODO(nayeemrmn): `inspect` is passed as an argument because custom
|
// TODO(nayeemrmn): `inspect` is passed as an argument because custom
|
||||||
// inspect implementations in `op_crates` need it, but may not have access
|
// inspect implementations in `extensions` need it, but may not have access
|
||||||
// to the `Deno` namespace in web workers. Remove when the `Deno`
|
// to the `Deno` namespace in web workers. Remove when the `Deno`
|
||||||
// namespace is always enabled.
|
// namespace is always enabled.
|
||||||
return String(value[nonUniqueCustomInspect](inspect));
|
return String(value[nonUniqueCustomInspect](inspect));
|
|
@ -7,7 +7,7 @@ use std::path::PathBuf;
|
||||||
pub fn init() -> Extension {
|
pub fn init() -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/console",
|
prefix "deno:extensions/console",
|
||||||
"01_colors.js",
|
"01_colors.js",
|
||||||
"02_console.js",
|
"02_console.js",
|
||||||
))
|
))
|
|
@ -18,7 +18,7 @@ pub use rand; // Re-export rand
|
||||||
pub fn init(maybe_seed: Option<u64>) -> Extension {
|
pub fn init(maybe_seed: Option<u64>) -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/crypto",
|
prefix "deno:extensions/crypto",
|
||||||
"01_crypto.js",
|
"01_crypto.js",
|
||||||
))
|
))
|
||||||
.ops(vec![(
|
.ops(vec![(
|
|
@ -58,7 +58,7 @@ pub fn init<P: FetchPermissions + 'static>(
|
||||||
) -> Extension {
|
) -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/fetch",
|
prefix "deno:extensions/fetch",
|
||||||
"01_fetch_util.js",
|
"01_fetch_util.js",
|
||||||
"11_streams.js",
|
"11_streams.js",
|
||||||
"20_headers.js",
|
"20_headers.js",
|
|
@ -90,7 +90,7 @@ pub fn init(
|
||||||
) -> Extension {
|
) -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/file",
|
prefix "deno:extensions/file",
|
||||||
"01_file.js",
|
"01_file.js",
|
||||||
"02_filereader.js",
|
"02_filereader.js",
|
||||||
"03_blob_url.js",
|
"03_blob_url.js",
|
|
@ -4,7 +4,7 @@
|
||||||
((window) => {
|
((window) => {
|
||||||
const core = window.Deno.core;
|
const core = window.Deno.core;
|
||||||
|
|
||||||
// Shamelessly cribbed from op_crates/fetch/11_streams.js
|
// Shamelessly cribbed from extensions/fetch/11_streams.js
|
||||||
class AssertionError extends Error {
|
class AssertionError extends Error {
|
||||||
constructor(msg) {
|
constructor(msg) {
|
||||||
super(msg);
|
super(msg);
|
|
@ -44,7 +44,7 @@ impl TimersPermission for NoTimersPermission {
|
||||||
pub fn init<P: TimersPermission + 'static>() -> Extension {
|
pub fn init<P: TimersPermission + 'static>() -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/timers",
|
prefix "deno:extensions/timers",
|
||||||
"01_timers.js",
|
"01_timers.js",
|
||||||
))
|
))
|
||||||
.ops(vec![
|
.ops(vec![
|
|
@ -19,7 +19,7 @@ use std::path::PathBuf;
|
||||||
pub fn init() -> Extension {
|
pub fn init() -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/url",
|
prefix "deno:extensions/url",
|
||||||
"00_url.js",
|
"00_url.js",
|
||||||
))
|
))
|
||||||
.ops(vec![
|
.ops(vec![
|
|
@ -8,7 +8,7 @@ use std::path::PathBuf;
|
||||||
pub fn init() -> Extension {
|
pub fn init() -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/web",
|
prefix "deno:extensions/web",
|
||||||
"00_infra.js",
|
"00_infra.js",
|
||||||
"01_dom_exception.js",
|
"01_dom_exception.js",
|
||||||
"01_mimesniff.js",
|
"01_mimesniff.js",
|
|
@ -97,7 +97,7 @@ impl Resource for WebGpuQuerySet {
|
||||||
pub fn init(unstable: bool) -> Extension {
|
pub fn init(unstable: bool) -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/webgpu",
|
prefix "deno:extensions/webgpu",
|
||||||
"01_webgpu.js",
|
"01_webgpu.js",
|
||||||
"02_idl_types.js",
|
"02_idl_types.js",
|
||||||
))
|
))
|
|
@ -7,7 +7,7 @@ use deno_core::Extension;
|
||||||
pub fn init() -> Extension {
|
pub fn init() -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/webidl",
|
prefix "deno:extensions/webidl",
|
||||||
"00_webidl.js",
|
"00_webidl.js",
|
||||||
))
|
))
|
||||||
.build()
|
.build()
|
|
@ -339,7 +339,7 @@ pub fn init<P: WebSocketPermissions + 'static>(
|
||||||
) -> Extension {
|
) -> Extension {
|
||||||
Extension::builder()
|
Extension::builder()
|
||||||
.js(include_js_files!(
|
.js(include_js_files!(
|
||||||
prefix "deno:op_crates/websocket",
|
prefix "deno:extensions/websocket",
|
||||||
"01_websocket.js",
|
"01_websocket.js",
|
||||||
))
|
))
|
||||||
.ops(vec![
|
.ops(vec![
|
|
@ -18,34 +18,34 @@ name = "hello_runtime"
|
||||||
path = "examples/hello_runtime.rs"
|
path = "examples/hello_runtime.rs"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
deno_console = { path = "../op_crates/console", version = "0.5.0" }
|
deno_console = { path = "../extensions/console", version = "0.5.0" }
|
||||||
deno_core = { path = "../core", version = "0.86.0" }
|
deno_core = { path = "../core", version = "0.86.0" }
|
||||||
deno_crypto = { path = "../op_crates/crypto", version = "0.19.0" }
|
deno_crypto = { path = "../extensions/crypto", version = "0.19.0" }
|
||||||
deno_fetch = { path = "../op_crates/fetch", version = "0.27.0" }
|
deno_fetch = { path = "../extensions/fetch", version = "0.27.0" }
|
||||||
deno_file = { path = "../op_crates/file", version = "0.4.0" }
|
deno_file = { path = "../extensions/file", version = "0.4.0" }
|
||||||
deno_timers = { path = "../op_crates/timers", version = "0.3.0" }
|
deno_timers = { path = "../extensions/timers", version = "0.3.0" }
|
||||||
deno_url = { path = "../op_crates/url", version = "0.5.0" }
|
deno_url = { path = "../extensions/url", version = "0.5.0" }
|
||||||
deno_web = { path = "../op_crates/web", version = "0.35.0" }
|
deno_web = { path = "../extensions/web", version = "0.35.0" }
|
||||||
deno_webgpu = { path = "../op_crates/webgpu", version = "0.6.0" }
|
deno_webgpu = { path = "../extensions/webgpu", version = "0.6.0" }
|
||||||
deno_webidl = { path = "../op_crates/webidl", version = "0.5.0" }
|
deno_webidl = { path = "../extensions/webidl", version = "0.5.0" }
|
||||||
deno_websocket = { path = "../op_crates/websocket", version = "0.10.0" }
|
deno_websocket = { path = "../extensions/websocket", version = "0.10.0" }
|
||||||
|
|
||||||
[target.'cfg(windows)'.build-dependencies]
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
winres = "0.1.11"
|
winres = "0.1.11"
|
||||||
winapi = "0.3.9"
|
winapi = "0.3.9"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
deno_console = { path = "../op_crates/console", version = "0.5.0" }
|
deno_console = { path = "../extensions/console", version = "0.5.0" }
|
||||||
deno_core = { path = "../core", version = "0.86.0" }
|
deno_core = { path = "../core", version = "0.86.0" }
|
||||||
deno_crypto = { path = "../op_crates/crypto", version = "0.19.0" }
|
deno_crypto = { path = "../extensions/crypto", version = "0.19.0" }
|
||||||
deno_fetch = { path = "../op_crates/fetch", version = "0.27.0" }
|
deno_fetch = { path = "../extensions/fetch", version = "0.27.0" }
|
||||||
deno_file = { path = "../op_crates/file", version = "0.4.0" }
|
deno_file = { path = "../extensions/file", version = "0.4.0" }
|
||||||
deno_timers = { path = "../op_crates/timers", version = "0.3.0" }
|
deno_timers = { path = "../extensions/timers", version = "0.3.0" }
|
||||||
deno_url = { path = "../op_crates/url", version = "0.5.0" }
|
deno_url = { path = "../extensions/url", version = "0.5.0" }
|
||||||
deno_web = { path = "../op_crates/web", version = "0.35.0" }
|
deno_web = { path = "../extensions/web", version = "0.35.0" }
|
||||||
deno_webgpu = { path = "../op_crates/webgpu", version = "0.6.0" }
|
deno_webgpu = { path = "../extensions/webgpu", version = "0.6.0" }
|
||||||
deno_webidl = { path = "../op_crates/webidl", version = "0.5.0" }
|
deno_webidl = { path = "../extensions/webidl", version = "0.5.0" }
|
||||||
deno_websocket = { path = "../op_crates/websocket", version = "0.10.0" }
|
deno_websocket = { path = "../extensions/websocket", version = "0.10.0" }
|
||||||
|
|
||||||
atty = "0.2.14"
|
atty = "0.2.14"
|
||||||
bytes = "1"
|
bytes = "1"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
release from) should be frozen and no commits should land until the release is
|
release from) should be frozen and no commits should land until the release is
|
||||||
cut.**
|
cut.**
|
||||||
|
|
||||||
1. Create a PR that bumps versions of all crates in `op_crates` and `runtime`
|
1. Create a PR that bumps versions of all crates in `extensions` and `runtime`
|
||||||
directories.
|
directories.
|
||||||
|
|
||||||
To determine if you should bump a crate a minor version instead of a patch
|
To determine if you should bump a crate a minor version instead of a patch
|
||||||
|
@ -32,9 +32,9 @@ between the crates, it must be done in specific order:
|
||||||
|
|
||||||
- `deno_core` - all crates depend on `deno_core` so it must always be published
|
- `deno_core` - all crates depend on `deno_core` so it must always be published
|
||||||
first
|
first
|
||||||
- crates in `op_crates/` directory - there is no specific order required for
|
- crates in `extensions/` directory - there is no specific order required for
|
||||||
those
|
those
|
||||||
- `runtime` - this crate depends on `deno_core` and all crates in `op_crates/`
|
- `runtime` - this crate depends on `deno_core` and all crates in `extensions/`
|
||||||
directory
|
directory
|
||||||
|
|
||||||
If there are any problems when you publish, that require you to change the code,
|
If there are any problems when you publish, that require you to change the code,
|
||||||
|
|
Loading…
Reference in a new issue