refactor(crypto): move crypto/_wasm_crypto/ to crypto/_wasm/ (#2845)

This commit is contained in:
Asher Gomez 2022-11-07 18:53:46 +12:00 committed by GitHub
parent 60466e8618
commit 1859a59268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 19 additions and 19 deletions

View File

@ -135,8 +135,8 @@ jobs:
- name: Check Import paths in Docs
run: "deno task lint:doc-imports"
hash-wasm:
name: "_wasm_crypto/"
crypto-wasm:
name: "crypto/_wasm"
runs-on: ${{ github.repository_owner == 'denoland' && 'ubuntu-20.04-xl' || 'ubuntu-20.04' }}
steps:
- name: Clone repository
@ -147,12 +147,12 @@ jobs:
submodules: false
persist-credentials: false
- name: Check for changes to _wasm_crypto/
- name: Check for changes to crypto/_wasm
id: source
run: |-
set -o errexit
shopt -s inherit_errexit
declare modifications="$(git diff --name-only HEAD~ -- ./crypto/_wasm_crypto)"
declare modifications="$(git diff --name-only HEAD~ -- ./crypto/_wasm)"
declare modified="$([[ "$modifications" ]] && echo true || echo false)"
echo "modified=$modified" >> $GITHUB_OUTPUT
echo "Wasm crypto source modified in this commit? $modified"
@ -166,7 +166,7 @@ jobs:
uses: hecrj/setup-rust-action@v1
if: success() && steps.source.outputs.modified == 'true'
with:
# This must match the version in crypto/_wasm_crypto/rust-toolchain.toml
# This must match the version in crypto/_wasm/rust-toolchain.toml
rust-version: 1.64.0
targets: wasm32-unknown-unknown
components: rustfmt

2
.gitignore vendored
View File

@ -3,5 +3,5 @@
.vscode/settings.json
.vim
**/cov/
/crypto/_wasm_crypto/target
/crypto/_wasm/target
/encoding/varint/_wasm/target

View File

@ -14,7 +14,7 @@ const EXCLUDED_PATHS = [
"fs/testdata",
"http/testdata",
"http/_negotiation",
"crypto/_wasm_crypto",
"crypto/_wasm",
"crypto/_fnv",
"encoding/varint/_wasm",
"encoding/_yaml",

2
_tools/check_licence.ts Executable file → Normal file
View File

@ -10,7 +10,7 @@ const EXCLUDED_DIRS = [
"fs/testdata",
"http/testdata",
"node/testdata",
"crypto/_wasm_crypto/target",
"crypto/_wasm/target",
"encoding/varint/_wasm/target",
"_tools/testdata",
];

View File

@ -5,7 +5,7 @@ export {
} from "./lib/deno_std_wasm_crypto.generated.mjs";
/**
* All cryptographic hash/digest algorithms supported by std/_wasm_crypto.
* All cryptographic hash/digest algorithms supported by std/crypto/_wasm.
*
* For algorithms that are supported by WebCrypto, the name here must match the
* one used by WebCrypto. Otherwise we should prefer the formatting used in the
@ -41,5 +41,5 @@ export const digestAlgorithms = [
"SHA-1",
] as const;
/** An algorithm name supported by std/_wasm_crypto. */
/** An algorithm name supported by std/crypto/_wasm. */
export type DigestAlgorithm = typeof digestAlgorithms[number];

View File

@ -23,7 +23,7 @@ import {
DigestAlgorithm as WasmDigestAlgorithm,
digestAlgorithms as wasmDigestAlgorithms,
instantiateWasm,
} from "./_wasm_crypto/mod.ts";
} from "./_wasm/mod.ts";
import { timingSafeEqual } from "./timing_safe_equal.ts";
import { fnv } from "./_fnv/index.ts";

View File

@ -3,7 +3,7 @@ import { assert, assertEquals } from "../testing/asserts.ts";
import { crypto as stdCrypto } from "./mod.ts";
import * as bytes from "../bytes/mod.ts";
import { dirname, fromFileUrl } from "../path/mod.ts";
import { DigestAlgorithm, digestAlgorithms } from "./_wasm_crypto/mod.ts";
import { DigestAlgorithm, digestAlgorithms } from "./_wasm/mod.ts";
const moduleDir = dirname(fromFileUrl(import.meta.url));
const webCrypto = globalThis.crypto;
@ -186,7 +186,7 @@ Deno.test("[crypto/digest] Memory use should remain reasonable even with large i
await writer.write(
new TextEncoder().encode(`
import { crypto as stdCrypto } from "./mod.ts";
import { instantiateWithInstance } from "./_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs";
import { instantiateWithInstance } from "./_wasm/lib/deno_std_wasm_crypto.generated.mjs";
const { memory } = instantiateWithInstance().instance.exports;
@ -282,7 +282,7 @@ Deno.test("[crypto/digest] Memory use should remain reasonable even with many ca
await writer.write(
new TextEncoder().encode(`
import { crypto as stdCrypto } from "./mod.ts";
import { instantiateWithInstance } from "./_wasm_crypto/lib/deno_std_wasm_crypto.generated.mjs";
import { instantiateWithInstance } from "./_wasm/lib/deno_std_wasm_crypto.generated.mjs";
const { memory } = instantiateWithInstance().instance.exports;

View File

@ -8,7 +8,7 @@
"files": {
"exclude": [
".git",
"crypto/_wasm_crypto/target",
"crypto/_wasm/target",
"encoding/varint/_wasm/target",
"cov",
"encoding/testdata/jsonc",
@ -25,7 +25,7 @@
"files": {
"exclude": [
".git",
"crypto/_wasm_crypto/target",
"crypto/_wasm/target",
"encoding/varint/_wasm/target",
"encoding/testdata/jsonc",
"encoding/front_matter/testdata",
@ -52,7 +52,7 @@
"node:list-remaining-tests": "deno run --allow-net --allow-write --allow-read node/_tools/list_remaining_tests.ts",
"node:setup": "deno task node:list-remaining-tests && deno run --allow-read --allow-net --allow-write node/_tools/setup.ts",
"node:check-unstable-api": "deno check --unstable ./node/module_all.ts",
"build:crypto": "deno task --cwd crypto/_wasm_crypto wasmbuild",
"build:crypto": "deno task --cwd crypto/_wasm wasmbuild",
"build:varint": "deno task --cwd encoding/varint/_wasm wasmbuild",
"wasmbuild": "deno run --unstable -A https://deno.land/x/wasmbuild@0.10.0/main.ts --js-ext mjs --sync"
}

View File

@ -5,7 +5,7 @@ import {
DigestAlgorithm,
DigestContext,
instantiateWasm,
} from "../../../crypto/_wasm_crypto/mod.ts";
} from "../../../crypto/_wasm/mod.ts";
import { Buffer } from "../../buffer.ts";
import { Transform } from "../../stream.ts";
import { encode as encodeToHex } from "../../../encoding/hex.ts";

View File

@ -1,7 +1,7 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
import { digestAlgorithms } from "../../../crypto/_wasm_crypto/mod.ts";
import { digestAlgorithms } from "../../../crypto/_wasm/mod.ts";
import { getCiphers } from "../../_crypto/crypto_browserify/browserify_aes/mod.js";
import { notImplemented } from "../../_utils.ts";
import { Buffer } from "../../buffer.ts";