Merge pull request #71 from ful1e5/dev

refactor: `macOSBigSur` cursors with separated build process
This commit is contained in:
Kaiz Khatri 2021-11-21 16:27:50 +05:30 committed by GitHub
commit c043b0ee34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 163 additions and 793 deletions

View file

@ -54,7 +54,7 @@ jobs:
python-version: "3.8"
- name: Generating `macOSBigSur` Cursor Theme
run: make
run: make bigsur
continue-on-error: false
- name: Compressing UNIX theme

View file

@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Generate master `bitmaps.zip` inside `bin` directory
- `Makefile` binaries targets with variable
- pling docs: size and support info updated
- `bigsur` cursor bitmapper as node package
- New commands added inside `Makefile` for `bitmapper`
### Changed
@ -19,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Simplified README.md (removed emojis)
- sponsor with liberapay
- fixed text cursor state in `xterm` & `vertical-text` (increase border size) #67
- bitmapper `core` as node package
- macOSBigSur .svg files moved to `svgs/bigsur` directory
## [v1.2.2] - 31 Oct 2021

View file

@ -1,20 +1,33 @@
all: clean render build
.PHONY: all
# Default
clean:
@rm -rf bitmaps themes
render: bitmapper svg
@cd bitmapper && $(MAKE)
@cd bitmapper && make install render_bigsur
build: bitmaps
@cd builder && make build
@cd builder && make setup build
# Specific platform build
unix: clean render bitmaps
@cd builder && make build_unix
@cd builder && make setup build_unix
windows: clean render bitmaps
@cd builder && make build_windows
@cd builder && make setup build_windows
# macOS Big Sur
bigsur: clean render_bigsur build_bigsur
render_bigsur: bitmapper svg
@cd bitmapper && make install render_bigsur
build_bigsur: bitmaps
@cd builder && make setup build_bigsur
# Installation

View file

@ -2,17 +2,17 @@ all: install render
.PHONY: all
install: node_modules package.json
@yarn install
render:
@yarn render
watch:
@yarn watch
clean:
@find . -type f -name "yarn.lock" -exec rm -rf "{}" +;
@find . -type d -name "node_modules" -exec rm -rf "{}" +;
node_modules:
@mkdir -p $@
clean:
@rm -rf node_modules yarn.lock
install: node_modules package.json
@yarn install
render_bigsur:
@yarn render:bigsur
render: render_bigsur

View file

@ -1,25 +1,15 @@
{
"name": "apple_cursor_bitmapper",
"version": "1.2.2",
"name": "apple-cursor",
"version": "1.1.2",
"description": "OpenSource macOS cursors.",
"main": "index.js",
"scripts": {
"render": "yarn ts-node src/index.ts"
},
"repository": "git@github.com:ful1e5/apple_cursor.git",
"author": "Kaiz Khatri",
"license": "GPL-3.0",
"private": true,
"devDependencies": {
"@types/pixelmatch": "^5.2.2",
"@types/pngjs": "^3.4.2",
"@types/puppeteer": "^5.4.2",
"nodemon": "^2.0.7",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
"scripts": {
"render:bigsur": "yarn workspace bigsur render"
},
"dependencies": {
"pixelmatch": "^5.2.1",
"pngjs": "^6.0.0",
"puppeteer": "^5.5.0"
}
"workspaces": [
"packages/*"
]
}

View file

@ -0,0 +1,17 @@
{
"name": "bigsur",
"version": "1.2.2",
"description": "macOS Big Sur cursors",
"main": "dist/index.js",
"scripts": {
"build": "npx tsc --build",
"render": "yarn build && node dist/index.js"
},
"author": "Kaiz Khatri",
"license": "GPL-3.0",
"private": true,
"devDependencies": {
"ts-node": "^9.1.1",
"typescript": "^4.1.5"
}
}

View file

@ -1,4 +1,4 @@
import { Colors } from "./core/types";
import { Colors } from "core/src/types";
interface Config {
themeName: string;

View file

@ -1,14 +1,14 @@
import path from "path";
import { BitmapsGenerator, SVGHandler } from "./core";
import { BitmapsGenerator, SVGHandler } from "core";
import { config } from "./config";
const root = path.resolve(__dirname, "../../");
const svgDir = path.resolve(root, "svg");
const root = path.resolve(__dirname, "../../../../");
const svgDir = path.resolve(root, "svg", "bigsur");
const main = async () => {
for (const { themeName, color } of config) {
console.log("Generating bitmaps for", themeName);
console.log("=>", themeName);
const bitmapsDir = path.resolve(root, "bitmaps", themeName);
const svg = new SVGHandler.SvgDirectoryParser(svgDir);
@ -17,14 +17,14 @@ const main = async () => {
const browser = await png.getBrowser();
for (let { key, content } of svg.getStatic()) {
console.log(" ==> Saving", key, "...");
console.log(" -> Saving", key, "...");
content = SVGHandler.colorSvg(content, color);
await png.generateStatic(browser, content, key);
}
for (let { key, content } of svg.getAnimated()) {
console.log(" ==> Saving", key, "...");
console.log(" -> Saving", key, "...");
content = SVGHandler.colorSvg(content, color);
await png.generateAnimated(browser, content, key);

View file

@ -0,0 +1,10 @@
{
"references": [{ "path": "../core" }],
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src"]
}

View file

@ -0,0 +1,22 @@
{
"name": "core",
"version": "1.2.2",
"description": "Apple Cursor bitmapper's core modules",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"author": "Kaiz Khatri",
"license": "GPL-3.0",
"private": true,
"dependencies": {
"pixelmatch": "^5.2.1",
"pngjs": "^6.0.0",
"puppeteer": "^7.1.0"
},
"devDependencies": {
"@types/pixelmatch": "^5.2.2",
"@types/pngjs": "^6.0.0",
"@types/puppeteer": "^5.4.3",
"ts-node": "^9.1.1",
"typescript": "^4.1.5"
}
}

View file

@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"]
}

View file

@ -1,12 +1,15 @@
{
"compilerOptions": {
"strict": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"esModuleInterop": true,
"target": "ES2015",
"target": "es2017",
"module": "commonjs",
"lib": ["es2015", "dom"],
"noUnusedParameters": true
"strict": true,
"typeRoots": ["./node_modules/@types"],
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"resolveJsonModule": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true
}
}

File diff suppressed because it is too large Load diff

View file

@ -15,14 +15,19 @@ THEMES = White
setup:
@python3 -m pip install clickgen --user
build: setup build.py
build: build_bigsur
build_bigsur: build.py
@python3 build.py -p "$(bitmaps_dir)/macOSBigSur" --xsizes $(X_SIZES) --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE)
@$(foreach theme,$(THEMES), python3 build.py -p "$(bitmaps_dir)/macOSBigSur-$(theme)" --xsizes $(X_SIZES) --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE);)
build_unix: setup build.py
build_unix: build_bigsur_unix
build_bigsur_unix: build.py
@python3 build.py unix -p "$(bitmaps_dir)/macOSBigSur" --xsizes $(X_SIZES)
@$(foreach theme,$(THEMES), python3 build.py unix -p "$(bitmaps_dir)/macOSBigSur-$(theme)" --xsizes $(X_SIZES);)
build_windows: setup build.py
build_windows: build_bigsur_windows
build_bigsur_windows: build.py
@python3 build.py windows -p "$(bitmaps_dir)/macOSBigSur" --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE)
@$(foreach theme,$(THEMES), python3 build.py windows -p "$(bitmaps_dir)/macOSBigSur-$(theme)" --win-size $(WIN_SIZE) --win-canvas-size $(WIN_CANVAS_SIZE);)

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After