From edc80c877834928d6888038f50925475fa33a3bb Mon Sep 17 00:00:00 2001 From: Chris Zuber Date: Tue, 23 Dec 2025 11:41:49 -0800 Subject: [PATCH] Initial release of @aegisjsproject/qr-encoder Replace template content with QR encoder implementation for Node and browsers. Add QR code generation utilities for SVG and GIF, update documentation, tests, and configuration. Remove template files and update package metadata to reflect the new project. --- .npmignore | 1 + CHANGELOG.md | 89 +------------------------------------ README.md | 28 ++++++------ consts.js | 1 - http.config.js | 24 ++-------- index.html | 1 + index.js | 110 ++++++++++++++++++++++++++++++++++++++++++++-- index.test.js | 32 ++++++++++++-- package-lock.json | 44 ++++++++++++++----- package.json | 19 ++++---- qr.js | 3 ++ rollup.config.js | 11 +---- 12 files changed, 206 insertions(+), 157 deletions(-) delete mode 100644 consts.js create mode 100644 qr.js diff --git a/.npmignore b/.npmignore index eb76fa7..d3835db 100644 --- a/.npmignore +++ b/.npmignore @@ -18,3 +18,4 @@ importmap.yaml *.bak *.env !*.map +qr.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2296da8..875a86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,93 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Added -- Add `@aegisjsproject/dev-server` - -### Changed -- Update CSP, template, etc - -## [v1.1.3] - 2025-11-21 - -### Added -- Add `npm start` script - -### Changed -- Update npm publishing - -## [v1.1.2] - 2025-05-01 - -### Changed -- Use `eslint` & `rollup` directly instead of by other packages -- Update node version via `.npmrc` -- Update Node CI workflow -- Install & use `@shgysk8zer0/eslint-config` -- Add support for `node --test`, including ignoring tests for publishing -- Update ESLint & super-linter -- Switch to more basic Rollup config -- Update `exports` and `main` accordingly - -### Fixed -- Fix missed renaming in README - -## Removed -- Remove old ESLint config files - -## [v1.1.1] - 2023-09-24 - -### Added -- Add `unpkg` to `package.json` -- Add badges in README - -### Changed -- Update `exports` to `package.json` to handle wider variety - -### Fixed -- Fix typo in `fix:js` script - -### [v1.1.0] - 2023-07-03 - -### Changed -- Update to node 20 -- Update npm publishing GH Action - -## [v1.0.5] - 2023-07-02 - -### Added -- Add `funding` - -### Changed -- Updated GitHub Actions workflows -- Update versioning & lock-file scripts -- Update `.npmignore` & `.gitignore` - -## [v1.0.4] - 2023-06-08 - -### Added -- Install `@shgysk8zer0/npm-utils` -- Add `exports` to package config - -### Removed -- Uninstall `rollup`, `eslint` - -### Changed -- Use `getConfig()` from `@shgysk8zer0/js-utils/rollup` for rollup config - -## [v1.0.3] - 2023-06-01 - -### Fixed -- Revert to old Release Action, now with permissions & link to changelog - -## [v1.0.2] - 2023-06-01 - -### Fixed -- Fix `changelog-entry` to match `[$version]` instead of `$version` - -## [v1.0.1] - 2023-05-31 - -### Fixed -- Update GitHub Release workflow to use [Auto Release](https://github.com/marketplace/actions/auto-release) - -## [v1.0.0] - 2023-05-31 +## [v1.0.0] - 2025-12-23 Initial Release diff --git a/README.md b/README.md index d7fbe2f..3a97d4a 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ -# npm-template +# `@aegisjsproject/qr-encoder` -A template repo for npm packages +A QR encoder for node and browsers -[![CodeQL](https://github.com/shgysk8zer0/npm-template/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/shgysk8zer0/npm-template/actions/workflows/codeql-analysis.yml) -![Node CI](https://github.com/shgysk8zer0/npm-template/workflows/Node%20CI/badge.svg) -![Lint Code Base](https://github.com/shgysk8zer0/npm-template/workflows/Lint%20Code%20Base/badge.svg) +[![CodeQL](https://github.com/AegisJSProject/qr-encoder/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/AegisJSProject/qr-encoder/actions/workflows/codeql-analysis.yml) +![Node CI](https://github.com/AegisJSProject/qr-encoder/workflows/Node%20CI/badge.svg) +![Lint Code Base](https://github.com/AegisJSProject/qr-encoder/workflows/Lint%20Code%20Base/badge.svg) -[![GitHub license](https://img.shields.io/github/license/shgysk8zer0/npm-template.svg)](https://github.com/shgysk8zer0/npm-template/blob/master/LICENSE) -[![GitHub last commit](https://img.shields.io/github/last-commit/shgysk8zer0/npm-template.svg)](https://github.com/shgysk8zer0/npm-template/commits/master) -[![GitHub release](https://img.shields.io/github/release/shgysk8zer0/npm-template?logo=github)](https://github.com/shgysk8zer0/npm-template/releases) +[![GitHub license](https://img.shields.io/github/license/AegisJSProject/qr-encoder.svg)](https://github.com/AegisJSProject/qr-encoder/blob/master/LICENSE) +[![GitHub last commit](https://img.shields.io/github/last-commit/AegisJSProject/qr-encoder.svg)](https://github.com/AegisJSProject/qr-encoder/commits/master) +[![GitHub release](https://img.shields.io/github/release/AegisJSProject/qr-encoder?logo=github)](https://github.com/AegisJSProject/qr-encoder/releases) [![GitHub Sponsors](https://img.shields.io/github/sponsors/shgysk8zer0?logo=github)](https://github.com/sponsors/shgysk8zer0) -[![npm](https://img.shields.io/npm/v/@shgysk8zer0/npm-template)](https://www.npmjs.com/package/@shgysk8zer0/npm-template) -![node-current](https://img.shields.io/node/v/@shgysk8zer0/npm-template) -![npm bundle size gzipped](https://img.shields.io/bundlephobia/minzip/@shgysk8zer0/npm-template) -[![npm](https://img.shields.io/npm/dw/@shgysk8zer0/npm-template?logo=npm)](https://www.npmjs.com/package/@shgysk8zer0/npm-template) +[![npm](https://img.shields.io/npm/v/@aegisjsproject/qr-encoder)](https://www.npmjs.com/package/@aegisjsproject/qr-encoder) +![node-current](https://img.shields.io/node/v/@aegisjsproject/qr-encoder) +![npm bundle size gzipped](https://img.shields.io/bundlephobia/minzip/@aegisjsproject/qr-encoder) +[![npm](https://img.shields.io/npm/dw/@aegisjsproject/qr-encoder?logo=npm)](https://www.npmjs.com/package/@aegisjsproject/qr-encoder) [![GitHub followers](https://img.shields.io/github/followers/shgysk8zer0.svg?style=social)](https://github.com/shgysk8zer0) -![GitHub forks](https://img.shields.io/github/forks/shgysk8zer0/npm-template.svg?style=social) -![GitHub stars](https://img.shields.io/github/stars/shgysk8zer0/npm-template.svg?style=social) +![GitHub forks](https://img.shields.io/github/forks/AegisJSProject/qr-encoder.svg?style=social) +![GitHub stars](https://img.shields.io/github/stars/AegisJSProject/qr-encoder.svg?style=social) [![Twitter Follow](https://img.shields.io/twitter/follow/shgysk8zer0.svg?style=social)](https://twitter.com/shgysk8zer0) [![Donate using Liberapay](https://img.shields.io/liberapay/receives/shgysk8zer0.svg?logo=liberapay)](https://liberapay.com/shgysk8zer0/donate "Donate using Liberapay") diff --git a/consts.js b/consts.js deleted file mode 100644 index fc3a79b..0000000 --- a/consts.js +++ /dev/null @@ -1 +0,0 @@ -export const MESSAGE = 'This is a template for npm projects.'; diff --git a/http.config.js b/http.config.js index 43ca2ec..dafe235 100644 --- a/http.config.js +++ b/http.config.js @@ -1,12 +1,10 @@ import { imports } from '@shgysk8zer0/importmap'; -import { checkCacheItem, setCacheItem } from '@aegisjsproject/http-utils/cache.js'; -import { addTrustedTypePolicy, addScriptSrc, useDefaultCSP } from '@aegisjsproject/http-utils/csp.js'; +import { addScriptSrc, addTrustedTypePolicy, useDefaultCSP } from '@aegisjsproject/http-utils/csp.js'; addScriptSrc( - 'https://unpkg.com/@aegisjsproject/', - 'https://unpkg.com/@shgysk8zer0/', + imports['@shgysk8zer0/polyfills'], + imports.qr, ); - addTrustedTypePolicy('aegis-sanitizer#html'); export default { @@ -15,19 +13,5 @@ export default { '/favicon.svg': '@aegisjsproject/dev-server/favicon', }, open: true, - requestPreprocessors: [ - '@aegisjsproject/http-utils/request-id.js', - checkCacheItem, - ], - responsePostprocessors: [ - '@aegisjsproject/http-utils/compression.js', - '@aegisjsproject/http-utils/cors.js', - useDefaultCSP(), - (response, { request }) => { - if (request.destination === 'document') { - response.headers.append('Link', `<${imports['@shgysk8zer0/polyfills']}>; rel="preload"; as="script"; fetchpriority="high"; crossorigin="anonymous"; referrerpolicy="no-referrer"`); - } - }, - setCacheItem, - ], + responsePostprocessors: [useDefaultCSP()], }; diff --git a/index.html b/index.html index 014936b..f5722f7 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ +