diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index 141168d..b5ae342 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -1,11 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will install Deno then run Deno lint and test. -# For more information see: https://github.com/denoland/setup-deno - name: Deno Build on: @@ -15,24 +7,40 @@ on: branches: [main] jobs: - test: - runs-on: ubuntu-latest - + build: + env: + DENO_DIR: my_cache_directory + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-20.04, macos-11, windows-2019 ] steps: - name: Setup repo uses: actions/checkout@v2 - + - name: Cache Deno dependencies + uses: actions/cache@v2 + with: + path: ${{ env.DENO_DIR }} + key: my_cache_key - name: Setup Deno uses: denoland/setup-deno@v1 with: deno-version: v1.x + # Check if the code is formatted according to Deno's default + # formatting conventions. + - run: deno fmt --check - # Uncomment this step to verify the use of 'deno fmt' on each commit. - - name: Verify formatting - run: deno fmt --check + # Scan the code for syntax errors and style issues. If + # you want to use a custom linter configuration you can add a configuration file with --config + - run: deno lint - - name: Run linter - run: deno lint - - name: Run tests - run: deno test -A --unstable + # Run all test files in the repository and collect code coverage. The example + # runs with all permissions, but it is recommended to run with the minimal permissions your program needs (for example --allow-read). + - run: deno test --allow-all --coverage cov/ + + # This generates a report from the collected coverage in `deno test --coverage`. It is + # stored as a .lcov file which integrates well with services such as Codecov, Coveralls and Travis CI. + - name: Generate coverage report + if: matrix.os == 'ubuntu-20.04' + run: deno coverage --lcov cov > cov.lcov diff --git a/deno.json b/deno.json index fc1d99e..afc081d 100644 --- a/deno.json +++ b/deno.json @@ -1,8 +1,15 @@ { "compilerOptions": { - "allowJs": true, - "lib": ["deno.window", "deno.unstable"], - "strict": true + "target": "esnext", + "lib": [ + "dom", + "dom.iterable", + "dom.asynciterable", + "deno.ns", + "deno.window", + "deno.unstable", + "deno.worker" + ] }, "lint": { "files": { diff --git a/src/salt/quasi-entropy.test.ts b/lib/entropy/quasi.test.ts similarity index 92% rename from src/salt/quasi-entropy.test.ts rename to lib/entropy/quasi.test.ts index 87d053c..8f5783c 100644 --- a/src/salt/quasi-entropy.test.ts +++ b/lib/entropy/quasi.test.ts @@ -1,5 +1,5 @@ import { assertEquals } from "https://deno.land/std@0.122.0/testing/asserts.ts"; -import {EnchantrixSaltQuasiEntropy} from "./quasi-entropy.ts"; +import {EnchantrixEntropyQuasi} from "./quasi.ts"; // Compact form: name and function Deno.test("IN: Snider OUT: r3dinS", () => { diff --git a/src/salt/quasi-entropy.ts b/lib/entropy/quasi.ts similarity index 90% rename from src/salt/quasi-entropy.ts rename to lib/entropy/quasi.ts index 38f9aa3..8b9b55d 100644 --- a/src/salt/quasi-entropy.ts +++ b/lib/entropy/quasi.ts @@ -1,9 +1,7 @@ /** * Reproducible salts from input without prior knowledge - * - * @example const salt = new EnchantrixSaltQuasiEntropy('Snider').salty() */ -export class EnchantrixSaltQuasiEntropy { +export class EnchantrixEntropyQuasi { /** * Extend to enforce a custom mapping diff --git a/package.json b/package.json deleted file mode 100644 index 4416526..0000000 --- a/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "enchantrix", - "version": "0.0.1", - "license": "EUPL-1.2", - "description": "The Little CryptoSuite that could.", - "homepage": "https://github.com/Snider/enchantrix/wiki", - "bugs": { - "url": "https://github.com/Snider/enchantrix/issues", - "email": "secops@lt.hn" - }, - "author": "Snider ", - "repository": { - "type": "git", - "url": "https://github.com/Snider/enchantrix" - }, - "scripts": { - "dev": "deno run --watch --allow-net --allow-env --allow-run --allow-read --allow-write --unstable src/server.ts", - "lint": "deno lint src/", - "test": "deno test src/" - }, - "dependencies": { - "openpgp": "^5.0.0", - "pem-ts": "^3.0.0" - } -}