diff --git a/.en.utf-8.add b/.en.utf-8.add index 7fc7509..27f844e 100644 --- a/.en.utf-8.add +++ b/.en.utf-8.add @@ -1,2 +1,2 @@ +Deno a4 -caxa diff --git a/.github/workflows/deno.yaml b/.github/workflows/deno.yaml new file mode 100644 index 0000000..39d6eb8 --- /dev/null +++ b/.github/workflows/deno.yaml @@ -0,0 +1,28 @@ +# .github/workflows/deno.yaml +# Copyright 2023 Keith Maxwell +# SPDX-License-Identifier: CC0-1.0 + +name: Build + +on: push # yamllint disable-line rule:truthy + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - { uses: actions/checkout@v3 } + - { uses: denoland/setup-deno@v1, with: { deno-version: v1.x } } + - run: deno fmt --check + - run: deno lint + - run: >- + deno compile + --allow-env + --allow-read + --allow-write + --allow-run + --allow-net + a4.js + - { uses: actions/upload-artifact@v3, with: { name: a4, path: a4 } } + - uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: { files: a4 } diff --git a/.github/workflows/reuse.yaml b/.github/workflows/reuse.yaml index 0a35b85..ba8c0a0 100644 --- a/.github/workflows/reuse.yaml +++ b/.github/workflows/reuse.yaml @@ -3,10 +3,7 @@ # SPDX-License-Identifier: CC0-1.0 name: REUSE Compliance Check -on: # yamllint disable-line rule:truthy - push: { branches: [main] } - pull_request: { branches: [main] } - workflow_dispatch: +on: push # yamllint disable-line rule:truthy jobs: main: diff --git a/.gitignore b/.gitignore index 0b1068b..a183214 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /.en.utf-8.add.spl +/a4 +/deno.lock /index.html /index.pdf /node_modules/ diff --git a/.reuse/dep5 b/.reuse/dep5 index 3ac6a0e..5c98bc0 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,6 +3,12 @@ Upstream-Name: a4 Upstream-Contact: Keith Maxwell Source: https://github.com/maxwell-k/a4 -Files: .en.utf-8.add .gitignore package.json package-lock.json README.md +Files: + .en.utf-8.add + .gitignore + README.md + deno.json + package-lock.json + package.json Copyright: 2019 Keith Maxwell License: CC0-1.0 diff --git a/README.md b/README.md index aa1dd29..fa2fd37 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,16 @@ Expected output: ## Offline / Single Executable Application -This is an experimental installation method using [caxa]: +This is an experimental installation method using [Deno]: - npm ci \ - && npm exec --yes -- \ - caxa --exclude .git --input . --output ~/.local/bin/a4 node "{{caxa}}/a4.js" + deno compile --allow-env --allow-read --allow-write --allow-run --allow-net a4.js \ + && ./a4 --version \ + && cp a4 ~/.local/bin + +Rationale: + +1. Running with `npm exec`, like under quick start, is less effective offline +2. Manually installing packages, like under testing, is time consuming ## Licence diff --git a/a4.js b/a4.js index df983d2..f641e61 100755 --- a/a4.js +++ b/a4.js @@ -27,7 +27,7 @@ let input; let pdf; program - .version("0.0.3") // also update package.json + .version("0.0.4") // also update package.json .arguments(` [destination.pdf]`) .action((source, destination) => { input = source; diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..c2f5758 --- /dev/null +++ b/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "puppeteer-core": "https://deno.land/x/puppeteer@16.2.0/mod.ts" + } +} diff --git a/package.json b/package.json index d79b25b..fec0214 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maxwell-k/a4", - "version": "0.0.3", + "version": "0.0.4", "type": "module", "description": "Create a PDF with puppeteer", "main": "a4.js",