From 1a0cb5b5312941521ab021cfe9eaed498f35900b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 14 Oct 2024 20:48:39 -0400 Subject: feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": "commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`). --- cli/schemas/config-file.v1.json | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index af18e6f21..4a6239f0d 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -528,6 +528,7 @@ "bare-node-builtins", "byonm", "cron", + "detect-cjs", "ffi", "fs", "http", -- cgit v1.2.3 From 9c80ddaf931db79ab4cbdf2262fa5b3f4da1e67f Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Thu, 24 Oct 2024 16:03:46 +0100 Subject: fix(config): schemas for lint rule and tag autocompletion (#26515) --- cli/schemas/config-file.v1.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index 4a6239f0d..db40e5062 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -291,7 +291,7 @@ "type": "array", "description": "List of tag names that will be run. Empty list disables all tags and will only use rules from `include`.", "items": { - "type": "string" + "$ref": "https://raw.githubusercontent.com/denoland/deno_lint/main/schemas/tags.v1.json" }, "minItems": 0, "uniqueItems": true @@ -300,7 +300,7 @@ "type": "array", "description": "List of rule names that will be excluded from configured tag sets. If the same rule is in `include` it will be run.", "items": { - "type": "string" + "$ref": "https://raw.githubusercontent.com/denoland/deno_lint/main/schemas/rules.v1.json" }, "minItems": 0, "uniqueItems": true @@ -309,7 +309,7 @@ "type": "array", "description": "List of rule names that will be run. Even if the same rule is in `exclude` it will be run.", "items": { - "type": "string" + "$ref": "https://raw.githubusercontent.com/denoland/deno_lint/main/schemas/rules.v1.json" }, "minItems": 0, "uniqueItems": true -- cgit v1.2.3 From 09e36d41b007604378525828047085cbaa7b948c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 24 Oct 2024 20:55:38 +0100 Subject: fix: add 'fmt-component' to unstable features in schema file (#26526) Closes https://github.com/denoland/deno/issues/26510 --- cli/schemas/config-file.v1.json | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index db40e5062..27c8499ea 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -531,6 +531,7 @@ "detect-cjs", "ffi", "fs", + "fmt-component", "http", "kv", "net", -- cgit v1.2.3 From f091d1ad69b4e5217ae3272b641171781a372c4f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 13 Nov 2024 10:10:09 -0500 Subject: feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though. --- cli/schemas/config-file.v1.json | 1 - 1 file changed, 1 deletion(-) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index 27c8499ea..ed80eb17b 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -528,7 +528,6 @@ "bare-node-builtins", "byonm", "cron", - "detect-cjs", "ffi", "fs", "fmt-component", -- cgit v1.2.3 From de34c7ed29bcce8b46a65f5effe45090b8493ba5 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 14 Nov 2024 14:11:29 +0100 Subject: feat(cli): add `--unstable-node-globals` flag (#26617) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds a new `--unstable-node-globals` flag to expose Node globals by default. Fixes https://github.com/denoland/deno/issues/26611 --------- Co-authored-by: Bartek Iwańczuk --- cli/schemas/config-file.v1.json | 1 + 1 file changed, 1 insertion(+) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index ed80eb17b..9f4737fa0 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -534,6 +534,7 @@ "http", "kv", "net", + "node-globals", "sloppy-imports", "temporal", "unsafe-proto", -- cgit v1.2.3 From 84e12386480d76e97ad85d9c5314168e7ab03e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 16 Nov 2024 11:18:17 +0000 Subject: feat(task): support object notation, remove support for JSDocs (#26886) This commit changes three aspects of `deno task`: 1. Tasks can now be written using object notation like so: ```jsonc { "tasks": { "foo": "deno run foo.js", "bar": { "command": "deno run bar.js" } } ``` 2. Support for comments for tasks is now removed. Comments above tasks will no longer be printed when running `deno task`. 3. Tasks written using object notation can have "description" field that replaces support for comments above tasks: ```jsonc { "tasks": { "bar": { "description": "This is a bar task" "command": "deno run bar.js" } } ``` ``` $ deno task Available tasks: - bar // This is a bar task deno run bar.js ``` Pulled most of the changes from https://github.com/denoland/deno/pull/26467 to support "dependencies" in tasks. Additionally some cleanup was performed to make code easier to read. --------- Co-authored-by: David Sherret --- cli/schemas/config-file.v1.json | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index 9f4737fa0..56a8090f9 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -431,8 +431,27 @@ "type": "object", "patternProperties": { "^[A-Za-z][A-Za-z0-9_\\-:]*$": { - "type": "string", - "description": "Command to execute for this task name." + "oneOf": [ + { + "type": "string", + "description": "Command to execute for this task name." + }, + { + "type": "object", + "description": "A definition of a task to execute", + "properties": { + "description": { + "type": "string", + "description": "Description of a task that will be shown when running `deno task` without a task name" + }, + "command": { + "type": "string", + "required": true, + "description": "The task to execute" + } + } + } + ] } }, "additionalProperties": false -- cgit v1.2.3 From 661aa22c03f829489e2d9289dee0a8292a95227a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 19 Nov 2024 07:45:09 -0500 Subject: feat(task): dependencies (#26467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for "dependencies" in `deno task` subcommand: ```jsonc { "tasks": { "build": "deno run -RW build.ts", "generate": "deno run -RW generate.ts", "serve": { "command": "deno run -RN server.ts", "dependencies": ["build", "generate"] } } } ``` Executing `deno task serve` will first execute `build` and `generate` tasks (in parallel) and once both complete the `serve` task will be executed. Number of tasks run in parallel is equal to the no of cores on the machine, and respects `DENO_JOBS` env var if one is specified. Part of https://github.com/denoland/deno/issues/26462 --------- Co-authored-by: Bartek Iwańczuk Co-authored-by: Marvin Hagemeister --- cli/schemas/config-file.v1.json | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cli/schemas') diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json index 56a8090f9..3ba803ef8 100644 --- a/cli/schemas/config-file.v1.json +++ b/cli/schemas/config-file.v1.json @@ -448,6 +448,13 @@ "type": "string", "required": true, "description": "The task to execute" + }, + "dependencies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tasks that should be executed before this task" } } } -- cgit v1.2.3