@r_masseater/msch 0.89.0 → 0.89.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-C8OGDSk9.mjs","names":[],"sources":["../src/app/runtime.ts"],"sourcesContent":["import { runMainWith } from \"@r_masseater/masseater-utils/node-main\";\nimport type { Effect, FileSystem, Path, Stdio } from \"effect\";\nimport type { HttpClient } from \"effect/http\";\nimport type { ChildProcessSpawner } from \"effect/process\";\n\nimport { nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\n/** @internal */\nexport const runCli =\n (name: string) =>\n <Value, Failure>(\n program: Effect.Effect<\n Value,\n Failure,\n | RepositoryFiles\n | Stdio.Stdio\n | FileSystem.FileSystem\n | Path.Path\n | ChildProcessSpawner.ChildProcessSpawner\n | HttpClient.HttpClient\n >,\n ): void => {\n runMainWith({ serviceName: name, services: nodeRepositoryFiles })(program);\n };\n"],"mappings":";;;;AASA,MAAa,UACV,UAEC,YAUS;CACT,YAAY;EAAE,aAAa;EAAM,UAAU;CAAoB,CAAC,CAAC,CAAC,OAAO;AAC3E"}
1
+ {"version":3,"file":"runtime-C8OGDSk9.mjs","names":[],"sources":["../src/app/runtime.ts"],"sourcesContent":["import type { NodeServices } from \"@effect/platform-node/NodeServices\";\nimport { runMainWith } from \"@r_masseater/masseater-utils/node-main\";\nimport type { Effect } from \"effect\";\nimport type { HttpClient } from \"effect/http\";\n\nimport { nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\n/** @internal */\nexport const runCli =\n (name: string) =>\n <Value, Failure>(\n program: Effect.Effect<Value, Failure, RepositoryFiles | NodeServices | HttpClient.HttpClient>,\n ): void => {\n runMainWith({ serviceName: name, services: nodeRepositoryFiles })(program);\n };\n"],"mappings":";;;;AASA,MAAa,UACV,UAEC,YACS;CACT,YAAY;EAAE,aAAa;EAAM,UAAU;CAAoB,CAAC,CAAC,CAAC,OAAO;AAC3E"}
package/dist/wake.mjs CHANGED
@@ -3,6 +3,7 @@ import { t as runCli } from "./runtime-C8OGDSk9.mjs";
3
3
  import { n as repositoryBroker, t as actionsOidcToken } from "./credential-broker-PkIpsaMh.mjs";
4
4
  import { Boolean, Console, Effect, Option, Schema } from "effect";
5
5
  import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
6
+ import { Command } from "effect/cli";
6
7
  // src/features/wake-project/model/wake.ts
7
8
  const Woken = Schema.Struct({ woken: Schema.Boolean });
