Skip to content
Myr

Move the npm package to @myrtechnology/cli, since npm's @myr is another account's, and keep @myr/cli/rules as a name the Lander and the local check resolve to the sdk, so a project made before the move still bundles; the leak check now finds the scope's spelling too, and the examples' config folders import from the new name, pinned to 0.2.2, with datekit's layer the known-bad commits the changed tree makes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by oscabriel · committed by oscabriel · parent 5a67ee9 · Browse files · 16 files+79 added−25 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

16 files+79 added−25 removed

  • tests:+42 added−1 removed
  • other:+37 added−24 removed

16 files+79 added−25 removed

modified:apps/cli/src/local/local-policy.ts+3 added-4 removed
120 unmodified lines
121 dir,122 "tsconfig.json",123 JSON.stringify({124 compilerOptions: {125 paths: {126 [`${Brand.cliPackage}/rules`]: [sdk],127 "@repo/sdk": [sdk],128 },125 paths: Object.fromEntries(126 [...Brand.sdkImports, "@repo/sdk"].map((name) => [name, [sdk]])127 ),128 },129 })130 );131
263 unmodified lines
modified:apps/sandbox/src/lander/script.ts+3 added-1 removed
407 unmodified lines
408export const resolution = (sdk: string) =>409 `${JSON.stringify(410 {411 compilerOptions: {412 paths: { [`${Brand.cliPackage}/rules`]: [sdk], "@repo/sdk": [sdk] },412 paths: Object.fromEntries(413 [...Brand.sdkImports, "@repo/sdk"].map((name) => [name, [sdk]])414 ),415 },416 },417 null,418 2
191 unmodified lines
modified:apps/sandbox/test/lander.test.ts+42 added-1 removed
232 unmodified lines
233234 return yield* Effect.promise((): Promise<Imported> => import(target));235 });236237const SDK_NAMES = [`"${Brand.cliPackage}/rules"`, '"@repo/sdk"'];237const SDK_NAMES = [238 ...Brand.sdkImports.map((name) => JSON.stringify(name)),239 '"@repo/sdk"',240];241242const pointedAtSdk = (source: string) => {243 let pointed = source;244
462 unmodified lines
707 }).pipe(Effect.scoped, Effect.provide(TestServices))708 );709710 it.live(711 "bundles a folder that imports the sdk by a name it had before, as a project made then still does",712 () =>713 Effect.gen(function* () {714 const [current, former] = Brand.sdkImports;715 const repos = yield* world;716717 const formerly = Object.fromEntries(718 Object.entries(configFolder).map(([file, source]) => [719 file,720 source === null ? null : source.replaceAll(current, former),721 ])722 );723724 expect(formerly[config("project.ts")]).toContain(former);725726 const at = yield* startedWith(repos, formerly);727728 const bundled = yield* bundleRules(bundleWire(repos, at)).pipe(729 Effect.provide(box(repos.work))730 );731732 const projectModule = yield* importedFrom(733 bundled.modules,734 config("project.ts")735 );736737 const projectAsCommitted = yield* importedFrom(738 asCommitted(configFolder),739 config("project.ts")740 );741742 expect(dataOf(projectModule)).toStrictEqual(743 dataOf(projectAsCommitted)744 );745 }).pipe(Effect.scoped, Effect.provide(TestServices))746 );747748 it.live(749 "gives no modules for a repo with no config folder, so the project runs on the defaults",750 () =>751 Effect.gen(function* () {752 const repos = yield* world;
485 unmodified lines
modified:examples/burrow/.myr/asks/drop-legacy-fetch.ask.ts+1 added-1 removed
modified:examples/burrow/.myr/package.json+1 added-1 removed
modified:examples/burrow/.myr/project.ts+1 added-1 removed
modified:examples/datekit/.myr/asks/add-months-clamp.ask.ts+1 added-1 removed
modified:examples/datekit/.myr/asks/format-ordinal.ask.ts+1 added-1 removed
modified:examples/datekit/.myr/asks/parse-iso-week.ask.ts+1 added-1 removed
1import { kinds, territory } from "@myr/cli/rules";1import { kinds, territory } from "@myrtechnology/cli/rules";23export default kinds.fix.ask({4 current:5 "parseISO gives an invalid date for every week date, so a payroll week or a sprint stored as 2026-W41 can't be read back.",
8 unmodified lines
modified:examples/datekit/.myr/package.json+1 added-1 removed
1{2 "private": true,3 "type": "module",4 "devDependencies": {5 "@myr/cli": "0.2.1"5 "@myrtechnology/cli": "0.2.2"6 }7}
modified:examples/datekit/.myr/project.ts+1 added-1 removed
1import { kinds, project } from "@myr/cli/rules";1import { kinds, project } from "@myrtechnology/cli/rules";23/**4 * How datekit takes changes. Each change we want is an ask in asks/, with a5 * test that fails on main; an answer lands when that test passes and the
18 unmodified lines
modified:examples/datekit/.myr/visibility.ts+1 added-1 removed
1import { flows, layer, sealedChecks, visibility } from "@myr/cli/rules";1import { flows, layer, sealedChecks, visibility } from "@myrtechnology/cli/rules";23/**4 * What datekit keeps out of its public tree, and why. The maintainers hold5 * checks for how dates are shown (export) and read (parser) in a layer of
21 unmodified lines
modified:examples/datekit/layers/maintainers/.myr/layer.json+2 added-2 removed
110 unmodified lines
111 "path": "checks/held-back/parser/fraction-digits.test.ts"112 }113 ],114 "knownBad": [115 "038860d9115139e3d23ce9c7a5814a5f67ef8416",116 "bee4f59771f2c1297bb4896dc495ee669be7d2f7"115 "dbaee401dfda08e13c16ce9066727e2adb99ceca",116 "af5d85ab3e43a2809ff19559f397028dbf3e86bf"117 ],118 "layer": "maintainers"119}
modified:examples/datekit/layers/maintainers/.myr/layer.ts+4 added-4 removed
1import { layerManifest } from "@myr/cli/rules";2import type { AreaOf } from "@myr/cli/rules";1import { layerManifest } from "@myrtechnology/cli/rules";2import type { AreaOf } from "@myrtechnology/cli/rules";34// The public config sits beside this file in a maintainer's work tree, where5// the layer is overlaid on main at the same paths.6import type policy from "./visibility.ts";
128 unmodified lines
135 },136 ],137 knownBad: [138 // known-bad/export: unescapes only the first pair of quotes.139 "038860d9115139e3d23ce9c7a5814a5f67ef8416",139 "dbaee401dfda08e13c16ce9066727e2adb99ceca",140 // known-bad/parser: rounds the digits past the millisecond.141 "bee4f59771f2c1297bb4896dc495ee669be7d2f7",141 "af5d85ab3e43a2809ff19559f397028dbf3e86bf",142 ],143 layer: "maintainers",144});
modified:packages/brand/src/index.ts+10 added-2 removed
4 unmodified lines
5// The platform's own host on prod: where the CLI signs in and reads when6// nothing names another platform.7const platformHost = `git.${domain}`;89// npm's `@myr` is another account's, so the package's scope spells the domain.10const npmScope = `@${slug}technology`;1112const cliPackage = `${npmScope}/cli`;1314export const Brand = {15 cli: slug,11 cliPackage: `@${slug}/cli`,16 cliPackage,17 configDir: `.${slug}`,18 domain,19 gitCredentialHelper: `git-credential-${slug}`,20 gitRemoteHelper: `git-remote-${slug}`,21 githubOrg: `get${slug}`,22 name: "Myr",18 npmScope: `@${slug}`,23 npmScope,24 platformHost,25 platformUrl: `https://${platformHost}`,26 refsPrefix: `refs/${slug}/`,27 // Each name a config folder imports the sdk by: the package's own, then28 // the one it had before its scope moved, which projects made then keep.29 sdkImports: [`${cliPackage}/rules`, `@${slug}/cli/rules`],30 slug,31 urlScheme: `${slug}://`,32} as const;
modified:packages/brand/src/leaks.ts+6 added-2 removed
29 unmodified lines
30 (dir === "layers" && layerDir === Brand.configDir))31 );32};3334// Letters on either side make it another word ("myriad"), not the name.35const NAME = new RegExp(`(?<![a-z])${Brand.slug}(?![a-z])`, "iu");34// Letters on either side make it another word ("myriad"), not the name; the35// npm scope spells it with the domain's word joined on.36const NAME = new RegExp(37 `(?<![a-z])(?:${Brand.slug}|${Brand.npmScope.slice(1)})(?![a-z])`,38 "iu"39);4041const mayNameTheBrand = (path: string) =>42 path.startsWith(HOME) || PROSE.test(path) || inExampleConfig(path);43
26 unmodified lines