-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from cubing/lgarron/ungulp
Overhaul our toolchain
- Loading branch information
Showing
97 changed files
with
2,022 additions
and
16,638 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
/dist | ||
/node_modules | ||
/result | ||
/www | ||
|
||
# This really ought to live in `.git/info/exclude`, but `biome` doesn't understand that file: | ||
# https://github.com/biomejs/biome/issues/4822 | ||
/.direnv | ||
|
||
node_modules/ | ||
|
||
# Courtesy of https://github.com/shinnn/gulp-gh-pages | ||
.publish | ||
# This is a `bun` project, but we still use `package-lock.json` as the source | ||
# of truth for our dependencies. | ||
# See the `bun.lockb` target in `Makefile` for more details. | ||
/bun.lockb | ||
/bun.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
# This Makefile is a wrapper around the scripts from `package.json`. | ||
# https://github.com/lgarron/Makefile-scripts | ||
|
||
# Note: the first command becomes the default `make` target. | ||
NPM_COMMANDS = build watch dev version postversion lint format | ||
|
||
.PHONY: $(NPM_COMMANDS) | ||
$(NPM_COMMANDS): | ||
npm run $@ | ||
|
||
# We write the npm commands to the top of the file above to make shell autocompletion work in more places. | ||
DYNAMIC_NPM_COMMANDS = $(shell node -e 'console.log(Object.keys(require("./package.json").scripts).join(" "))') | ||
UPDATE_MAKEFILE_SED_ARGS = "s/^NPM_COMMANDS = .*$$/NPM_COMMANDS = ${DYNAMIC_NPM_COMMANDS}/" Makefile | ||
.PHONY: update-Makefile | ||
update-Makefile: | ||
@echo "Updating Makefile…" | ||
@if [ "$(shell uname -s)" = "Darwin" ] ; then sed -i "" ${UPDATE_MAKEFILE_SED_ARGS} ; fi | ||
@if [ "$(shell uname -s)" != "Darwin" ] ; then sed -i"" ${UPDATE_MAKEFILE_SED_ARGS} ; fi | ||
# Yes, this is a bit funky. See "Upgrading/changing dependencies" in README.md | ||
# for details. | ||
bun.lockb: package-lock.json | ||
bun pm migrate --force | ||
|
||
.PHONY: build | ||
build: build-lib | ||
|
||
.PHONY: build-lib | ||
build-lib: setup | ||
bun run script/build-lib.ts | ||
|
||
.PHONY: setup | ||
setup: bun.lockb | ||
ifndef NIX_BUILD_TOP | ||
# Makes sure dependencies match the current checkout. Very fast no-op. | ||
bun install --no-save --verbose | ||
endif | ||
|
||
.PHONY: lint | ||
lint: setup | ||
npx @biomejs/biome check | ||
|
||
.PHONY: format | ||
format: setup | ||
npx @biomejs/biome check --write" | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf ./dist/ | ||
|
||
.PHONY: reset | ||
reset: clean | ||
rm -rf ./node_modules | ||
|
||
.PHONY: publish | ||
publish: | ||
npm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,48 @@ | ||
# Cubing Icons and Fonts | ||
# Cubing icons and fonts | ||
|
||
[![Deploy to GitHub Pages](https://github.com/cubing/icons/actions/workflows/deploy.yml/badge.svg)](https://github.com/cubing/icons/actions/workflows/deploy.yml) | ||
|
||
## Demo | ||
## Documentation and demo | ||
|
||
<https://icons.cubing.net> | ||
|
||
## Development | ||
|
||
Most development is simply adding/changing existing SVG files. If you haven't dealt | ||
with SVG files before, check out [Inkscape](https://inkscape.org/). | ||
Most development is simply adding/changing existing SVG files under the | ||
[`./src/svg` directory](https://github.com/cubing/icons/tree/main/src/svg). If | ||
you haven't dealt with SVG files before, check out | ||
[Inkscape](https://inkscape.org/). | ||
|
||
If you want to actually build a font or CSS locally, you'll need some more tooling. | ||
The easiest way to get those tools is with [nix](https://nixos.org/). You'll | ||
need the experimental [Flakes](https://wiki.nixos.org/wiki/Flakes) feature | ||
enabled. | ||
|
||
### Some useful `nix` commands | ||
### Build the project | ||
|
||
- `nix flake check` - This is what happens in CI: build the website, check formatting, etc. | ||
- `nix build .#www` - Build the website. When this finishes, open `result/index.html` in your web browser. | ||
You'll need [`bun`](https://bun.sh) to install development dependencies and build the project. | ||
|
||
### In a dev shell | ||
If you don't have `bun` installed, we provide a [`nix`](https://nixos.org/) | ||
shell you can activate with `nix develop`. | ||
|
||
You can enter a dev shell with `nix develop`. This will open a subshell with | ||
all dependencies installed. | ||
```shell | ||
git clone https://github.com/cubing/icons && cd icons | ||
nix develop # Optional. See above. | ||
make | ||
``` | ||
|
||
- `npm run build` or `npm run watch` - When this finishes, open `www/index.html` in your web browser. | ||
Files are build into the `./dist` dir. | ||
|
||
## Releasing | ||
### Upgrading/changing dependencies | ||
|
||
### Bump version and deploy to `npmjs.org` | ||
`package-lock.json` is the source of truth. Use `npm` to change dependencies | ||
(if all you're doing is installing dependencies, you don't need `npm`). | ||
|
||
``` | ||
npm version major|minor|patch -m "Upgrade to %s for reasons" | ||
As soon as `nix` gets [support for `bun` | ||
lockfiles](https://github.com/NixOS/nixpkgs/issues/255890), we can remove this | ||
quirk. | ||
|
||
### Releasing | ||
|
||
To bump the version and deploy to `npmjs.org`: | ||
|
||
```shell | ||
npm version [major|minor|patch] -m "Release description" | ||
git push --follow-tags | ||
make publish | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.