8
9
  const askBroker = Effect.fn("wake.askBroker")(function* askBroker(broker, oidc) {
@@ -23,8 +24,11 @@ const wakeOnRedMain = Effect.fn("wake.redMain")(function* wakeOnRedMain() {
23
24
  if (Option.isNone(oidc)) return yield* Console.log("Not running in GitHub Actions: nothing to tell the broker");
24
25
  return yield* askBroker(broker.value, oidc.value);
25
26
  });
27
+ // package.json
28
+ var version = "0.89.1";
26
29
  // bin/msch-wake.ts
27
- runCli("msch-wake")(wakeOnRedMain());
30
+ const command = Command.make("msch-wake", {}, () => wakeOnRedMain()).pipe(Command.withDescription("Tells the credential broker that this GitHub Actions run failed, so the project gets asked to fix it"));
31
+ runCli("msch-wake")(Command.run(command, { version }));
28
32
  export {};
29
33
 
30
34
  //# sourceMappingURL=wake.mjs.map
package/dist/wake.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wake.mjs","names":["Bool"],"sources":["../src/features/wake-project/model/wake.ts","../bin/msch-wake.ts"],"sourcesContent":["import { Boolean as Bool, Console, Effect, Option, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { actionsOidcToken, repositoryBroker } from \"#/shared/lib/credential-broker.ts\";\nimport type { CredentialBroker } from \"#/shared/lib/owner-settings.ts\";\n\nconst Woken = Schema.Struct({ woken: Schema.Boolean });\n\nconst askBroker = Effect.fn(\"wake.askBroker\")(function* askBroker(\n broker: CredentialBroker,\n oidc: string,\n) {\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.post(`${broker.url}wake/main-red`).pipe(\n HttpClientRequest.bearerToken(oidc),\n );\n const response = yield* HttpClient.filterStatusOk(client).execute(request);\n const { woken } = yield* HttpClientResponse.schemaBodyJson(Woken)(response);\n return yield* Console.log(\n Bool.match(woken, {\n onTrue: () => \"Asked the project to fix main\",\n onFalse: () => \"Asked recently: skipped\",\n }),\n );\n});\n\n/** @internal */\nexport const wakeOnRedMain = Effect.fn(\"wake.redMain\")(function* wakeOnRedMain() {\n const broker = yield* repositoryBroker;\n if (Option.isNone(broker)) {\n return yield* Console.log(\"msch.broker is false: no credential broker to tell\");\n }\n const oidc = yield* actionsOidcToken(broker.value);\n if (Option.isNone(oidc)) {\n return yield* Console.log(\"Not running in GitHub Actions: nothing to tell the broker\");\n }\n return yield* askBroker(broker.value, oidc.value);\n});\n","#!/usr/bin/env node\nimport { runCli } from \"#/app/runtime.ts\";\nimport { wakeOnRedMain } from \"#/features/wake-project/index.ts\";\n\nrunCli(\"msch-wake\")(wakeOnRedMain());\n"],"mappings":";;;;;;AAMA,MAAM,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,QAAQ,CAAC;AAErD,MAAM,YAAY,OAAO,GAAG,gBAAgB,CAAC,CAAC,UAAU,UACtD,QACA,MACA;CACA,MAAM,SAAS,OAAO,WAAW;CACjC,MAAM,UAAU,kBAAkB,KAAK,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,KACnE,kBAAkB,YAAY,IAAI,CACpC;CACA,MAAM,WAAW,OAAO,WAAW,eAAe,MAAM,CAAC,CAAC,QAAQ,OAAO;CACzE,MAAM,EAAE,UAAU,OAAO,mBAAmB,eAAe,KAAK,CAAC,CAAC,QAAQ;CAC1E,OAAO,OAAO,QAAQ,IACpBA,QAAK,MAAM,OAAO;EAChB,cAAc;EACd,eAAe;CACjB,CAAC,CACH;AACF,CAAC;;AAGD,MAAa,gBAAgB,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,gBAAgB;CAC/E,MAAM,SAAS,OAAO;CACtB,IAAI,OAAO,OAAO,MAAM,GACtB,OAAO,OAAO,QAAQ,IAAI,oDAAoD;CAEhF,MAAM,OAAO,OAAO,iBAAiB,OAAO,KAAK;CACjD,IAAI,OAAO,OAAO,IAAI,GACpB,OAAO,OAAO,QAAQ,IAAI,2DAA2D;CAEvF,OAAO,OAAO,UAAU,OAAO,OAAO,KAAK,KAAK;AAClD,CAAC;;ACjCD,OAAO,WAAW,CAAC,CAAC,cAAc,CAAC"}
1
+ {"version":3,"file":"wake.mjs","names":["Bool","manifest.version"],"sources":["../src/features/wake-project/model/wake.ts","../package.json","../bin/msch-wake.ts"],"sourcesContent":["import { Boolean as Bool, Console, Effect, Option, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { actionsOidcToken, repositoryBroker } from \"#/shared/lib/credential-broker.ts\";\nimport type { CredentialBroker } from \"#/shared/lib/owner-settings.ts\";\n\nconst Woken = Schema.Struct({ woken: Schema.Boolean });\n\nconst askBroker = Effect.fn(\"wake.askBroker\")(function* askBroker(\n broker: CredentialBroker,\n oidc: string,\n) {\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.post(`${broker.url}wake/main-red`).pipe(\n HttpClientRequest.bearerToken(oidc),\n );\n const response = yield* HttpClient.filterStatusOk(client).execute(request);\n const { woken } = yield* HttpClientResponse.schemaBodyJson(Woken)(response);\n return yield* Console.log(\n Bool.match(woken, {\n onTrue: () => \"Asked the project to fix main\",\n onFalse: () => \"Asked recently: skipped\",\n }),\n );\n});\n\n/** @internal */\nexport const wakeOnRedMain = Effect.fn(\"wake.redMain\")(function* wakeOnRedMain() {\n const broker = yield* repositoryBroker;\n if (Option.isNone(broker)) {\n return yield* Console.log(\"msch.broker is false: no credential broker to tell\");\n }\n const oidc = yield* actionsOidcToken(broker.value);\n if (Option.isNone(oidc)) {\n return yield* Console.log(\"Not running in GitHub Actions: nothing to tell the broker\");\n }\n return yield* askBroker(broker.value, oidc.value);\n});\n","","#!/usr/bin/env node\nimport { Command } from \"effect/cli\";\n\nimport { runCli } from \"#/app/runtime.ts\";\nimport { wakeOnRedMain } from \"#/features/wake-project/index.ts\";\nimport manifest from \"#package.json\" with { type: \"json\" };\n\nconst command = Command.make(\"msch-wake\", {}, () => wakeOnRedMain()).pipe(\n Command.withDescription(\n \"Tells the credential broker that this GitHub Actions run failed, so the project gets asked to fix it\",\n ),\n);\n\nrunCli(\"msch-wake\")(Command.run(command, { version: manifest.version }));\n"],"mappings":";;;;;;;AAMA,MAAM,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,QAAQ,CAAC;AAErD,MAAM,YAAY,OAAO,GAAG,gBAAgB,CAAC,CAAC,UAAU,UACtD,QACA,MACA;CACA,MAAM,SAAS,OAAO,WAAW;CACjC,MAAM,UAAU,kBAAkB,KAAK,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,KACnE,kBAAkB,YAAY,IAAI,CACpC;CACA,MAAM,WAAW,OAAO,WAAW,eAAe,MAAM,CAAC,CAAC,QAAQ,OAAO;CACzE,MAAM,EAAE,UAAU,OAAO,mBAAmB,eAAe,KAAK,CAAC,CAAC,QAAQ;CAC1E,OAAO,OAAO,QAAQ,IACpBA,QAAK,MAAM,OAAO;EAChB,cAAc;EACd,eAAe;CACjB,CAAC,CACH;AACF,CAAC;;AAGD,MAAa,gBAAgB,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,gBAAgB;CAC/E,MAAM,SAAS,OAAO;CACtB,IAAI,OAAO,OAAO,MAAM,GACtB,OAAO,OAAO,QAAQ,IAAI,oDAAoD;CAEhF,MAAM,OAAO,OAAO,iBAAiB,OAAO,KAAK;CACjD,IAAI,OAAO,OAAO,IAAI,GACpB,OAAO,OAAO,QAAQ,IAAI,2DAA2D;CAEvF,OAAO,OAAO,UAAU,OAAO,OAAO,KAAK,KAAK;AAClD,CAAC;;;;AE9BD,MAAM,UAAU,QAAQ,KAAK,aAAa,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,KACnE,QAAQ,gBACN,sGACF,CACF;AAEA,OAAO,WAAW,CAAC,CAAC,QAAQ,IAAI,SAAS,EAAWC,QAAiB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/msch",
3
- "version": "0.89.0",
3
+ "version": "0.89.1",
4
4
  "description": "masseater's check policy: points every finite value set and object shape at its one owner, and ships the oxlint preset of plugins and rules.",
5
5
  "keywords": [
6
6
  "lint",
@@ -106,7 +106,7 @@
106
106
  "@r_masseater/fu4": "^0.3.6",
107
107
  "@r_masseater/masseater-utils": "^0.1.3",
108
108
  "@r_masseater/oxlint-plugin-decision": "^0.9.1",
109
- "@r_masseater/oxlint-typed-rules": "^0.6.4",
109
+ "@r_masseater/oxlint-typed-rules": "^0.6.5",
110
110
  "@r_masseater/textlint-rule-preset-ja": "^0.3.3",
111
111
  "@r_masseater/wism": "^0.4.6",
112
112
  "@r_masseater/y8": "^0.7.5",
@@ -123,7 +123,7 @@
123
123
  "oxlint-plugin-eslint": "^1.95.0",
124
124
  "rolldown": "^1.3.4",
125
125
  "semver": "^7.8.6",
126
- "sql-parser-cst": "^0.45.1",
126
+ "sql-parser-cst": "^0.45.2",
127
127
  "textlint-filter-rule-comments": "^1.3.0",
128
128
  "textlint-rule-preset-ja-technical-writing": "^12.1.0",
129
129
  "toml-eslint-parser": "^1.0.3",