Skip to content

Instantly share code, notes, and snippets.

View JamieMason's full-sized avatar
🙋
Looking for work

Jamie Mason JamieMason

🙋
Looking for work
View GitHub Profile
@JamieMason
JamieMason / create-syncpack-issue-reproduction.md
Created October 30, 2024 13:04
Create Syncpack Issue Reproduction

Create Syncpack Issue Reproduction

Delete all files in the current directory except for this script, lerna.json, package.json, pnpm-workspace.yaml, and syncpack.config.cjs. Also delete all empty directories except for the .git directory.

Put this script at create-syncpack-issue-reproduction.js in the root of the repo.

const child_process = require("child_process");
const fs = require("fs");
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"meta": {
"theme": "elegant",
"version": "v1.0.0",
"canonical": "https://github.com/jsonresume/resume-schema/blob/v1.0.0/schema.json"
},
"basics": {
"name": "Jamie Mason",
"label": "Principal Frontend Developer",
@JamieMason
JamieMason / keymap.json
Last active October 8, 2024 09:18
Zed Settings
[
{
"context": "Editor",
"bindings": {
"alt-shift-down": "editor::DuplicateLineDown",
"alt-shift-f": "editor::Format",
"alt-shift-i": "editor::SplitSelectionIntoLines",
"alt-shift-up": "editor::DuplicateLineUp",
"cmd-\\": "pane::SplitRight"
}
@JamieMason
JamieMason / pipe.ts
Created May 9, 2024 14:08
TypeScript pipe function
/**
* Takes a value and passes it through a sequence of functions in left-to-right order.
*
* A Function that takes an initial value of any type (`unknown`), followed by any number of functions as arguments. It
* returns the result of passing the initial value through each of the functions, one by one, in the order that they
* were passed in. It provides a way to easily chain together multiple functions in a pipeline, where the output of each
* function becomes the input for the next one.
*
* ## Example
*
@JamieMason
JamieMason / randomise-package-json.js
Last active May 4, 2024 10:58
add random numbers to semver versions in package.json files to create mismatches in fixtures.
const root = "/Users/foldleft/Dev/rust-syncpack/fixtures/fluid-framework";
[
`${root}/experimental/framework/data-objects/package.json`,
`${root}/experimental/framework/last-edited/package.json`,
`${root}/experimental/PropertyDDS/examples/property-inspector/package.json`,
`${root}/experimental/PropertyDDS/examples/schemas/package.json`,
`${root}/experimental/PropertyDDS/packages/property-shared-tree-interop/package.json`,
`${root}/experimental/PropertyDDS/packages/property-common/platform-dependent/package.json`,
`${root}/experimental/PropertyDDS/packages/property-common/package.json`,
@JamieMason
JamieMason / try-rescript.res
Created December 18, 2023 22:04
Try ReScript
// looking at an alternative to ReScript's Option
// which exists at runtime when compiled to JS
type maybe<'a> = {
_tag: [#Some],
value: 'a,
}
let createMaybe = (value: 'a): maybe<'a> => {
{
@JamieMason
JamieMason / syncpack-dependents.json
Created September 26, 2023 10:02
Projects depending on https://github.com/JamieMason/syncpack, sorted by most stars
[
{ "org": "@pnpm", "repo": "pnpm/pnpm", "stars": 25486, "forks": 790 },
{ "org": "@mantinedev", "repo": "mantinedev/mantine", "stars": 21487, "forks": 1513 },
{ "org": "@BuilderIO", "repo": "BuilderIO/qwik", "stars": 18903, "forks": 1076 },
{ "org": "@microsoft", "repo": "microsoft/fluentui", "stars": 16391, "forks": 2540 },
{ "org": "@microsoft", "repo": "microsoft/pyright", "stars": 10898, "forks": 1172 },
{ "org": "@callstack", "repo": "callstack/linaria", "stars": 10805, "forks": 430 },
{ "org": "@woocommerce", "repo": "woocommerce/woocommerce", "stars": 8728, "forks": 10800 },
{ "org": "@electron", "repo": "electron/forge", "stars": 5816, "forks": 472 },
{ "org": "@altair-graphql", "repo": "altair-graphql/altair", "stars": 4828, "forks": 272 },
type GetFn = () => {
next(iteration: IteratorResult<any, any>): IteratorResult<any, any>;
};
function iterateOverSyncOrAsyncGenerator<T extends Iterable<any>>(getIterator: GetFn, gen: T): Iterable<any>;
function iterateOverSyncOrAsyncGenerator<T extends AsyncIterable<any>>(getIterator: GetFn, gen: T): AsyncIterable<any>;
function iterateOverSyncOrAsyncGenerator<T extends Iterable<any> | AsyncIterable<any>>(
getIterator: GetFn,
gen: T
): Iterable<any> | AsyncIterable<any> {
import { R } from '@mobily/ts-belt';
/** Additional helpers for https://mobily.github.io/ts-belt/api/result */
export const $R = {
/**
* 1. Return an R.Ok<output[]> if every R.Result succeeds
* 2. Return an R.Error<Error> for the first failure encountered
*/
all<Input, Output = Input>(
getResult: (value: Input) => R.Result<Output, Error>,
@JamieMason
JamieMason / find-nested-dependencies.md
Created March 2, 2022 12:49
Find all modules which a given JavaScript module depends on, and all they modules they depend on, and all they modules they depend on etc.

Find nested dependencies or imports of a JavaScript Module

Find all deep/nested/recursive/descendant dependencies/imports/requires of a JavaScript Module.

Related to sverweij/dependency-cruiser#564, find all modules which a given JavaScript module depends on, and all the modules they depend on, and all the modules they depend on etc.

Installation

npm install -g ts-node