Abandoned this as being over the top, but saving it as this Gist.
import { isDev } from '@builder.io/qwik/build';
let memo: Promise<ServiceWorker> | null;
export async function getActiveServiceWorker(): Promise<ServiceWorker> {
By @foldleft.bsky.social, see also Unfollow everyone on twitter.com
This took 10 minutes so is pretty rough.
import { BskyAgent } from "@atproto/api";
const from = require('/Users/foldleft/Dev/foo/bar/package.json'); | |
const to = require('./package.json'); | |
Object.entries(from.dependencies).forEach(([name, version]) => { | |
if (to.dependencies[name]) { | |
to.dependencies[name] = version; | |
} | |
}); | |
Object.entries(from.devDependencies).forEach(([name, version]) => { |
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", |
[ | |
{ | |
"context": "Editor", | |
"bindings": { | |
"alt-q": "editor::Rewrap", | |
"alt-shift-down": "editor::DuplicateLineDown", | |
"alt-shift-f": "editor::Format", | |
"alt-shift-i": "editor::SplitSelectionIntoLines", | |
"alt-shift-up": "editor::DuplicateLineUp", | |
"cmd cmd": "editor::ShowCompletions", |
/** | |
* 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 | |
* |
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`, |
// 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> => { | |
{ |