Skip to content

Commit

Permalink
chore: fork release using npmmirror registry
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Dec 8, 2023
1 parent 2c4d2a7 commit fb9994f
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 18 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
9 changes: 9 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://unpkg.com/@changesets/config/schema.json",
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "fork-release",
"updateInternalDependencies": "patch",
"ignore": []
}
30 changes: 30 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Rebase

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
rebase:
name: Rebase and Push
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: fork-release
token: ${{ secrets.GH_TOKEN }}

- name: Set Git Info
run: |
git config --global user.email admin@1stg.me
git config --global user.name JounQin
git remote add upstream https://github.com/Automattic/node-canvas.git
- name: Rebase and Push
run: |
git fetch upstream master:master
git rebase upstream/master
git push -f
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches:
- fork-release

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js LTS
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev
npm install --build-from-source
- name: Publish to npm
uses: changesets/action@v1
with:
publish: npx @changesets/cli publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Sync to cnpm
run: npx cnpm sync canvas-npmmirror
62 changes: 50 additions & 12 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# canvas-npmmirror

A fork of [`canvas`](https://github.com/Automattic/node-canvas) using [`npmmirror`](https://npmmirror.com) as registry

## Installation

```bash
$ npm install canvas@npm:canvas-npmmirror@latest
```

---

# node-canvas

![Test](https://github.com/Automattic/node-canvas/workflows/Test/badge.svg)
Expand Down Expand Up @@ -81,18 +93,44 @@ This project is an implementation of the Web Canvas API and implements that API

### Non-standard APIs

* [Image#src](#imagesrc)
* [Image#dataMode](#imagedatamode)
* [Canvas#toBuffer()](#canvastobuffer)
* [Canvas#createPNGStream()](#canvascreatepngstream)
* [Canvas#createJPEGStream()](#canvascreatejpegstream)
* [Canvas#createPDFStream()](#canvascreatepdfstream)
* [Canvas#toDataURL()](#canvastodataurl)
* [CanvasRenderingContext2D#patternQuality](#canvasrenderingcontext2dpatternquality)
* [CanvasRenderingContext2D#quality](#canvasrenderingcontext2dquality)
* [CanvasRenderingContext2D#textDrawingMode](#canvasrenderingcontext2dtextdrawingmode)
* [CanvasRenderingContext2D#globalCompositeOperation = 'saturate'](#canvasrenderingcontext2dglobalcompositeoperation--saturate)
* [CanvasRenderingContext2D#antialias](#canvasrenderingcontext2dantialias)
- [Installation](#installation)
- [Installation](#installation-1)
- [Compiling](#compiling)
- [Quick Example](#quick-example)
- [Upgrading from 1.x to 2.x](#upgrading-from-1x-to-2x)
- [Documentation](#documentation)
- [Utility methods](#utility-methods)
- [Non-standard APIs](#non-standard-apis)
- [createCanvas()](#createcanvas)
- [createImageData()](#createimagedata)
- [loadImage()](#loadimage)
- [registerFont()](#registerfont)
- [Image#src](#imagesrc)
- [Image#dataMode](#imagedatamode)
- [Canvas#toBuffer()](#canvastobuffer)
- [Examples](#examples)
- [Canvas#createPNGStream()](#canvascreatepngstream)
- [Examples](#examples-1)
- [Canvas#createJPEGStream()](#canvascreatejpegstream)
- [Examples](#examples-2)
- [Canvas#createPDFStream()](#canvascreatepdfstream)
- [Canvas#toDataURL()](#canvastodataurl)
- [CanvasRenderingContext2D#patternQuality](#canvasrenderingcontext2dpatternquality)
- [CanvasRenderingContext2D#quality](#canvasrenderingcontext2dquality)
- [CanvasRenderingContext2D#textDrawingMode](#canvasrenderingcontext2dtextdrawingmode)
- [CanvasRenderingContext2D#globalCompositeOperation = 'saturate'](#canvasrenderingcontext2dglobalcompositeoperation--saturate)
- [CanvasRenderingContext2D#antialias](#canvasrenderingcontext2dantialias)
- [PDF Output Support](#pdf-output-support)
- [SVG Output Support](#svg-output-support)
- [SVG Image Support](#svg-image-support)
- [Image pixel formats (experimental)](#image-pixel-formats-experimental)
- [Testing](#testing)
- [Benchmarks](#benchmarks)
- [Examples](#examples-3)
- [Original Authors](#original-authors)
- [License](#license)
- [node-canvas](#node-canvas-1)
- [BMP parser](#bmp-parser)

### createCanvas()

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canvas",
"description": "Canvas graphics API backed by Cairo",
"name": "canvas-npmmirror",
"description": "A fork of `canvas` using `npmmirror` as registry",
"version": "3.0.0",
"author": "TJ Holowaychuk <tj@learnboost.com>",
"main": "index.js",
Expand All @@ -9,7 +9,8 @@
"contributors": [
"Nathan Rajlich <nathan@tootallnate.net>",
"Rod Vagg <r@va.gg>",
"Juriy Zaytsev <kangax@gmail.com>"
"Juriy Zaytsev <kangax@gmail.com>",
"JounQin (https://www.1stG.me) <admin@1stg.me>"
],
"keywords": [
"canvas",
Expand All @@ -21,8 +22,8 @@
"images",
"pdf"
],
"homepage": "https://github.com/Automattic/node-canvas",
"repository": "git://github.com/Automattic/node-canvas.git",
"homepage": "https://github.com/un-es/canvas-npmmirror",
"repository": "git+https://github.com/un-es/canvas-npmmirror.git",
"scripts": {
"prebenchmark": "node-gyp build",
"benchmark": "node benchmarks/run.js",
Expand All @@ -38,7 +39,7 @@
"binary": {
"module_name": "canvas",
"module_path": "build/Release",
"host": "https://github.com/Automattic/node-canvas/releases/download/",
"host": "https://registry.npmmirror.com/-/binary/canvas/",
"remote_path": "v{version}",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz"
},
Expand Down

0 comments on commit fb9994f

Please sign in to comment.