From 719f82bb68caec855340994f4a62ed3bdf8e8f91 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 4 Aug 2023 17:23:22 +0000 Subject: [PATCH] chore(nix): Update dependencies. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: this `nixpkgs` update pulls in `prettier-3.0`, which changes the default trailing comma setting from `"es5"` to `"all"`. This is unwanted, so we add a `.prettierrc.js` file to keep the old default. Even then, `prettier-3.0` has added a few trailing commas where previously we didn't have them. We also upgrade the `pnpm`-installed `prettier` package to match what's provided by `nixpkgs`. The former will be used by LSP and the `pnpm format` shell command, and the latter is used by our Nix `pre-commit` hooks. Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/71fb97f0d875fd4de4994dfb849f2c75e17eb6c3' (2023-06-01) → 'github:hercules-ci/flake-parts/59cf3f1447cfc75087e7273b04b31e689a8599fb' (2023-08-01) • Updated input 'flake-parts/nixpkgs-lib': 'github:NixOS/nixpkgs/4f53efe34b3a8877ac923b9350c874e3dcd5dc0a?dir=lib' (2023-05-31) → 'github:NixOS/nixpkgs/9e1960bc196baf6881340d53dccb203a951745a2?dir=lib' (2023-08-01) • Updated input 'hacknix': 'github:hackworthltd/hacknix/d63a162941b7aceaef55ec9b26c8b94753dfe667' (2023-06-17) → 'github:hackworthltd/hacknix/7d0d518171938c2b95f7cb8da58f291f5ed22f30' (2023-07-30) • Updated input 'hacknix/flake-parts': 'github:hercules-ci/flake-parts/71fb97f0d875fd4de4994dfb849f2c75e17eb6c3' (2023-06-01) → 'github:hercules-ci/flake-parts/8e8d955c22df93dbe24f19ea04f47a74adbdc5ec' (2023-07-04) • Updated input 'hacknix/flake-parts/nixpkgs-lib': 'github:NixOS/nixpkgs/4f53efe34b3a8877ac923b9350c874e3dcd5dc0a?dir=lib' (2023-05-31) → 'github:NixOS/nixpkgs/4bc72cae107788bf3f24f30db2e2f685c9298dc9?dir=lib' (2023-06-29) • Updated input 'hacknix/nix-darwin': 'github:LnL7/nix-darwin/7c16d31383a90e0e72ace0c35d2d66a18f90fb4f' (2023-06-09) → 'github:LnL7/nix-darwin/16c07487ac9bc59f58b121d13160c67befa3342e' (2023-07-27) • Updated input 'hacknix/nix-darwin/nixpkgs': 'github:NixOS/nixpkgs/3a86856a13c88c8c64ea32082a851fefc79aa700' (2022-11-17) → 'path:/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source?lastModified=1687274257&narHash=sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF%2B/SUBNnAOE%3D&rev=2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5' (2023-06-20) • Updated input 'hacknix/nixos-generators': 'github:nix-community/nixos-generators/a54683aa7eff00ee5b33dec225525d0eb6ab02de' (2023-06-16) → 'github:nix-community/nixos-generators/b1171de4d362c022130c92d7c8adc4bf2b83d586' (2023-07-23) • Updated input 'hacknix/nixos-generators/nixlib': 'github:nix-community/nixpkgs.lib/961e99baaaa57f5f7042fe7ce089a88786c839f4' (2023-06-04) → 'github:nix-community/nixpkgs.lib/02fea408f27186f139153e1ae88f8ab2abd9c22c' (2023-07-16) • Updated input 'hacknix/nixpkgs': 'github:NixOS/nixpkgs/95c729c030b3011c5c89107ac9fa30f7249135fe' (2023-06-15) → 'github:NixOS/nixpkgs/f68a459f743733d53a0f5f9ce4b7b70eea5f8722' (2023-07-28) • Updated input 'hacknix/pre-commit-hooks-nix': 'github:cachix/pre-commit-hooks.nix/5b6b54d3f722aa95cbf4ddbe35390a0af8c0015a' (2023-06-13) → 'github:cachix/pre-commit-hooks.nix/9289996dcac62fd45836db7c07b87d2521eb526d' (2023-07-27) • Updated input 'pre-commit-hooks-nix': 'github:cachix/pre-commit-hooks.nix/5b6b54d3f722aa95cbf4ddbe35390a0af8c0015a' (2023-06-13) → 'github:cachix/pre-commit-hooks.nix/ebb43bdacd1af8954d04869c77bc3b61fde515e4' (2023-08-03) --- .prettierignore | 1 + .prettierrc.js | 6 ++ flake.lock | 77 +++++++++++----------- index.html | 2 +- package.json | 2 +- pnpm-lock.yaml | 10 ++- src/components/TreeReactFlow/Types.ts | 8 +-- src/components/TreeReactFlow/index.tsx | 4 +- src/components/TreeReactFlow/layoutTree.ts | 4 +- 9 files changed, 63 insertions(+), 51 deletions(-) create mode 100644 .prettierrc.js diff --git a/.prettierignore b/.prettierignore index 253b02aa..cd3596fc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,3 +13,4 @@ primer-api.json src/primer-api/ licenses/ COPYING +flake.lock diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..af122bef --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,6 @@ +/** @type {import("prettier").Options} */ +const config = { + trailingComma: "es5", +}; + +module.exports = config; diff --git a/flake.lock b/flake.lock index ae478d32..5935948a 100644 --- a/flake.lock +++ b/flake.lock @@ -233,11 +233,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1685662779, - "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "lastModified": 1690933134, + "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", "type": "github" }, "original": { @@ -251,11 +251,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1685662779, - "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "lastModified": 1688466019, + "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", "type": "github" }, "original": { @@ -572,11 +572,11 @@ "pre-commit-hooks-nix": "pre-commit-hooks-nix" }, "locked": { - "lastModified": 1686993758, - "narHash": "sha256-4HnGlmyEbhLRNwiTOPrHEkVg1Gs+qs47F9XVgBIO0To=", + "lastModified": 1690739279, + "narHash": "sha256-BOA2TEpUHXzdUwa077CgZ7e8hlKuGaN1QjNMG/RwjKw=", "owner": "hackworthltd", "repo": "hacknix", - "rev": "d63a162941b7aceaef55ec9b26c8b94753dfe667", + "rev": "7d0d518171938c2b95f7cb8da58f291f5ed22f30", "type": "github" }, "original": { @@ -790,11 +790,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1686307493, - "narHash": "sha256-R4VEFnDn7nRmNxAu1LwNbjns5DPM8IBsvnrWmZ8ymPs=", + "lastModified": 1690431538, + "narHash": "sha256-Uml8ivMMOFPB9fNSDcw72imGHRdJpaK12sRm2DTLLe8=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "7c16d31383a90e0e72ace0c35d2d66a18f90fb4f", + "rev": "16c07487ac9bc59f58b121d13160c67befa3342e", "type": "github" }, "original": { @@ -823,11 +823,11 @@ }, "nixlib": { "locked": { - "lastModified": 1685840432, - "narHash": "sha256-VJIbiKsY7Xy4E4WcgwUt/UiwYDmN5BAk8tngAjcWsqY=", + "lastModified": 1689469483, + "narHash": "sha256-2SBhY7rZQ/iNCxe04Eqxlz9YK9KgbaTMBssq3/BgdWY=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "961e99baaaa57f5f7042fe7ce089a88786c839f4", + "rev": "02fea408f27186f139153e1ae88f8ab2abd9c22c", "type": "github" }, "original": { @@ -860,11 +860,11 @@ ] }, "locked": { - "lastModified": 1686924781, - "narHash": "sha256-6r3Hm2Fxf4F7LIWRYKU9bsS/xJwlG6L2+/I/pdffvOs=", + "lastModified": 1690133435, + "narHash": "sha256-YNZiefETggroaTLsLJG2M+wpF0pJPwiauKG4q48ddNU=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "a54683aa7eff00ee5b33dec225525d0eb6ab02de", + "rev": "b1171de4d362c022130c92d7c8adc4bf2b83d586", "type": "github" }, "original": { @@ -898,12 +898,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1668650906, - "narHash": "sha256-JuiYfDO23O8oxUUOmhQflmOoJovyC5G4RjcYQMQjrRE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3a86856a13c88c8c64ea32082a851fefc79aa700", - "type": "github" + "lastModified": 1687274257, + "narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=", + "path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source", + "rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5", + "type": "path" }, "original": { "id": "nixpkgs", @@ -1009,11 +1008,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1685564631, - "narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=", + "lastModified": 1690881714, + "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a", + "rev": "9e1960bc196baf6881340d53dccb203a951745a2", "type": "github" }, "original": { @@ -1027,11 +1026,11 @@ "nixpkgs-lib_2": { "locked": { "dir": "lib", - "lastModified": 1685564631, - "narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=", + "lastModified": 1688049487, + "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a", + "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", "type": "github" }, "original": { @@ -1176,11 +1175,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1686858960, - "narHash": "sha256-YO8CVbKQPOUZcpbNHVF2WWKrs+AByCbdggUYc6qAvzs=", + "lastModified": 1690510391, + "narHash": "sha256-Df5Rd40afsqFzaZ/kUWNoVxHFKmuGO4UI/bbxwlRcDY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "95c729c030b3011c5c89107ac9fa30f7249135fe", + "rev": "f68a459f743733d53a0f5f9ce4b7b70eea5f8722", "type": "github" }, "original": { @@ -1249,11 +1248,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1686668298, - "narHash": "sha256-AADh9NqHh6X2LOem4BvI7oCkMm+JPCSCE7iIw5nn0VA=", + "lastModified": 1690464206, + "narHash": "sha256-38V4kmOh6ikpfGiAS+Kt2H/TA2DubSqE66veP/jmB4Q=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "5b6b54d3f722aa95cbf4ddbe35390a0af8c0015a", + "rev": "9289996dcac62fd45836db7c07b87d2521eb526d", "type": "github" }, "original": { @@ -1273,11 +1272,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1686668298, - "narHash": "sha256-AADh9NqHh6X2LOem4BvI7oCkMm+JPCSCE7iIw5nn0VA=", + "lastModified": 1691093055, + "narHash": "sha256-sjNWYpDHc6vx+/M0WbBZKltR0Avh2S43UiDbmYtfHt0=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "5b6b54d3f722aa95cbf4ddbe35390a0af8c0015a", + "rev": "ebb43bdacd1af8954d04869c77bc3b61fde515e4", "type": "github" }, "original": { diff --git a/index.html b/index.html index d4d61289..2442553f 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + diff --git a/package.json b/package.json index ade243a7..1e7d00a2 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "orval": "^6.16.0", "postcss": "^8.4.24", "postcss-import": "^15.1.0", - "prettier": "^2.8.8", + "prettier": "^3.0.1", "storybook": "^7.0.22", "tailwindcss": "3.3.2", "ts-node": "^10.9.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e5269e5f..2db84a26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -180,8 +180,8 @@ devDependencies: specifier: ^15.1.0 version: 15.1.0(postcss@8.4.24) prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: ^3.0.1 + version: 3.0.1 storybook: specifier: ^7.0.22 version: 7.0.22 @@ -11347,6 +11347,12 @@ packages: hasBin: true dev: true + /prettier@3.0.1: + resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-hrtime@1.0.3: resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} engines: {node: '>= 0.8'} diff --git a/src/components/TreeReactFlow/Types.ts b/src/components/TreeReactFlow/Types.ts index 8729ea94..8242b97d 100644 --- a/src/components/TreeReactFlow/Types.ts +++ b/src/components/TreeReactFlow/Types.ts @@ -13,7 +13,7 @@ import { NodeFlavor } from "./Flavor"; /** A generic graph. */ export type Graph< N extends { id: string }, - E extends { source: string; target: string } + E extends { source: string; target: string }, > = { nodes: N[]; edges: E[]; @@ -22,7 +22,7 @@ export type Graph< export const graphMap = < N1 extends { id: string }, N2 extends { id: string }, - E extends { source: string; target: string } + E extends { source: string; target: string }, >( { nodes, edges }: Graph, f: (n: N1) => N2 @@ -33,7 +33,7 @@ export const graphMap = < export const combineGraphs = < N extends { id: string }, - E extends { source: string; target: string } + E extends { source: string; target: string }, >( gs: Graph[] ): Graph => { @@ -77,7 +77,7 @@ export const treeNodes = ({ export const treeToGraph = < N extends { id: string }, - E extends { source: string; target: string } + E extends { source: string; target: string }, >( tree: Tree ): Graph => { diff --git a/src/components/TreeReactFlow/index.tsx b/src/components/TreeReactFlow/index.tsx index 6b9cd7ff..ed61a12f 100644 --- a/src/components/TreeReactFlow/index.tsx +++ b/src/components/TreeReactFlow/index.tsx @@ -538,7 +538,7 @@ const makePrimerNode = async ( (child: PrimerNode, isRight: boolean) => PrimerEdge, /* Nodes of nested trees, already positioned. We have to lay these out first in order to know the dimensions of boxes to be drawn around them.*/ - PrimerGraph[] + PrimerGraph[], ] > => { const selected = @@ -1257,7 +1257,7 @@ const SetTreeReactFlowCallbacks = ({ * and safely act on that type in handlers. */ export const ReactFlowSafe = < N extends RFNode & { type: string }, - E extends RFEdge & { type: string } + E extends RFEdge & { type: string }, >( p: Omit[0], "onNodeClick" | "edgeTypes"> & { nodes: N[]; diff --git a/src/components/TreeReactFlow/layoutTree.ts b/src/components/TreeReactFlow/layoutTree.ts index 851afc18..8e51cdcd 100644 --- a/src/components/TreeReactFlow/layoutTree.ts +++ b/src/components/TreeReactFlow/layoutTree.ts @@ -21,7 +21,7 @@ export const layoutTree = < E extends { source: string; target: string; - } + }, >( primerTree: Tree, p: LayoutParams @@ -86,7 +86,7 @@ const makeNodeMap = < id: string; data: { width: number; height: number }; }, - E extends { source: string; target: string } + E extends { source: string; target: string }, >( nodeInfos: NodeInfo[], edgeInfos: EdgeInfo[],