Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion typescript/packages/common-identity/deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@commontools/identity",
"tasks": {
"test": "deno run --allow-env --allow-read --allow-write --allow-run --allow-net ../deno-web-test/cli.ts test/*.test.ts"
"test": "deno check . && deno run --allow-env --allow-read --allow-write --allow-run --allow-net ../deno-web-test/cli.ts test/*.test.ts"
},
"exports": "./src/index.ts",
"imports": {
Expand Down
4 changes: 2 additions & 2 deletions typescript/packages/common-identity/test/ed25519.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface SignerClass {
): Promise<SignerImpl<ID>>;
}
interface VerifierClass {
fromDid<ID extends DIDKey>(did: DID): Promise<VerifierImpl<ID>>;
fromDid<ID extends DIDKey>(did: ID): Promise<VerifierImpl<ID>>;
fromRaw<ID extends DIDKey>(
rawPrivateKey: Uint8Array,
): Promise<VerifierImpl<ID>>;
Expand Down Expand Up @@ -126,7 +126,7 @@ testBothImpls(
Verifier: VerifierClass,
) => {
// @see https://w3c-ccg.github.io/did-method-key/#test-vectors
const fixtures: DID[] = [
const fixtures: DIDKey[] = [
"did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp",
"did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG",
"did:key:z6MknGc3ocHs3zdPiJbnaaqDi58NGb4pk1Sp9WxWufuXSdxf",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, PropertyValues, ReactiveElement, render } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { basicSetup, EditorView } from "codemirror";
import { Compartment, EditorState, Extension } from "@codemirror/state";
import { LanguageSupport } from "@codemirror/language";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Node, Schema } from "prosemirror-model";
import { history } from "prosemirror-history";
import { keymap } from "prosemirror-keymap";
import { baseKeymap } from "prosemirror-commands";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../../shared/styles.ts";
import { editorClassPlugin } from "./prosemirror/editor-class-plugin.ts";
import { updateVerState, verPlugin } from "./prosemirror/ver-plugin.ts";
Expand Down
3 changes: 1 addition & 2 deletions typescript/packages/common-os-ui/src/components/os-ai-box.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement } from "lit/decorators.ts";
import { property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-ai-box")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-ai-icon")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-avatar")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-charm-chip")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-charm-row")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html } from "lit";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../shared/styles.ts";
import {
breakpointLg,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, state } from "lit/decorators.ts";
import { customElement, state } from "lit/decorators.js";

@customElement("os-common-import")
export class OsCommonImport extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-container")
Expand Down
4 changes: 2 additions & 2 deletions typescript/packages/common-os-ui/src/components/os-dialog.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";
import { classMap } from "lit/directives/class-map.ts";
import { classMap } from "lit/directives/class-map.js";

@customElement("os-dialog")
export class OsDialog extends LitElement {
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/common-os-ui/src/components/os-fab.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property, state } from "lit/decorators.ts";
import { customElement, property, state } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-fab")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { css, html, LitElement, PropertyValues } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";
import { createRect, positionMenu, Rect } from "../shared/position.ts";
import * as completion from "./editor/completion.ts";
import { classMap } from "lit/directives/class-map.ts";
import { classMap } from "lit/directives/class-map.js";
import { clamp } from "../shared/number.ts";

/** Completion clicked */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

/**
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/common-os-ui/src/components/os-icon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-icon")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-navpanel")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import {
durationMd,
easeOutCubicCss,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-sidebar-group")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.ts";
import { customElement, property } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

interface TabItem {
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/common-os-ui/src/components/os-tile.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css, html, LitElement } from "lit";
import { customElement } from "lit/decorators.ts";
import { customElement } from "lit/decorators.js";
import { base } from "../shared/styles.ts";

@customElement("os-tile")
Expand Down
12 changes: 4 additions & 8 deletions typescript/packages/deno-web-test/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { exists } from "@std/fs/exists";
export type Config = {
// Whether the test runner should run headlessly. Default: true.
headless?: boolean;
// Whether devtools should be enabled. Default: false.
devtools?: boolean;
// What browser to run.
product?: "chrome" | "firefox";
// Arguments to be passed into the browser.
Expand All @@ -25,12 +23,10 @@ export const applyDefaults = (config: object): Config => {
};

export const extractAstralConfig = (config: Config): LaunchOptions => {
const astralConfig = {};
for (const prop of ["headless", "devtools", "product", "args"]) {
if (prop in config) {
astralConfig[prop] = config[prop];
}
}
const astralConfig: LaunchOptions = {};
if ("headless" in config) astralConfig.headless = config.headless;
if ("product" in config) astralConfig.product = config.product;
if ("args" in config) astralConfig.args = config.args;
return astralConfig;
};

Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/deno-web-test/deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@commontools/deno-web-test",
"tasks": {
"test": "deno test --allow-env --allow-read --allow-write --allow-run --allow-net test/*.test.ts"
"test": "deno check . && deno test --allow-env --allow-read --allow-write --allow-run --allow-net test/*.test.ts"
},
"exports": {
".": "./mod.ts",
Expand Down
18 changes: 11 additions & 7 deletions typescript/packages/deno-web-test/runner.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ConsoleEvent } from "@astral/astral";
import { Manifest } from "./manifest.ts";
import { summarize } from "./utils.ts";
import { BrowserController } from "./browser.ts";
Expand All @@ -15,7 +16,10 @@ export class Runner {
this.reporter = new Reporter();
this.results = [];
this.browser = new BrowserController(manifest);
this.browser.addEventListener("console", (e) => this.onConsole(e));
this.browser.addEventListener(
"console",
(e: Event) => this.onConsole(e as ConsoleEvent),
);
}

// Runs all tests in the browser. Return value
Expand Down Expand Up @@ -62,14 +66,14 @@ export class Runner {
onConsole(e: ConsoleEvent) {
if (this.manifest.config.pipeConsole) {
switch (e.detail.type) {
case "log":
console.log(`deno-web-test: ${e.detail.text}`);
break;
case "warn":
console.warn(`deno-web-test: ${e.detail.text}`);
case "warning":
console.warn(`browser: ${e.detail.text}`);
break;
case "log":
case "info":
case "debug":
case "error":
console.error(`deno-web-test: ${e.detail.text}`);
console[e.detail.type](`browser: ${e.detail.text}`);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/deno-web-test/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class TestServer {

start(port: number) {
this.server = Deno.serve(
{ port, hostname: "127.0.0.1", onListen({ path }) {} },
{ port, hostname: "127.0.0.1", onListen() {} },
(req: Request) =>
serveDir(req, {
fsRoot: this.manifest.serverDir,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const createEd25519Key = async (): CryptoKey => {
export const createEd25519Key = (): Promise<CryptoKey> => {
const dummyKey = new Uint8Array(32);

return await globalThis.crypto.subtle.importKey(
return globalThis.crypto.subtle.importKey(
"raw",
dummyKey,
"ed25519",
Expand Down
6 changes: 0 additions & 6 deletions typescript/packages/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.