Skip to content

Commit

Permalink
main: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeHats committed Dec 9, 2023
1 parent ffbd96f commit 91a34fb
Show file tree
Hide file tree
Showing 236 changed files with 6,743 additions and 3,284 deletions.
12 changes: 10 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"browser": true,
"es2021": true
},
"plugins": ["react", "@typescript-eslint", "react-hooks", "no-relative-import-paths"],
"plugins": [
"react",
"@typescript-eslint",
"react-hooks",
"no-relative-import-paths"
],
"extends": [
"eslint:recommended",
"plugin:react-hooks/recommended",
Expand All @@ -29,7 +34,10 @@
"no-constant-condition": ["error", { "checkLoops": false }],
"prefer-const": ["error", { "destructuring": "all" }],
"no-relative-import-paths/no-relative-import-paths": ["error"],
"react-hooks/exhaustive-deps": ["error", { "additionalHooks": "useLive" }]
"react-hooks/exhaustive-deps": [
"error",
{ "additionalHooks": "useLive" }
]
},
"settings": {
"react": {
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ jobs:
~/.cargo/git/db/
src/slomojs/crate/target/
target
key: ${{ hashFiles('.rustversion') }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key:
${{ hashFiles('.rustversion') }}-cargo-${{
hashFiles('**/Cargo.lock') }}

- name: Install dependencies
run: yarn --immutable
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"printWidth": 100,
"printWidth": 80,
"tabWidth": 4,
"trailingComma": "all",
"proseWrap": "always",
"experimentalTernaries": true
}
48 changes: 0 additions & 48 deletions .yarn/patches/@types-culori-npm-2.0.0-c062b73b4e.patch

This file was deleted.

48 changes: 48 additions & 0 deletions .yarn/patches/@types-culori-npm-2.0.4-129982cb7c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/fn/index.d.ts b/fn/index.d.ts
index d8427ad5732c487b7e078763bdafc2f2aa19789c..a080370ccc06ee22182f58fafebdd2203e1389a2 100644
--- a/fn/index.d.ts
+++ b/fn/index.d.ts
@@ -70,7 +70,7 @@ export {
interpolatorSplineMonotoneClosed,
} from "../src/interpolate/splineMonotone";

-export { clampChroma, clampRgb } from "../src/clamp";
+export { clampChroma, clampRgb, toGamut, clampGamut } from "../src/clamp";
export { default as displayable } from "../src/displayable";
export { default as lerp } from "../src/interpolate/lerp";
export { getMode, removeParser, useMode, useParser } from "../src/modes";
diff --git a/index.d.ts b/index.d.ts
index c71d73f7b6c809029b35da1af2b0ac2afe9179d1..7a3dabd695c96253c661a593dcde72008c31188c 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -72,7 +72,7 @@ export {
interpolatorSplineMonotoneClosed,
} from "./src/interpolate/splineMonotone";

-export { clampChroma, clampRgb } from "./src/clamp";
+export { clampChroma, clampRgb, toGamut, clampGamut } from "./src/clamp";
export { default as displayable } from "./src/displayable";
export { default as lerp } from "./src/interpolate/lerp";
export { getMode, removeParser, useMode, useParser } from "./src/modes";
diff --git a/src/clamp.d.ts b/src/clamp.d.ts
index e61d3a09805f62d6ce3bc2e8e2c2e3d687db92ec..3ed62131fd731998cd549b4e7273e5208e241c6a 100644
--- a/src/clamp.d.ts
+++ b/src/clamp.d.ts
@@ -1,7 +1,16 @@
import { Color, Mode } from "./common";
+import { DiffFn } from "./difference";

export function clampRgb(color: string): Color | undefined;
export function clampRgb<C extends Color>(color: C): C;

export function clampChroma(color: string, mode?: Mode): Color | undefined;
export function clampChroma<C extends Color>(color: C, mode?: Mode): C;
+
+export function toGamut(
+ dest?: Mode,
+ mode?: Mode,
+ delta?: DiffFn,
+ jnd?: number
+): (color: string | Color) => Color;
+export function clampGamut(mode?: Mode): (color: string | Color) => Color;
\ No newline at end of file
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
a repo where i keep:

- a collection of weird little toys
- a bunch of creative coding tools / libs etc. that are helpful to me when making weird little
toys
- a bunch of creative coding tools / libs etc. that are helpful to me when
making weird little toys

you can look at the toys here: https://alex.dytry.ch/toys

before i had this repo, i'd make a new one for each new weird little toy and waste a bunch of time
on build setup and reimplementing all my standard tools / libs from scratch. this way is quicker. i
think some of the tools here are more generally useful, but i probably won't publish them cus i'd
rather focus my limited free time on actually making things with the tools.
before i had this repo, i'd make a new one for each new weird little toy and
waste a bunch of time on build setup and reimplementing all my standard tools /
libs from scratch. this way is quicker. i think some of the tools here are more
generally useful, but i probably won't publish them cus i'd rather focus my
limited free time on actually making things with the tools.

## wip notes & todos

Expand Down Expand Up @@ -44,8 +45,8 @@ rather focus my limited free time on actually making things with the tools.
- [x] add basics
- [x] restore mode as part of location
- [x] drag-preview in rig mode
- [x] (P0) fix up new drawing for unplaced point - extrapolation produces bad onion skins
currently
- [x] (P0) fix up new drawing for unplaced point - extrapolation produces
bad onion skins currently
- [ ] optimize for quickly drawing multiple shapes
- [ ] figure out proper workflow/right way to use the tool
- [ ] new "stack of cards" ui for keyframes
Expand All @@ -58,7 +59,8 @@ rather focus my limited free time on actually making things with the tools.
- [ ] spring-interpolation
- [ ] paint spring params on lines
- [ ] animation
- [ ] (P2) try density based point allocation instead of distance based
- [ ] (P2) try density based point allocation instead of distance
based
- [ ] (P2) "pin" points on the line for animation consistency
- [ ] turn around?
- [x] design overhaul
Expand Down Expand Up @@ -89,7 +91,8 @@ rather focus my limited free time on actually making things with the tools.
- [ ] octopus singing text trails
- [ ] what happens when you touch somewhere other than the keyboard
- [ ] hats?????
- [ ] figure out other flavour / cool stuff to do with octopus face / tentacles etc
- [ ] figure out other flavour / cool stuff to do with octopus face /
tentacles etc
- signals
- [ ] make signal midi bindings work when inspector isn't rendered
- [x] ADSR-style signal envelopes
Expand Down
84 changes: 42 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,59 @@
"format": "git ls-files | grep -E '.*\\.(js|mjs|cjs|ts|jsx|tsx|html|css|json|yml|md)$' | xargs prettier --write"
},
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.22.10",
"@headlessui/tailwindcss": "^0.1.3",
"@babel/plugin-proposal-decorators": "^7.23.5",
"@headlessui/tailwindcss": "^0.2.0",
"@types/classnames": "^2.3.1",
"@types/dat.gui": "^0.7.7",
"@types/diff": "^5.0.2",
"@types/dat.gui": "^0.7.12",
"@types/diff": "^5.0.9",
"@types/glob": "^8.1.0",
"@types/pixi.js": "^5.0.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/react-transition-group": "^4.4.6",
"@types/three": "^0.132.0",
"@types/use-subscription": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.15",
"eslint": "^8.48.0",
"eslint-plugin-no-relative-import-paths": "^1.5.2",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/react-transition-group": "^4.4.10",
"@types/three": "^0.132.2",
"@types/use-subscription": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint-plugin-no-relative-import-paths": "^1.5.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"glob": "^8.1.0",
"postcss": "^8.4.29",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.3",
"postcss": "^8.4.32",
"prettier": "^3.1.0",
"prettier-plugin-organize-imports": "^3.2.4",
"rimraf": "^3.0.2",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-plugin-dts": "^2.3.0",
"vite-plugin-glsl": "^1.1.2",
"vitest": "^0.29.8",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vite-plugin-dts": "^3.6.4",
"vite-plugin-glsl": "^1.2.0",
"vitest": "^1.0.3",
"webgl-strict-types": "^1.0.5"
},
"dependencies": {
"@babel/generator": "^7.22.10",
"@babel/types": "^7.22.11",
"@headlessui/react": "^1.7.17",
"@babel/generator": "^7.23.5",
"@babel/types": "^7.23.5",
"@headlessui/react": "^1.7.2",
"@juggle/resize-observer": "^3.4.0",
"@radix-ui/react-slot": "^1.0.2",
"@tldraw/state": "2.0.0-alpha.14",
"@tldraw/store": "2.0.0-alpha.14",
"@types/babel__core": "^7.20.1",
"@types/babel__generator": "^7.6.4",
"@types/color": "^3.0.3",
"@types/culori": "2.0.0",
"@types/d3-color": "^3.1.0",
"@types/d3-interpolate": "^3.0.1",
"@types/d3-quadtree": "^3.0.2",
"@types/d3-scale-chromatic": "^3.0.0",
"@types/delaunator": "^5.0.0",
"@types/node": "^16.x.x",
"@types/babel__generator": "^7.6.7",
"@types/color": "^3.0.6",
"@types/culori": "patch:@types/culori@npm%3A2.0.4#~/.yarn/patches/@types-culori-npm-2.0.4-129982cb7c.patch",
"@types/d3-color": "^3.1.3",
"@types/d3-interpolate": "^3.0.4",
"@types/d3-quadtree": "^3.0.6",
"@types/d3-scale-chromatic": "^3.0.3",
"@types/delaunator": "^5.0.2",
"@types/node": "^16.18.68",
"classnames": "^2.3.2",
"color": "^4.2.3",
"culori": "^3.2.0",
"culori": "^3.3.0",
"d3-color": "^3.1.0",
"d3-interpolate": "^3.0.1",
"d3-quadtree": "^3.0.1",
Expand All @@ -78,28 +79,27 @@
"diff": "^5.1.0",
"fast-deep-equal": "^3.1.3",
"immutable": "^4.3.4",
"jest-diff": "^29.6.4",
"jest-diff": "^29.7.0",
"leva": "^0.9.35",
"open-simplex-noise": "^2.5.0",
"pixi.js": "^6.5.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-icons": "^4.12.0",
"react-transition-group": "^4.4.5",
"rebound": "^0.1.0",
"regenerator-runtime": "^0.14.0",
"tailwindcss": "^3.3.3",
"tailwindcss": "^3.3.6",
"three": "^0.132.2",
"use-resize-observer": "^9.1.0",
"use-subscription": "^1.8.0",
"utility-types": "^3.10.0",
"vite-plugin-html": "^3.2.0",
"webmidi": "^3.1.5"
"webmidi": "^3.1.7"
},
"browserslist": "> 0.5%, last 2 versions, not dead",
"packageManager": "[email protected]",
"resolutions": {
"@headlessui/[email protected]": "patch:@headlessui/react@npm:1.7.2#.yarn/patches/@headlessui-react-npm-1.7.2-149c706e3c.patch",
"@types/[email protected]": "patch:@types/culori@npm%3A2.0.0#./.yarn/patches/@types-culori-npm-2.0.0-c062b73b4e.patch"
"@headlessui/[email protected]": "patch:@headlessui/react@npm:1.7.2#.yarn/patches/@headlessui-react-npm-1.7.2-149c706e3c.patch"
}
}
5 changes: 4 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
plugins: [require("tailwindcss")("./tailwind.config.js"), require("autoprefixer")],
plugins: [
require("tailwindcss")("./tailwind.config.js"),
require("autoprefixer"),
],
};
9 changes: 7 additions & 2 deletions scripts/buildPackagesAndPublish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ async function buildIfNeeded(packageJsonPath) {
return;
}

const entryPoint = path.resolve(path.dirname(packageJsonPath), packageJson.main);
const entryPoint = path.resolve(
path.dirname(packageJsonPath),
packageJson.main,
);

const outDir = path.resolve(pacakgesOutDir, packageJson.name);

Expand Down Expand Up @@ -63,7 +66,9 @@ async function buildIfNeeded(packageJsonPath) {
rimraf(path.resolve(outDir, "src/vite-env.d.ts"));
rimraf(path.resolve(outDir, "types"));

const typesPath = path.relative(rootDir, entryPoint).replace(/\.tsx?$/, ".d.ts");
const typesPath = path
.relative(rootDir, entryPoint)
.replace(/\.tsx?$/, ".d.ts");
const packageJsonFile = {
...packageJson,
main: "./index.umd.js",
Expand Down
Loading

0 comments on commit 91a34fb

Please sign in to comment.