From e82f79a994b89f41f03148d63243e8afeb61bd66 Mon Sep 17 00:00:00 2001 From: Izel Nakri Date: Thu, 13 Jul 2023 20:57:43 +0200 Subject: [PATCH] Prepare 0-dep qunitx package --- .npmignore | 1 - Dockerfile | 12 +- TODO | 92 - build.js | 54 + deno.json | 4 +- deno.lock | 11 + package-lock.json | 2808 +------- package.json | 29 +- index.js => shims/browser/index.js | 2 +- shims/{deno-assert.js => deno/assert.js} | 0 shims/{deno.js => deno/index.js} | 2 +- shims/{nodejs-assert.js => node/assert.js} | 0 shims/{nodejs.js => node/index.js} | 2 +- test/index.js | 3 +- vendor/package.json | 1 + vendor/qunit.css | 525 ++ vendor/qunit.js | 7037 ++++++++++++++++++++ 17 files changed, 7887 insertions(+), 2696 deletions(-) create mode 100644 build.js create mode 100644 deno.lock rename index.js => shims/browser/index.js (96%) rename shims/{deno-assert.js => deno/assert.js} (100%) rename shims/{deno.js => deno/index.js} (97%) rename shims/{nodejs-assert.js => node/assert.js} (100%) rename shims/{nodejs.js => node/index.js} (98%) create mode 100644 vendor/package.json create mode 100644 vendor/qunit.css create mode 100644 vendor/qunit.js diff --git a/.npmignore b/.npmignore index 6be9260..d4b60d4 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,6 @@ dist docs tmp .github -scripts .gitignore CHANGELOG.md Dockerfile diff --git a/Dockerfile b/Dockerfile index d2cba3c..7657fe6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,12 @@ FROM node:20.4.0-slim -ENV PUPPETEER_SKIP_DOWNLOAD=true CHROME_BIN=/usr/bin/google-chrome-stable - -RUN apt-get update \ - && apt-get install -y wget gnupg \ - && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ - && apt-get update \ - && apt-get install -y git libxshmfence-dev google-chrome-stable --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* - WORKDIR /code/ ADD package.json package-lock.json /code/ RUN npm install -ADD lib /code/lib +ADD shims /code/shims ADD vendor /code/vendor ADD test /code/test ADD . /code/ diff --git a/TODO b/TODO index 3f23e7d..e69de29 100644 --- a/TODO +++ b/TODO @@ -1,92 +0,0 @@ -Make it so 'qunitx' is a 0-dependency npm package, qunitx-cli the browser runner - -- "$ qunitx sanity-test.ts" made redundant due to (node --test mode) this should impact dependencies and internal modules -- Implement other test cases in deno - -Shim dir structure should be: shims/nodejs/ shims/deno shims/browser -Make package.json point to them correctly -Make the package so esbuild build so esbuild builds when qunitx is vendored(if it needs to) - -Turn import { module, test } from '../../shims/nodejs.js' to import { module, test } from 'qunitx'; For this to happen browser bundler should pick up actual qunit - -Combine nix with Docker for faster container builds - -- also watch subdependencies on browser mode (-- how? investigate esbuild watch) -- maybe make browser tests per file loading