diff --git a/.github/labeler.yml b/.github/labeler.yml index 98731a0e5ce6..04f6e41b2213 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,123 +1,6 @@ -archive: +files: - changed-files: - - any-glob-to-any-file: archive/** -assert: + - any-glob-to-any-file: files/** +openai: - changed-files: - - any-glob-to-any-file: assert/** -async: - - changed-files: - - any-glob-to-any-file: async/** -bytes: - - changed-files: - - any-glob-to-any-file: bytes/** -cbor: - - changed-files: - - any-glob-to-any-file: cbor/** -cli: - - changed-files: - - any-glob-to-any-file: cli/** -collections: - - changed-files: - - any-glob-to-any-file: collections/** -crypto: - - changed-files: - - any-glob-to-any-file: crypto/** -csv: - - changed-files: - - any-glob-to-any-file: csv/** -data-structures: - - changed-files: - - any-glob-to-any-file: data_structures/** -datetime: - - changed-files: - - any-glob-to-any-file: datetime/** -dotenv: - - changed-files: - - any-glob-to-any-file: dotenv/** -encoding: - - changed-files: - - any-glob-to-any-file: encoding/** -expect: - - changed-files: - - any-glob-to-any-file: expect/** -fmt: - - changed-files: - - any-glob-to-any-file: fmt/** -front-matter: - - changed-files: - - any-glob-to-any-file: front_matter/** -fs: - - changed-files: - - any-glob-to-any-file: fs/** -html: - - changed-files: - - any-glob-to-any-file: html/** -http: - - changed-files: - - any-glob-to-any-file: http/** -ini: - - changed-files: - - any-glob-to-any-file: ini/** -internal: - - changed-files: - - any-glob-to-any-file: internal/** -io: - - changed-files: - - any-glob-to-any-file: io/** -json: - - changed-files: - - any-glob-to-any-file: json/** -jsonc: - - changed-files: - - any-glob-to-any-file: jsonc/** -log: - - changed-files: - - any-glob-to-any-file: log/** -media-types: - - changed-files: - - any-glob-to-any-file: media_types/** -msgpack: - - changed-files: - - any-glob-to-any-file: msgpack/** -net: - - changed-files: - - any-glob-to-any-file: net/** -path: - - changed-files: - - any-glob-to-any-file: path/** -random: - - changed-files: - - any-glob-to-any-file: random/** -regexp: - - changed-files: - - any-glob-to-any-file: regexp/** -semver: - - changed-files: - - any-glob-to-any-file: semver/** -streams: - - changed-files: - - any-glob-to-any-file: streams/** -tar: - - changed-files: - - any-glob-to-any-file: tar/** -testing: - - changed-files: - - any-glob-to-any-file: testing/** -text: - - changed-files: - - any-glob-to-any-file: text/** -toml: - - changed-files: - - any-glob-to-any-file: toml/** -ulid: - - changed-files: - - any-glob-to-any-file: ulid/** -uuid: - - changed-files: - - any-glob-to-any-file: uuid/** -webgpu: - - changed-files: - - any-glob-to-any-file: webgpu/** -yaml: - - changed-files: - - any-glob-to-any-file: yaml/** + - any-glob-to-any-file: openai/** diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1199bd34a79a..53db95d9aea2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,6 @@ jobs: strategy: fail-fast: false matrix: - deno: - - v2.x os: - ubuntu-latest - windows-latest @@ -30,7 +28,7 @@ jobs: - name: Set up Deno uses: denoland/setup-deno@v2 with: - deno-version: ${{ matrix.deno }} + deno-version: v2.x - name: Run tests run: deno task test @@ -63,7 +61,7 @@ jobs: - name: Set up Deno uses: denoland/setup-deno@v2 with: - deno-version: canary + deno-version: v2.x - name: Format run: deno fmt --check @@ -91,7 +89,7 @@ jobs: - name: Set up Deno uses: denoland/setup-deno@v2 with: - deno-version: canary + deno-version: v2.x - name: Publish (dry run) run: deno publish --dry-run diff --git a/.github/workflows/workspace_publish.yml b/.github/workflows/workspace_publish.yml index 95403da0fd5b..fbbed156e7a0 100644 --- a/.github/workflows/workspace_publish.yml +++ b/.github/workflows/workspace_publish.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Deno uses: denoland/setup-deno@v2 with: - deno-version: canary + deno-version: v2.x - name: Format run: deno fmt --check diff --git a/_tools/check_browser_compat.ts b/_tools/check_browser_compat.ts index fe87d19c47ba..75c8d3d8f147 100644 --- a/_tools/check_browser_compat.ts +++ b/_tools/check_browser_compat.ts @@ -8,7 +8,7 @@ * Run using: deno run --allow-read --allow-run _tools/check_browser_compat.ts */ -import { walk } from "../fs/walk.ts"; +import { walk } from "@std/fs/walk"; import { COPYRIGHT } from "./check_licence.ts"; const ROOT = new URL("../", import.meta.url); diff --git a/_tools/check_circular_package_dependencies.ts b/_tools/check_circular_package_dependencies.ts index 3a4f5e111804..1fce001733aa 100644 --- a/_tools/check_circular_package_dependencies.ts +++ b/_tools/check_circular_package_dependencies.ts @@ -7,7 +7,7 @@ import { } from "@deno/graph"; import { resolveWorkspaceSpecifiers } from "./utils.ts"; import graphviz from "graphviz"; -import { parse } from "../semver/parse.ts"; +import { parse } from "@std/semver/parse"; /** * Checks for circular dependencies in the std packages. @@ -35,92 +35,12 @@ type Dep = { state: DepState; }; type Mod = - | "archive" - | "assert" - | "async" - | "bytes" - | "cache" - | "cbor" - | "cli" - | "collections" - | "crypto" - | "csv" - | "data_structures" - | "datetime" - | "dotenv" - | "encoding" - | "expect" - | "fmt" - | "front_matter" - | "fs" - | "html" - | "http" - | "ini" - | "internal" - | "io" - | "json" - | "jsonc" - | "log" - | "media_types" - | "msgpack" - | "net" - | "path" - | "random" - | "regexp" - | "semver" - | "streams" - | "tar" - | "testing" - | "text" - | "toml" - | "ulid" - | "uuid" - | "webgpu" - | "yaml"; + | "files" + | "openai"; const ENTRYPOINTS: Record = { - archive: ["mod.ts"], - assert: ["mod.ts"], - async: ["mod.ts"], - bytes: ["mod.ts"], - cache: ["mod.ts"], - cbor: ["mod.ts"], - cli: ["mod.ts"], - collections: ["mod.ts"], - crypto: ["mod.ts"], - csv: ["mod.ts"], - "data_structures": ["mod.ts"], - datetime: ["mod.ts"], - dotenv: ["mod.ts"], - encoding: ["mod.ts"], - expect: ["mod.ts"], - fmt: ["bytes.ts", "colors.ts", "duration.ts", "printf.ts"], - "front_matter": ["mod.ts"], - fs: ["mod.ts"], - html: ["mod.ts"], - http: ["mod.ts"], - ini: ["mod.ts"], - internal: ["mod.ts"], - io: ["mod.ts"], - json: ["mod.ts"], - jsonc: ["mod.ts"], - log: ["mod.ts"], - "media_types": ["mod.ts"], - msgpack: ["mod.ts"], - net: ["mod.ts"], - path: ["mod.ts"], - random: ["mod.ts"], - regexp: ["mod.ts"], - semver: ["mod.ts"], - streams: ["mod.ts"], - tar: ["mod.ts"], - testing: ["bdd.ts", "mock.ts", "snapshot.ts", "time.ts", "types.ts"], - text: ["mod.ts"], - toml: ["mod.ts"], - ulid: ["mod.ts"], - uuid: ["mod.ts"], - webgpu: ["mod.ts"], - yaml: ["mod.ts"], + files: ["mod.ts"], + openai: ["mod.ts"], }; const root = new URL("../", import.meta.url).href; diff --git a/_tools/check_deprecation.ts b/_tools/check_deprecation.ts index 84bd138b90b8..e24731134efe 100644 --- a/_tools/check_deprecation.ts +++ b/_tools/check_deprecation.ts @@ -10,8 +10,8 @@ */ import { doc } from "@deno/doc"; -import { walk } from "../fs/walk.ts"; -import { toFileUrl } from "../path/to_file_url.ts"; +import { walk } from "@std/fs/walk"; +import { toFileUrl } from "@std/path/to-file-url"; import { resolveWorkspaceSpecifiers } from "./utils.ts"; const ROOT = new URL("../", import.meta.url); diff --git a/_tools/check_docs.ts b/_tools/check_docs.ts index 9de5622142bc..a6f74897a36c 100644 --- a/_tools/check_docs.ts +++ b/_tools/check_docs.ts @@ -29,91 +29,8 @@ type DocNodeWithJsDoc = T & { }; const ENTRY_POINTS = [ - "../archive/mod.ts", - "../assert/mod.ts", - "../assert/unstable_never.ts", - "../async/mod.ts", - "../bytes/mod.ts", - "../cache/mod.ts", - "../cbor/mod.ts", - "../cli/mod.ts", - "../cli/unstable_spinner.ts", - "../crypto/mod.ts", - "../collections/mod.ts", - "../csv/mod.ts", - "../data_structures/mod.ts", - "../data_structures/unstable_bidirectional_map.ts", - "../datetime/mod.ts", - "../dotenv/mod.ts", - "../encoding/mod.ts", - "../encoding/unstable_base64_stream.ts", - "../encoding/unstable_base32hex_stream.ts", - "../encoding/unstable_base32_stream.ts", - "../encoding/unstable_base64url_stream.ts", - "../encoding/unstable_base32hex_stream.ts", - "../encoding/unstable_hex_stream.ts", - "../expect/mod.ts", - "../fmt/bytes.ts", - "../fmt/colors.ts", - "../fmt/duration.ts", - "../fmt/printf.ts", - "../front_matter/mod.ts", - "../front_matter/unstable_yaml.ts", - "../fs/mod.ts", - "../html/mod.ts", - "../html/unstable_is_valid_custom_element_name.ts", - "../http/mod.ts", - "../http/unstable_header.ts", - "../http/unstable_method.ts", - "../http/unstable_signed_cookie.ts", - "../ini/mod.ts", - "../internal/mod.ts", - "../io/mod.ts", - "../json/mod.ts", - "../jsonc/mod.ts", - "../log/base_handler.ts", - "../log/warn.ts", - "../log/critical.ts", - "../log/debug.ts", - "../log/error.ts", - "../log/info.ts", - "../log/console_handler.ts", - "../log/formatters.ts", - "../log/get_logger.ts", - "../media_types/mod.ts", - "../msgpack/mod.ts", - "../net/mod.ts", - "../net/unstable_get_network_address.ts", - "../path/mod.ts", - "../path/unstable_basename.ts", - "../path/unstable_dirname.ts", - "../path/unstable_extname.ts", - "../path/unstable_join.ts", - "../path/unstable_normalize.ts", - "../path/posix/mod.ts", - "../path/windows/mod.ts", - "../random/mod.ts", - "../regexp/mod.ts", - "../semver/mod.ts", - "../streams/mod.ts", - "../streams/unstable_fixed_chunk_stream.ts", - "../streams/unstable_to_lines.ts", - "../streams/unstable_to_bytes.ts", - "../tar/mod.ts", - "../text/mod.ts", - "../text/unstable_slugify.ts", - "../text/unstable_to_constant_case.ts", - "../testing/bdd.ts", - "../testing/mock.ts", - "../testing/snapshot.ts", - "../testing/time.ts", - "../testing/types.ts", - "../toml/mod.ts", - "../ulid/mod.ts", - "../uuid/mod.ts", - "../uuid/unstable_v7.ts", - "../webgpu/mod.ts", - "../yaml/mod.ts", + "../files/files.ts", + "../openai/completions.ts", ] as const; const TS_SNIPPET = /```ts[\s\S]*?```/g; diff --git a/_tools/check_licence.ts b/_tools/check_licence.ts index 4c0a5bd52de9..8a749aa3ccde 100644 --- a/_tools/check_licence.ts +++ b/_tools/check_licence.ts @@ -1,7 +1,7 @@ // deno-lint-ignore-file no-console // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { walk } from "../fs/walk.ts"; -import { globToRegExp } from "../path/glob_to_regexp.ts"; +import { walk } from "@std/fs/walk"; +import { globToRegExp } from "@std/path/glob-to-regexp"; const EXTENSIONS = [".mjs", ".js", ".ts", ".rs"]; const EXCLUDED_DIRS = [ diff --git a/_tools/check_mod_exports.ts b/_tools/check_mod_exports.ts index 9ab3b6a7b460..cd654601ec08 100644 --- a/_tools/check_mod_exports.ts +++ b/_tools/check_mod_exports.ts @@ -1,10 +1,10 @@ // deno-lint-ignore-file no-console // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { walk } from "../fs/walk.ts"; -import { relative } from "../path/relative.ts"; -import { dirname } from "../path/dirname.ts"; -import * as colors from "../fmt/colors.ts"; +import { walk } from "@std/fs/walk"; +import { relative } from "@std/path/relative"; +import { dirname } from "@std/path/dirname"; +import * as colors from "@std/fmt/colors"; import ts from "npm:typescript"; const ROOT = new URL("../", import.meta.url); diff --git a/_tools/packages.ts b/_tools/packages.ts index a6138a2e54a0..9dd813950eb9 100644 --- a/_tools/packages.ts +++ b/_tools/packages.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { walk } from "../fs/walk.ts"; -import { relative } from "../path/mod.ts"; +import { walk } from "@std/fs/walk"; +import { relative } from "@std/path"; export async function discoverPackages() { const packages = []; diff --git a/_tools/utils.ts b/_tools/utils.ts index 480862b63e0e..92cbd2eaa62d 100644 --- a/_tools/utils.ts +++ b/_tools/utils.ts @@ -8,7 +8,7 @@ for (const workspace of workspaces) { const { default: config } = await import("../" + workspace + "/deno.json", { with: { type: "json" }, }); - denoConfig[config.name.replace("@std/", "")] = config; + denoConfig[config.name.replace("@artifact/", "")] = config; } export function resolveWorkspaceSpecifiers( @@ -17,7 +17,7 @@ export function resolveWorkspaceSpecifiers( ) { if (specifier.startsWith("../") || specifier.startsWith("./")) { return new URL(specifier, referrer).href; - } else if (specifier.startsWith("@std/")) { + } else if (specifier.startsWith("@artifact/")) { let [_std, pkg, exp] = specifier.split("/"); if (exp === undefined) { exp = "."; diff --git a/deno.json b/deno.json index 0fc2bed33458..9dd05e058b3c 100644 --- a/deno.json +++ b/deno.json @@ -19,14 +19,14 @@ "lint:docs": "deno run -A _tools/check_docs.ts", "lint:import-map": "deno run -A _tools/check_import_map.ts", "lint:unstable-deps": "deno run -A _tools/check_unstable_deps.ts", - "lint": "deno lint && deno task fmt:licence-headers --check && deno task lint:circular && deno task lint:deprecations && deno task lint:tools-types && deno task lint:mod-exports && deno task lint:import-map && deno task lint:docs && deno task lint:unstable-deps", + "lint": "deno lint && deno task lint:circular && deno task lint:tools-types && deno task lint:mod-exports && deno task lint:import-map && deno task lint:docs && deno task lint:unstable-deps", "typos": "typos -c ./.github/workflows/typos.toml", "build:crypto": "deno task --cwd crypto/_wasm wasmbuild", "wasmbuild": "deno run -A jsr:@deno/wasmbuild@0.17.1 --js-ext mjs --sync", "cov": "deno coverage --ignore=\"**/*.generated.mjs,**/_test_utils.ts,.github\"", "cov:gen": "deno task cov --lcov --output=cov.lcov", "cov:view": "deno task cov --html", - "ok": "deno task lint && deno fmt --check && deno task test:browser && deno task test" + "ok": "deno task lint && deno fmt --check && deno task test" }, "exclude": [ ".git", diff --git a/files/files.ts b/files/files.ts index b2f409cb6678..dac95562929b 100644 --- a/files/files.ts +++ b/files/files.ts @@ -78,4 +78,7 @@ // return { matches, result } // } +/** + * This is a comment + */ export const m = 42; diff --git a/files/napp.ts b/files/napp.ts index b493a00d31f1..15ef4c7bbc6e 100644 --- a/files/napp.ts +++ b/files/napp.ts @@ -1,5 +1,7 @@ -import { reasoning, ToApiType } from "../types.ts"; import { z } from "zod"; +const reasoning = z.string().array().optional().describe( + "reasoning for the operation", +); export const parameters = { write: z.object({ @@ -101,5 +103,3 @@ export const returns = { z.object({ path: z.string(), description: z.string() }), ), }; - -export type Api = ToApiType; diff --git a/import_map.json b/import_map.json index 1ec23df2dd31..504a343b13ef 100644 --- a/import_map.json +++ b/import_map.json @@ -49,6 +49,9 @@ "@std/webgpu": "jsr:@std/webgpu@^0.224.7", "@std/yaml": "jsr:@std/yaml@^1.0.5", + "@artifact/files": "jsr:@artifact/files@^0.0.1", + "@artifact/openai": "jsr:@artifact/openai@^0.0.1", + "zod": "npm:zod" } } diff --git a/openai/completions.test.ts b/openai/completions.test.ts index 89d9ac01a8a5..8bff11d9a73c 100644 --- a/openai/completions.test.ts +++ b/openai/completions.test.ts @@ -47,3 +47,10 @@ // complete.mock.teardown() // stop() // }) + +import * as m from "./completions.ts"; +import { expect } from "@std/expect"; + +Deno.test("publish", () => { + expect(m.n).toBe(84); +}); diff --git a/openai/completions.ts b/openai/completions.ts index 3073974e3ecc..27f45ee18504 100644 --- a/openai/completions.ts +++ b/openai/completions.ts @@ -320,4 +320,7 @@ // } // } +/** + * The number 84. + */ export const n = 84;