@graftland/cli 0.4.2 → 0.4.3
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.
- package/dist/Manage.d.ts +4 -3
- package/dist/Manage.d.ts.map +1 -1
- package/dist/Manage.js +18 -0
- package/dist/Manage.js.map +1 -1
- package/dist/bin.js +5 -2
- package/dist/bin.js.map +1 -1
- package/dist/internal/commandHost.js +1 -1
- package/dist/internal/schemaFile.js +115 -0
- package/dist/internal/schemaFile.js.map +1 -0
- package/dist/internal/schemaFileName.js +6 -0
- package/dist/internal/schemaFileName.js.map +1 -0
- package/package.json +6 -6
- package/schema.json +0 -2321
- package/src/Manage.ts +26 -0
- package/src/bin.ts +22 -1
- package/src/internal/schemaFile.ts +186 -0
- package/src/internal/schemaFileName.ts +2 -0
package/dist/Manage.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CommandConfigError } from "./Commands.js";
|
|
2
2
|
import { Config, Effect, FileSystem, Path } from "effect";
|
|
3
|
+
import { CliError } from "effect/cli";
|
|
3
4
|
import * as PackageManager from "@graftland/package-manager";
|
|
4
5
|
declare namespace Manage_d_exports {
|
|
5
6
|
export { add, addPlugin, remove };
|
|
6
7
|
}
|
|
7
|
-
export declare const add: (specs: readonly string[]) => Effect.Effect<void, Config.ConfigError | PackageManager.Error, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path>;
|
|
8
|
-
export declare const remove: (names: ReadonlyArray<string>) => Effect.Effect<void, Config.ConfigError | PackageManager.Error, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path>;
|
|
8
|
+
export declare const add: (specs: readonly string[]) => Effect.Effect<void, Config.ConfigError | CliError.UserError | PackageManager.Error, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path | import("effect/crypto/SecureRandom").SecureRandom>;
|
|
9
|
+
export declare const remove: (names: ReadonlyArray<string>) => Effect.Effect<void, Config.ConfigError | CliError.UserError | PackageManager.Error, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path | import("effect/crypto/SecureRandom").SecureRandom>;
|
|
9
10
|
/** Install a command plugin and explicitly enable its /cli entry. */
|
|
10
|
-
export declare const addPlugin: (name: string, global?: boolean | undefined) => Effect.Effect<void, CommandConfigError | Config.ConfigError | PackageManager.Error, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path>;
|
|
11
|
+
export declare const addPlugin: (name: string, global?: boolean | undefined) => Effect.Effect<void, CommandConfigError | Config.ConfigError | CliError.UserError | PackageManager.Error, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem | Path.Path | import("effect/crypto/SecureRandom").SecureRandom>;
|
|
11
12
|
export { Manage_d_exports };
|
|
12
13
|
//# sourceMappingURL=Manage.d.ts.map
|
package/dist/Manage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manage.d.ts","names":[],"sources":["../src/Manage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Manage.d.ts","names":[],"sources":["../src/Manage.ts"],"mappings":";;;;;;;qBA8Fa,MAAG,6BAAA,OAAA,aAAA,OAAA,cAAA,SAAA,YAAA,eAAA,oDAAA,sBAAA,WAAA,aAAA,KAAA,4CAAA;qBAgBH,SAAM,OAAW,0BAAqB,OAAA,aAAA,OAAA,cAAA,SAAA,YAAA,eAAA,oDAAA,sBAAA,WAAA,aAAA,KAAA,4CAAA;;qBAuDtC,YAAS,cAAA,iCAAA,OAAA,aAAA,qBAAA,OAAA,cAAA,SAAA,YAAA,eAAA,oDAAA,sBAAA,WAAA,aAAA,KAAA,4CAAA"}
|
package/dist/Manage.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __exportAll } from "./_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { CommandConfigError } from "./Commands.js";
|
|
3
3
|
import { home } from "./internal/commandConfig.js";
|
|
4
|
+
import { schemaFileName } from "./internal/schemaFileName.js";
|
|
4
5
|
import { Array, Config, Effect, FileSystem, Option, Path, Predicate, Record, Schema } from "effect";
|
|
6
|
+
import { CliError } from "effect/cli";
|
|
5
7
|
import * as Create from "@graftland/create";
|
|
6
8
|
import * as PackageManager from "@graftland/package-manager";
|
|
7
9
|
import { parseDocument } from "yaml";
|
|
@@ -28,6 +30,21 @@ const Spec = Schema.Union([Schema.TemplateLiteralParser([
|
|
|
28
30
|
Schema.String
|
|
29
31
|
]), PackageManager.PackageName]);
|
|
30
32
|
const decodeSpecs = Schema.decodeEffect(Schema.Array(Spec));
|
|
33
|
+
/**
|
|
34
|
+
* Regenerates the project's editor schema, but only when it has one, so that
|
|
35
|
+
* the plugins just added or removed are checked. Imports no plugin.
|
|
36
|
+
*/
|
|
37
|
+
const refreshSchema = Effect.fnUntraced(function* (directory) {
|
|
38
|
+
const fs = yield* FileSystem.FileSystem;
|
|
39
|
+
const path = yield* Path.Path;
|
|
40
|
+
const root = path.resolve(directory);
|
|
41
|
+
const file = path.join(root, schemaFileName);
|
|
42
|
+
if (!(yield* fs.exists(file))) return;
|
|
43
|
+
yield* (yield* Effect.promise(() => import("./internal/schemaFile.js")).pipe(Effect.uninterruptible)).write(root, file).pipe(Effect.mapError((cause) => CliError.UserError.make({
|
|
44
|
+
cause,
|
|
45
|
+
userMessage: `Dependencies changed, but ${file} was not regenerated: ${cause.message}`
|
|
46
|
+
})));
|
|
47
|
+
});
|
|
31
48
|
const install = Effect.fn("Manage.install")(function* (directory, changes) {
|
|
32
49
|
const decoded = yield* Schema.decodeEffect(PackageManager.Changes)(changes);
|
|
33
50
|
const userAgent = yield* Config.String("npm_config_user_agent").pipe(Config.withDefault(""));
|
|
@@ -36,6 +53,7 @@ const install = Effect.fn("Manage.install")(function* (directory, changes) {
|
|
|
36
53
|
userAgent
|
|
37
54
|
})).install(decoded);
|
|
38
55
|
yield* report(result);
|
|
56
|
+
yield* refreshSchema(directory);
|
|
39
57
|
});
|
|
40
58
|
const add = Effect.fn("Manage.add")(function* (specs) {
|
|
41
59
|
const decoded = yield* decodeSpecs(specs);
|
package/dist/Manage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manage.js","names":[],"sources":["../src/Manage.ts"],"sourcesContent":["/**\n * Changing a project's dependencies.\n */\nimport {\n\tArray,\n\tConfig,\n\tEffect,\n\tFileSystem,\n\tOption,\n\tPath,\n\tPredicate,\n\tRecord,\n\tSchema,\n} from \"effect\"\n\nimport * as Create from \"@graftland/create\"\nimport * as PackageManager from \"@graftland/package-manager\"\n\nimport { parseDocument, type Document } from \"yaml\"\n\nimport { CommandConfigError } from \"./Commands\"\nimport { home } from \"./internal/commandConfig\"\n\nconst report = (result: PackageManager.InstallResult) =>\n\tEffect.logInfo(\n\t\t`${result.agent}: ${result.added.length} added, ${result.updated.length} updated, ${result.removed.length} removed`,\n\t).pipe(\n\t\tEffect.andThen(\n\t\t\tOption.match(result.snapshotCleanupFailure, {\n\t\t\t\tonNone: () => Effect.void,\n\t\t\t\tonSome: ({ cause, snapshotDirectory }) =>\n\t\t\t\t\tEffect.logWarning(\n\t\t\t\t\t\t\"Installation committed; snapshot cleanup failed. Retry removing the retained snapshot.\",\n\t\t\t\t\t\tcause,\n\t\t\t\t\t\t{ snapshotDirectory },\n\t\t\t\t\t),\n\t\t\t}),\n\t\t),\n\t)\n\n/**\n * `name@range`, split at the last `@` so a scope's `@` stays in the name. A\n * bare name means the latest version.\n */\nconst Spec = Schema.Union([\n\tSchema.TemplateLiteralParser([\n\t\tPackageManager.PackageName,\n\t\t\"@\",\n\t\tSchema.String,\n\t]),\n\tPackageManager.PackageName,\n])\nconst decodeSpecs = Schema.decodeEffect(Schema.Array(Spec))\n\nconst install = Effect.fn(\"Manage.install\")(function* (\n\tdirectory: string,\n\tchanges: Readonly<Record<string, string | null>>,\n) {\n\tconst decoded = yield* Schema.decodeEffect(PackageManager.Changes)(changes)\n\t// Set by npm, pnpm and Yarn when they run graft, such as through `pnpm dlx`.\n\tconst userAgent = yield* Config.String(\"npm_config_user_agent\").pipe(\n\t\tConfig.withDefault(\"\"),\n\t)\n\tconst manager = yield* PackageManager.make({ directory, userAgent })\n\tconst result = yield* manager.install(decoded)\n\tyield* report(result)\n})\n\nexport const add = Effect.fn(\"Manage.add\")(function* (\n\tspecs: ReadonlyArray<string>,\n) {\n\tconst decoded = yield* decodeSpecs(specs)\n\tyield* install(\n\t\t\".\",\n\t\tRecord.fromEntries(\n\t\t\tArray.map(decoded, (spec) =>\n\t\t\t\tPredicate.isString(spec)\n\t\t\t\t\t? ([spec, \"latest\"] as const)\n\t\t\t\t\t: ([spec[0], spec[2]] as const),\n\t\t\t),\n\t\t),\n\t)\n})\n\nexport const remove = (names: ReadonlyArray<string>) =>\n\tinstall(\n\t\t\".\",\n\t\tRecord.fromEntries(Array.map(names, (name) => [name, null] as const)),\n\t)\n\nconst enabledConfig = Effect.fnUntraced(function* (\n\tfile: string,\n\tmodule: string,\n) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst text = (yield* fs.exists(file))\n\t\t? yield* fs.readFileString(file)\n\t\t: \"[]\\n\"\n\tconst document = yield* Effect.try({\n\t\ttry: () => {\n\t\t\tconst document: Document = parseDocument(text)\n\t\t\tconst error = document.errors[0]\n\t\t\tif (error !== undefined) throw error\n\t\t\tif (document.toJS() === null) document.contents = document.createNode([])\n\t\t\treturn document\n\t\t},\n\t\tcatch: (cause) => CommandConfigError.make({ file, cause }),\n\t})\n\tconst entries = yield* Schema.decodeUnknownEffect(\n\t\tSchema.Array(Schema.Unknown),\n\t)(document.toJS())\n\tconst existing = Array.findFirstIndex(\n\t\tentries,\n\t\t(entry) =>\n\t\t\tPredicate.hasProperty(entry, \"name\") &&\n\t\t\tentry.name === module &&\n\t\t\tPredicate.hasProperty(entry, \"cli\") &&\n\t\t\tentry.cli === true,\n\t)\n\treturn yield* Effect.try({\n\t\ttry: () => {\n\t\t\tif (Option.isSome(existing))\n\t\t\t\tdocument.setIn([existing.value, \"disabled\"], false)\n\t\t\telse document.add({ name: module, cli: true })\n\t\t\treturn document.toString()\n\t\t},\n\t\tcatch: (cause) => CommandConfigError.make({ file, cause }),\n\t})\n})\nconst prepareHome = Effect.fnUntraced(function* (directory: string) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst path = yield* Path.Path\n\tyield* fs.makeDirectory(directory, { recursive: true })\n\tconst manifest = path.join(directory, \"package.json\")\n\tif (!(yield* fs.exists(manifest)))\n\t\tyield* fs.writeFileString(manifest, '{\"private\":true,\"type\":\"module\"}\\n')\n}, Effect.uninterruptible)\n\n/** Install a command plugin and explicitly enable its /cli entry. */\nexport const addPlugin = Effect.fn(\"Manage.addPlugin\")(function* (\n\tname: string,\n\tglobal: boolean = false,\n) {\n\tconst path = yield* Path.Path\n\tconst fs = yield* FileSystem.FileSystem\n\tconst directory = global ? yield* home : path.resolve(\".\")\n\tconst packageName = Create.pluginPackage(name)\n\tconst module = `${packageName}/cli`\n\tconst file = path.join(directory, \"graft.yml\")\n\tconst text = yield* enabledConfig(file, module)\n\tif (global) yield* prepareHome(directory)\n\tyield* install(directory, Record.singleton(packageName, \"latest\"))\n\t// Once accepted, the native write must finish before command cleanup can proceed.\n\tyield* fs.writeFileString(file, text).pipe(Effect.uninterruptible)\n\tyield* Effect.logInfo(`Enabled ${module} in ${file}`)\n})\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Manage.js","names":[],"sources":["../src/Manage.ts"],"sourcesContent":["/**\n * Changing a project's dependencies.\n */\nimport {\n\tArray,\n\tConfig,\n\tEffect,\n\tFileSystem,\n\tOption,\n\tPath,\n\tPredicate,\n\tRecord,\n\tSchema,\n} from \"effect\"\nimport { CliError } from \"effect/cli\"\n\nimport * as Create from \"@graftland/create\"\nimport * as PackageManager from \"@graftland/package-manager\"\n\nimport { parseDocument, type Document } from \"yaml\"\n\nimport { CommandConfigError } from \"./Commands\"\nimport { home } from \"./internal/commandConfig\"\nimport { schemaFileName } from \"./internal/schemaFileName\"\n\nconst report = (result: PackageManager.InstallResult) =>\n\tEffect.logInfo(\n\t\t`${result.agent}: ${result.added.length} added, ${result.updated.length} updated, ${result.removed.length} removed`,\n\t).pipe(\n\t\tEffect.andThen(\n\t\t\tOption.match(result.snapshotCleanupFailure, {\n\t\t\t\tonNone: () => Effect.void,\n\t\t\t\tonSome: ({ cause, snapshotDirectory }) =>\n\t\t\t\t\tEffect.logWarning(\n\t\t\t\t\t\t\"Installation committed; snapshot cleanup failed. Retry removing the retained snapshot.\",\n\t\t\t\t\t\tcause,\n\t\t\t\t\t\t{ snapshotDirectory },\n\t\t\t\t\t),\n\t\t\t}),\n\t\t),\n\t)\n\n/**\n * `name@range`, split at the last `@` so a scope's `@` stays in the name. A\n * bare name means the latest version.\n */\nconst Spec = Schema.Union([\n\tSchema.TemplateLiteralParser([\n\t\tPackageManager.PackageName,\n\t\t\"@\",\n\t\tSchema.String,\n\t]),\n\tPackageManager.PackageName,\n])\nconst decodeSpecs = Schema.decodeEffect(Schema.Array(Spec))\n\n/**\n * Regenerates the project's editor schema, but only when it has one, so that\n * the plugins just added or removed are checked. Imports no plugin.\n */\nconst refreshSchema = Effect.fnUntraced(function* (directory: string) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst path = yield* Path.Path\n\tconst root = path.resolve(directory)\n\tconst file = path.join(root, schemaFileName)\n\tif (!(yield* fs.exists(file))) return\n\tconst EditorSchema = yield* Effect.promise(\n\t\t() => import(\"./internal/schemaFile\"),\n\t).pipe(Effect.uninterruptible)\n\tyield* EditorSchema.write(root, file).pipe(\n\t\tEffect.mapError((cause) =>\n\t\t\tCliError.UserError.make({\n\t\t\t\tcause,\n\t\t\t\tuserMessage: `Dependencies changed, but ${file} was not regenerated: ${cause.message}`,\n\t\t\t}),\n\t\t),\n\t)\n})\n\nconst install = Effect.fn(\"Manage.install\")(function* (\n\tdirectory: string,\n\tchanges: Readonly<Record<string, string | null>>,\n) {\n\tconst decoded = yield* Schema.decodeEffect(PackageManager.Changes)(changes)\n\t// Set by npm, pnpm and Yarn when they run graft, such as through `pnpm dlx`.\n\tconst userAgent = yield* Config.String(\"npm_config_user_agent\").pipe(\n\t\tConfig.withDefault(\"\"),\n\t)\n\tconst manager = yield* PackageManager.make({ directory, userAgent })\n\tconst result = yield* manager.install(decoded)\n\tyield* report(result)\n\tyield* refreshSchema(directory)\n})\n\nexport const add = Effect.fn(\"Manage.add\")(function* (\n\tspecs: ReadonlyArray<string>,\n) {\n\tconst decoded = yield* decodeSpecs(specs)\n\tyield* install(\n\t\t\".\",\n\t\tRecord.fromEntries(\n\t\t\tArray.map(decoded, (spec) =>\n\t\t\t\tPredicate.isString(spec)\n\t\t\t\t\t? ([spec, \"latest\"] as const)\n\t\t\t\t\t: ([spec[0], spec[2]] as const),\n\t\t\t),\n\t\t),\n\t)\n})\n\nexport const remove = (names: ReadonlyArray<string>) =>\n\tinstall(\n\t\t\".\",\n\t\tRecord.fromEntries(Array.map(names, (name) => [name, null] as const)),\n\t)\n\nconst enabledConfig = Effect.fnUntraced(function* (\n\tfile: string,\n\tmodule: string,\n) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst text = (yield* fs.exists(file))\n\t\t? yield* fs.readFileString(file)\n\t\t: \"[]\\n\"\n\tconst document = yield* Effect.try({\n\t\ttry: () => {\n\t\t\tconst document: Document = parseDocument(text)\n\t\t\tconst error = document.errors[0]\n\t\t\tif (error !== undefined) throw error\n\t\t\tif (document.toJS() === null) document.contents = document.createNode([])\n\t\t\treturn document\n\t\t},\n\t\tcatch: (cause) => CommandConfigError.make({ file, cause }),\n\t})\n\tconst entries = yield* Schema.decodeUnknownEffect(\n\t\tSchema.Array(Schema.Unknown),\n\t)(document.toJS())\n\tconst existing = Array.findFirstIndex(\n\t\tentries,\n\t\t(entry) =>\n\t\t\tPredicate.hasProperty(entry, \"name\") &&\n\t\t\tentry.name === module &&\n\t\t\tPredicate.hasProperty(entry, \"cli\") &&\n\t\t\tentry.cli === true,\n\t)\n\treturn yield* Effect.try({\n\t\ttry: () => {\n\t\t\tif (Option.isSome(existing))\n\t\t\t\tdocument.setIn([existing.value, \"disabled\"], false)\n\t\t\telse document.add({ name: module, cli: true })\n\t\t\treturn document.toString()\n\t\t},\n\t\tcatch: (cause) => CommandConfigError.make({ file, cause }),\n\t})\n})\nconst prepareHome = Effect.fnUntraced(function* (directory: string) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst path = yield* Path.Path\n\tyield* fs.makeDirectory(directory, { recursive: true })\n\tconst manifest = path.join(directory, \"package.json\")\n\tif (!(yield* fs.exists(manifest)))\n\t\tyield* fs.writeFileString(manifest, '{\"private\":true,\"type\":\"module\"}\\n')\n}, Effect.uninterruptible)\n\n/** Install a command plugin and explicitly enable its /cli entry. */\nexport const addPlugin = Effect.fn(\"Manage.addPlugin\")(function* (\n\tname: string,\n\tglobal: boolean = false,\n) {\n\tconst path = yield* Path.Path\n\tconst fs = yield* FileSystem.FileSystem\n\tconst directory = global ? yield* home : path.resolve(\".\")\n\tconst packageName = Create.pluginPackage(name)\n\tconst module = `${packageName}/cli`\n\tconst file = path.join(directory, \"graft.yml\")\n\tconst text = yield* enabledConfig(file, module)\n\tif (global) yield* prepareHome(directory)\n\tyield* install(directory, Record.singleton(packageName, \"latest\"))\n\t// Once accepted, the native write must finish before command cleanup can proceed.\n\tyield* fs.writeFileString(file, text).pipe(Effect.uninterruptible)\n\tyield* Effect.logInfo(`Enabled ${module} in ${file}`)\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,UAAU,WACf,OAAO,QACN,GAAG,OAAO,MAAM,IAAI,OAAO,MAAM,OAAO,UAAU,OAAO,QAAQ,OAAO,YAAY,OAAO,QAAQ,OAAO,SAC3G,CAAC,CAAC,KACD,OAAO,QACN,OAAO,MAAM,OAAO,wBAAwB;CAC3C,cAAc,OAAO;CACrB,SAAS,EAAE,OAAO,wBACjB,OAAO,WACN,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,WAAmB;CACnE,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,OAAO,GAAG,cAAc,WAAW,EAAE,WAAW,KAAK,CAAC;CACtD,MAAM,WAAW,KAAK,KAAK,WAAW,cAAc;CACpD,IAAI,EAAE,OAAO,GAAG,OAAO,QAAQ,IAC9B,OAAO,GAAG,gBAAgB,UAAU,0CAAoC;AAC1E,GAAG,OAAO,eAAe;;AAGzB,MAAa,YAAY,OAAO,GAAG,kBAAkB,CAAC,CAAC,WACtD,MACA,SAAkB,OACjB;CACD,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,YAAY,SAAS,OAAO,OAAO,KAAK,QAAQ,GAAG;CACzD,MAAM,cAAc,OAAO,cAAc,IAAI;CAC7C,MAAM,SAAS,GAAG,YAAY;CAC9B,MAAM,OAAO,KAAK,KAAK,WAAW,WAAW;CAC7C,MAAM,OAAO,OAAO,cAAc,MAAM,MAAM;CAC9C,IAAI,QAAQ,OAAO,YAAY,SAAS;CACxC,OAAO,QAAQ,WAAW,OAAO,UAAU,aAAa,QAAQ,CAAC;CAEjE,OAAO,GAAG,gBAAgB,MAAM,IAAI,CAAC,CAAC,KAAK,OAAO,eAAe;CACjE,OAAO,OAAO,QAAQ,WAAW,OAAO,MAAM,MAAM;AACrD,CAAC"}
|
package/dist/bin.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { version } from "./package.js";
|
|
3
3
|
import { platform } from "./Application.js";
|
|
4
4
|
import { output, run } from "./internal/commandHost.js";
|
|
5
|
+
import { schemaFileName } from "./internal/schemaFileName.js";
|
|
5
6
|
import { Array, Effect, Layer, Logger, Option, Stdio } from "effect";
|
|
7
|
+
import { Argument, CliError, Command, Flag } from "effect/cli";
|
|
6
8
|
import { NodeRuntime } from "@effect/platform-node";
|
|
7
9
|
import { Graft } from "@graftland/graft";
|
|
8
|
-
import { Argument, CliError, Command, Flag } from "effect/cli";
|
|
9
10
|
import { command } from "@graftland/create/Command";
|
|
10
11
|
// src/bin.ts
|
|
11
12
|
/**
|
|
@@ -34,6 +35,7 @@ const add = Command.make("add", {
|
|
|
34
35
|
return yield* Option.isSome(plugin) ? Manage.addPlugin(plugin.value, global) : Manage.add(packages);
|
|
35
36
|
})).pipe(Command.withDescription("Add dependencies, restoring the project if installing fails"));
|
|
36
37
|
const remove = Command.make("remove", { packages: Argument.variadic(Argument.String("package")) }, ({ packages }) => Effect.promise(() => import("./Manage.js")).pipe(Effect.uninterruptible, Effect.flatMap((Manage) => Manage.remove(packages)))).pipe(Command.withDescription("Remove dependencies, restoring the project if installing fails"));
|
|
38
|
+
const schema = Command.make("schema", { output: Flag.String("output").pipe(Flag.withAlias("o"), Flag.withDescription("Path of the schema file"), Flag.withDefault(schemaFileName)) }, ({ output }) => Effect.promise(() => import("./internal/schemaFile.js")).pipe(Effect.uninterruptible, Effect.flatMap((EditorSchema) => EditorSchema.write(".", output)))).pipe(Command.withDescription("Write the JSON Schema of graft.yml, with the config of installed plugins"));
|
|
37
39
|
const graft = Command.make("graft").pipe(Command.withDescription("Run and manage Graft applications"), Command.withSharedFlags({
|
|
38
40
|
stdio: Flag.Boolean("stdio").pipe(Flag.withDefault(false)),
|
|
39
41
|
noPlugins: Flag.Boolean("no-plugins").pipe(Flag.withDefault(false))
|
|
@@ -46,7 +48,8 @@ const program = Effect.gen(function* () {
|
|
|
46
48
|
start,
|
|
47
49
|
command,
|
|
48
50
|
add,
|
|
49
|
-
remove
|
|
51
|
+
remove,
|
|
52
|
+
schema
|
|
50
53
|
], graft, version, args).pipe(Effect.provideContext(context));
|
|
51
54
|
})), args);
|
|
52
55
|
});
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","names":["Host.output","Host.run","create"],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * The `graft` executable. Running this module starts the program.\n */\nimport { Array, Effect, Layer, Logger, Option, Stdio } from \"effect\"\nimport { Argument, CliError, Command, Flag } from \"effect/cli\"\nimport { NodeRuntime } from \"@effect/platform-node\"\n\nimport { command as create } from \"@graftland/create/Command\"\nimport { Graft } from \"@graftland/graft\"\n\nimport { version } from \"../package.json\" with { type: \"json\" }\nimport { platform } from \"./Application\"\nimport * as Host from \"./internal/commandHost\"\n\nconst start = Command.make(\n\t\"start\",\n\t{\n\t\tconfig: Argument.String(\"config\").pipe(\n\t\t\tArgument.withDescription(\"Path of the config file\"),\n\t\t\tArgument.withDefault(\"graft.yml\"),\n\t\t),\n\t\twatch: Flag.Boolean(\"watch\").pipe(\n\t\t\tFlag.withAlias(\"w\"),\n\t\t\tFlag.withDescription(\"Reload plugins and config when files change\"),\n\t\t\tFlag.withDefault(false),\n\t\t),\n\t\tenvFile: Flag.String(\"env-file\").pipe(\n\t\t\tFlag.withDescription(\n\t\t\t\t\"Read variables for !env from a .env file; the process environment takes precedence\",\n\t\t\t),\n\t\t\tFlag.optional,\n\t\t),\n\t\tenvDir: Flag.String(\"env-dir\").pipe(\n\t\t\tFlag.withDescription(\n\t\t\t\t\"Read variables for !env from a directory with one file per variable, such as /run/secrets\",\n\t\t\t),\n\t\t\tFlag.optional,\n\t\t),\n\t},\n\t(options) =>\n\t\tEffect.promise(() => import(\"./Start\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t\tEffect.flatMap((Start) =>\n\t\t\t\tStart.run({\n\t\t\t\t\t...options,\n\t\t\t\t\tenvFile: Option.getOrUndefined(options.envFile),\n\t\t\t\t\tenvDir: Option.getOrUndefined(options.envDir),\n\t\t\t\t}),\n\t\t\t),\n\t\t),\n).pipe(\n\tCommand.withDescription(\"Run the application described by a config file\"),\n)\n\nconst add = Command.make(\n\t\"add\",\n\t{\n\t\tpackages: Argument.variadic(Argument.String(\"package\")),\n\t\tplugin: Flag.String(\"plugin\").pipe(Flag.optional),\n\t\tglobal: Flag.Boolean(\"global\").pipe(Flag.withDefault(false)),\n\t},\n\tEffect.fnUntraced(function* ({ packages, plugin, global }) {\n\t\tif (\n\t\t\t(global && Option.isNone(plugin)) ||\n\t\t\t(Option.isSome(plugin) && packages.length > 0)\n\t\t)\n\t\t\treturn yield* CliError.UserError.make({\n\t\t\t\tcause: \"Conflicting install options\",\n\t\t\t\tuserMessage:\n\t\t\t\t\t\"Use add --plugin <name> [--global] without package arguments\",\n\t\t\t})\n\t\tconst Manage = yield* Effect.promise(() => import(\"./Manage\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t)\n\t\treturn yield* Option.isSome(plugin)\n\t\t\t? Manage.addPlugin(plugin.value, global)\n\t\t\t: Manage.add(packages)\n\t}),\n).pipe(\n\tCommand.withDescription(\n\t\t\"Add dependencies, restoring the project if installing fails\",\n\t),\n)\n\nconst remove = Command.make(\n\t\"remove\",\n\t{ packages: Argument.variadic(Argument.String(\"package\")) },\n\t({ packages }) =>\n\t\tEffect.promise(() => import(\"./Manage\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t\tEffect.flatMap((Manage) => Manage.remove(packages)),\n\t\t),\n).pipe(\n\tCommand.withDescription(\n\t\t\"Remove dependencies, restoring the project if installing fails\",\n\t),\n)\n\nconst graft = Command.make(\"graft\").pipe(\n\tCommand.withDescription(\"Run and manage Graft applications\"),\n\tCommand.withSharedFlags({\n\t\tstdio: Flag.Boolean(\"stdio\").pipe(Flag.withDefault(false)),\n\t\tnoPlugins: Flag.Boolean(\"no-plugins\").pipe(Flag.withDefault(false)),\n\t}),\n)\n\nconst program = Effect.gen(function* () {\n\tconst stdio = yield* Stdio.Stdio\n\tconst args = yield* stdio.args\n\treturn yield* Host.output(\n\t\tEffect.scoped(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst context = yield* Layer.build(Graft.layer)\n\t\t\t\treturn yield* Host.run(\n\t\t\t\t\t[start, create, add, remove],\n\t\t\t\t\tgraft,\n\t\t\t\t\tversion,\n\t\t\t\t\targs,\n\t\t\t\t).pipe(Effect.provideContext(context))\n\t\t\t}),\n\t\t),\n\t\targs,\n\t)\n})\nNodeRuntime.runMain(\n\tEffect.scoped(\n\t\tEffect.gen(function* () {\n\t\t\tconst context = yield* Layer.build(platform)\n\t\t\treturn yield* program.pipe(Effect.provideContext(context))\n\t\t}),\n\t).pipe(\n\t\t(effect) =>\n\t\t\tEffect.withFiber((main) =>\n\t\t\t\teffect.pipe(\n\t\t\t\t\tEffect.tapCause((cause) =>\n\t\t\t\t\t\tArray.every(\n\t\t\t\t\t\t\tcause.reasons,\n\t\t\t\t\t\t\t(reason) =>\n\t\t\t\t\t\t\t\treason._tag === \"Interrupt\" && reason.fiberId === main.id,\n\t\t\t\t\t\t) ||\n\t\t\t\t\t\tArray.every(\n\t\t\t\t\t\t\tcause.reasons,\n\t\t\t\t\t\t\t(reason) =>\n\t\t\t\t\t\t\t\treason._tag === \"Fail\" && CliError.isCliError(reason.error),\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t? Effect.void\n\t\t\t\t\t\t\t: Effect.logError(cause),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tEffect.provideService(Logger.LogToStderr, true),\n\t),\n\t{ disableErrorReporting: true },\n)\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bin.js","names":["Host.output","Host.run","create"],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * The `graft` executable. Running this module starts the program.\n */\nimport { Array, Effect, Layer, Logger, Option, Stdio } from \"effect\"\nimport { Argument, CliError, Command, Flag } from \"effect/cli\"\nimport { NodeRuntime } from \"@effect/platform-node\"\n\nimport { command as create } from \"@graftland/create/Command\"\nimport { Graft } from \"@graftland/graft\"\n\nimport { version } from \"../package.json\" with { type: \"json\" }\nimport { platform } from \"./Application\"\nimport * as Host from \"./internal/commandHost\"\nimport { schemaFileName } from \"./internal/schemaFileName\"\n\nconst start = Command.make(\n\t\"start\",\n\t{\n\t\tconfig: Argument.String(\"config\").pipe(\n\t\t\tArgument.withDescription(\"Path of the config file\"),\n\t\t\tArgument.withDefault(\"graft.yml\"),\n\t\t),\n\t\twatch: Flag.Boolean(\"watch\").pipe(\n\t\t\tFlag.withAlias(\"w\"),\n\t\t\tFlag.withDescription(\"Reload plugins and config when files change\"),\n\t\t\tFlag.withDefault(false),\n\t\t),\n\t\tenvFile: Flag.String(\"env-file\").pipe(\n\t\t\tFlag.withDescription(\n\t\t\t\t\"Read variables for !env from a .env file; the process environment takes precedence\",\n\t\t\t),\n\t\t\tFlag.optional,\n\t\t),\n\t\tenvDir: Flag.String(\"env-dir\").pipe(\n\t\t\tFlag.withDescription(\n\t\t\t\t\"Read variables for !env from a directory with one file per variable, such as /run/secrets\",\n\t\t\t),\n\t\t\tFlag.optional,\n\t\t),\n\t},\n\t(options) =>\n\t\tEffect.promise(() => import(\"./Start\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t\tEffect.flatMap((Start) =>\n\t\t\t\tStart.run({\n\t\t\t\t\t...options,\n\t\t\t\t\tenvFile: Option.getOrUndefined(options.envFile),\n\t\t\t\t\tenvDir: Option.getOrUndefined(options.envDir),\n\t\t\t\t}),\n\t\t\t),\n\t\t),\n).pipe(\n\tCommand.withDescription(\"Run the application described by a config file\"),\n)\n\nconst add = Command.make(\n\t\"add\",\n\t{\n\t\tpackages: Argument.variadic(Argument.String(\"package\")),\n\t\tplugin: Flag.String(\"plugin\").pipe(Flag.optional),\n\t\tglobal: Flag.Boolean(\"global\").pipe(Flag.withDefault(false)),\n\t},\n\tEffect.fnUntraced(function* ({ packages, plugin, global }) {\n\t\tif (\n\t\t\t(global && Option.isNone(plugin)) ||\n\t\t\t(Option.isSome(plugin) && packages.length > 0)\n\t\t)\n\t\t\treturn yield* CliError.UserError.make({\n\t\t\t\tcause: \"Conflicting install options\",\n\t\t\t\tuserMessage:\n\t\t\t\t\t\"Use add --plugin <name> [--global] without package arguments\",\n\t\t\t})\n\t\tconst Manage = yield* Effect.promise(() => import(\"./Manage\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t)\n\t\treturn yield* Option.isSome(plugin)\n\t\t\t? Manage.addPlugin(plugin.value, global)\n\t\t\t: Manage.add(packages)\n\t}),\n).pipe(\n\tCommand.withDescription(\n\t\t\"Add dependencies, restoring the project if installing fails\",\n\t),\n)\n\nconst remove = Command.make(\n\t\"remove\",\n\t{ packages: Argument.variadic(Argument.String(\"package\")) },\n\t({ packages }) =>\n\t\tEffect.promise(() => import(\"./Manage\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t\tEffect.flatMap((Manage) => Manage.remove(packages)),\n\t\t),\n).pipe(\n\tCommand.withDescription(\n\t\t\"Remove dependencies, restoring the project if installing fails\",\n\t),\n)\n\nconst schema = Command.make(\n\t\"schema\",\n\t{\n\t\toutput: Flag.String(\"output\").pipe(\n\t\t\tFlag.withAlias(\"o\"),\n\t\t\tFlag.withDescription(\"Path of the schema file\"),\n\t\t\tFlag.withDefault(schemaFileName),\n\t\t),\n\t},\n\t({ output }) =>\n\t\tEffect.promise(() => import(\"./internal/schemaFile\")).pipe(\n\t\t\tEffect.uninterruptible,\n\t\t\tEffect.flatMap((EditorSchema) => EditorSchema.write(\".\", output)),\n\t\t),\n).pipe(\n\tCommand.withDescription(\n\t\t\"Write the JSON Schema of graft.yml, with the config of installed plugins\",\n\t),\n)\n\nconst graft = Command.make(\"graft\").pipe(\n\tCommand.withDescription(\"Run and manage Graft applications\"),\n\tCommand.withSharedFlags({\n\t\tstdio: Flag.Boolean(\"stdio\").pipe(Flag.withDefault(false)),\n\t\tnoPlugins: Flag.Boolean(\"no-plugins\").pipe(Flag.withDefault(false)),\n\t}),\n)\n\nconst program = Effect.gen(function* () {\n\tconst stdio = yield* Stdio.Stdio\n\tconst args = yield* stdio.args\n\treturn yield* Host.output(\n\t\tEffect.scoped(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst context = yield* Layer.build(Graft.layer)\n\t\t\t\treturn yield* Host.run(\n\t\t\t\t\t[start, create, add, remove, schema],\n\t\t\t\t\tgraft,\n\t\t\t\t\tversion,\n\t\t\t\t\targs,\n\t\t\t\t).pipe(Effect.provideContext(context))\n\t\t\t}),\n\t\t),\n\t\targs,\n\t)\n})\nNodeRuntime.runMain(\n\tEffect.scoped(\n\t\tEffect.gen(function* () {\n\t\t\tconst context = yield* Layer.build(platform)\n\t\t\treturn yield* program.pipe(Effect.provideContext(context))\n\t\t}),\n\t).pipe(\n\t\t(effect) =>\n\t\t\tEffect.withFiber((main) =>\n\t\t\t\teffect.pipe(\n\t\t\t\t\tEffect.tapCause((cause) =>\n\t\t\t\t\t\tArray.every(\n\t\t\t\t\t\t\tcause.reasons,\n\t\t\t\t\t\t\t(reason) =>\n\t\t\t\t\t\t\t\treason._tag === \"Interrupt\" && reason.fiberId === main.id,\n\t\t\t\t\t\t) ||\n\t\t\t\t\t\tArray.every(\n\t\t\t\t\t\t\tcause.reasons,\n\t\t\t\t\t\t\t(reason) =>\n\t\t\t\t\t\t\t\treason._tag === \"Fail\" && CliError.isCliError(reason.error),\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t? Effect.void\n\t\t\t\t\t\t\t: Effect.logError(cause),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tEffect.provideService(Logger.LogToStderr, true),\n\t),\n\t{ disableErrorReporting: true },\n)\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,QAAQ,QAAQ,KACrB,SACA;CACC,QAAQ,SAAS,OAAO,QAAQ,CAAC,CAAC,KACjC,SAAS,gBAAgB,yBAAyB,GAClD,SAAS,YAAY,WAAW,CACjC;CACA,OAAO,KAAK,QAAQ,OAAO,CAAC,CAAC,KAC5B,KAAK,UAAU,GAAG,GAClB,KAAK,gBAAgB,6CAA6C,GAClE,KAAK,YAAY,KAAK,CACvB;CACA,SAAS,KAAK,OAAO,UAAU,CAAC,CAAC,KAChC,KAAK,gBACJ,oFACD,GACA,KAAK,QACN;CACA,QAAQ,KAAK,OAAO,SAAS,CAAC,CAAC,KAC9B,KA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zD,KACA,MAAM,MACL,MAAM,UACL,WACA,OAAO,SAAS,UAAU,SAAS,WAAW,OAAO,KAAK,CAC5D,IACG,OAAO,OACP,OAAO,SAAS,KAAK,CACzB,CACD,CACD,GACD,OAAO,eAAe,OAAO,aAAa,IAAI,CAC/C,GACA,EAAE,uBAAuB,KAAK,CAC/B"}
|
|
@@ -5,8 +5,8 @@ import { erase, make } from "./commandRegistry.js";
|
|
|
5
5
|
import { make as make$1 } from "./importer.js";
|
|
6
6
|
import { reserve } from "./protocolOutput.js";
|
|
7
7
|
import { Array, Cause, Console, Effect, Option, Path, Schema, Stream, String } from "effect";
|
|
8
|
-
import { Graft, Plugin } from "@graftland/graft";
|
|
9
8
|
import { CliError, CliOutput, Command } from "effect/cli";
|
|
9
|
+
import { Graft, Plugin } from "@graftland/graft";
|
|
10
10
|
// src/internal/commandHost.ts
|
|
11
11
|
var CommandPluginError = class extends Schema.TaggedError()("CommandPluginError", {
|
|
12
12
|
plugin: Schema.String,
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { make } from "./configSchema.js";
|
|
2
|
+
import { make as make$1 } from "./importer.js";
|
|
3
|
+
import { Array, Effect, FileSystem, Option, Path, Predicate, Record, Schema } from "effect";
|
|
4
|
+
// src/internal/schemaFile.ts
|
|
5
|
+
/** Composes the editor schema of a project's config file from its installed plugins. */
|
|
6
|
+
/** A dependency's `./schema` export could not be read. */
|
|
7
|
+
var SchemaRegistrationError = class extends Schema.TaggedError()("SchemaRegistrationError", {
|
|
8
|
+
packageName: Schema.String,
|
|
9
|
+
detail: Schema.String,
|
|
10
|
+
cause: Schema.optionalKey(Schema.Unknown)
|
|
11
|
+
}) {
|
|
12
|
+
get message() {
|
|
13
|
+
return `${this.packageName}/schema: ${this.detail}`;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const Dependencies = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
17
|
+
const ProjectManifest = Schema.fromJsonString(Schema.Struct({
|
|
18
|
+
dependencies: Dependencies,
|
|
19
|
+
devDependencies: Dependencies,
|
|
20
|
+
optionalDependencies: Dependencies
|
|
21
|
+
}));
|
|
22
|
+
const InstalledManifest = Schema.fromJsonString(Schema.Struct({
|
|
23
|
+
exports: Schema.optionalKey(Schema.Unknown),
|
|
24
|
+
dependencies: Dependencies,
|
|
25
|
+
peerDependencies: Dependencies
|
|
26
|
+
}));
|
|
27
|
+
const Registrations = Schema.Array(Schema.Struct({
|
|
28
|
+
names: Schema.Array(Schema.String),
|
|
29
|
+
schema: Schema.Record(Schema.String, Schema.Unknown),
|
|
30
|
+
required: Schema.optionalKey(Schema.Boolean)
|
|
31
|
+
}));
|
|
32
|
+
/**
|
|
33
|
+
* The manifest of an installed package, looked up as Node does: in
|
|
34
|
+
* `node_modules` of the directory and then of each parent, so hoisted
|
|
35
|
+
* workspace installs are found.
|
|
36
|
+
*/
|
|
37
|
+
const installedManifest = (directory, packageName) => Effect.gen(function* () {
|
|
38
|
+
const fs = yield* FileSystem.FileSystem;
|
|
39
|
+
const path = yield* Path.Path;
|
|
40
|
+
const file = path.join(directory, "node_modules", packageName, "package.json");
|
|
41
|
+
if (yield* fs.exists(file)) return Option.some(file);
|
|
42
|
+
const parent = path.dirname(directory);
|
|
43
|
+
return parent === directory ? Option.none() : yield* installedManifest(parent, packageName);
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Whether an installed dependency is a plugin package that exports `./schema`,
|
|
47
|
+
* read without importing it. Other packages, such as `effect`, may export a
|
|
48
|
+
* `./schema` of their own.
|
|
49
|
+
*/
|
|
50
|
+
const exportsSchema = Effect.fnUntraced(function* (directory, packageName) {
|
|
51
|
+
const fs = yield* FileSystem.FileSystem;
|
|
52
|
+
const file = yield* installedManifest(directory, packageName);
|
|
53
|
+
if (Option.isNone(file)) {
|
|
54
|
+
yield* Effect.logWarning(`${packageName} is not installed; its config is left open`);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const text = yield* fs.readFileString(file.value);
|
|
58
|
+
const manifest = yield* Schema.decodeEffect(InstalledManifest)(text);
|
|
59
|
+
return Predicate.hasProperty(manifest.exports, "./schema") && (Record.has(manifest.dependencies ?? {}, "@graftland/graft") || Record.has(manifest.peerDependencies ?? {}, "@graftland/graft"));
|
|
60
|
+
});
|
|
61
|
+
const load = Effect.fnUntraced(function* (importer, packageName) {
|
|
62
|
+
const failed = (detail) => (cause) => SchemaRegistrationError.make({
|
|
63
|
+
packageName,
|
|
64
|
+
detail,
|
|
65
|
+
cause
|
|
66
|
+
});
|
|
67
|
+
const module = yield* Effect.tryPromise({
|
|
68
|
+
try: () => importer(`${packageName}/schema`),
|
|
69
|
+
catch: failed("cannot be imported")
|
|
70
|
+
});
|
|
71
|
+
if (!Predicate.hasProperty(module, "entries") || !Predicate.isFunction(module.entries)) return yield* SchemaRegistrationError.make({
|
|
72
|
+
packageName,
|
|
73
|
+
detail: "does not export an entries function"
|
|
74
|
+
});
|
|
75
|
+
const entries = module.entries;
|
|
76
|
+
const value = yield* Effect.try({
|
|
77
|
+
try: () => entries(),
|
|
78
|
+
catch: failed("entries() threw")
|
|
79
|
+
});
|
|
80
|
+
return yield* Schema.decodeUnknownEffect(Registrations)(value).pipe(Effect.mapError(failed("entries() returned invalid registrations")));
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* The registrations exported as `./schema` by the dependencies in the
|
|
84
|
+
* project's package.json. Only these modules are imported, never the plugins.
|
|
85
|
+
*/
|
|
86
|
+
const registrations = Effect.fn("EditorSchema.registrations")(function* (directory) {
|
|
87
|
+
const fs = yield* FileSystem.FileSystem;
|
|
88
|
+
const path = yield* Path.Path;
|
|
89
|
+
const text = yield* fs.readFileString(path.join(directory, "package.json"));
|
|
90
|
+
const manifest = yield* Schema.decodeEffect(ProjectManifest)(text);
|
|
91
|
+
const names = Array.dedupe(Array.flatMap([
|
|
92
|
+
manifest.dependencies,
|
|
93
|
+
manifest.devDependencies,
|
|
94
|
+
manifest.optionalDependencies
|
|
95
|
+
], (dependencies) => Record.keys(dependencies ?? {})));
|
|
96
|
+
const plugins = yield* Effect.filter(names, (name) => exportsSchema(directory, name));
|
|
97
|
+
const importer = yield* make$1(directory);
|
|
98
|
+
const loaded = yield* Effect.forEach(plugins, (name) => load(importer, name));
|
|
99
|
+
return {
|
|
100
|
+
plugins,
|
|
101
|
+
entries: Array.flatten(loaded)
|
|
102
|
+
};
|
|
103
|
+
}, Effect.scoped);
|
|
104
|
+
const encode = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown, { space: " " }));
|
|
105
|
+
/** Writes the editor schema for the project in a directory. */
|
|
106
|
+
const write = Effect.fn("EditorSchema.write")(function* (directory, output) {
|
|
107
|
+
const fs = yield* FileSystem.FileSystem;
|
|
108
|
+
const { plugins, entries } = yield* registrations(directory);
|
|
109
|
+
const text = yield* encode(make(entries));
|
|
110
|
+
yield* fs.writeFileString(output, text + "\n");
|
|
111
|
+
yield* Effect.logInfo(plugins.length === 0 ? `Wrote ${output}; no dependency exports ./schema` : `Wrote ${output} with ${Array.join(plugins, ", ")}`);
|
|
112
|
+
});
|
|
113
|
+
export { SchemaRegistrationError, registrations, write };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=schemaFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaFile.js","names":["Importer.make"],"sources":["../../src/internal/schemaFile.ts"],"sourcesContent":["/** Composes the editor schema of a project's config file from its installed plugins. */\nimport {\n\tArray,\n\tEffect,\n\tFileSystem,\n\tOption,\n\tPath,\n\tPredicate,\n\tRecord,\n\tSchema,\n\ttype PlatformError,\n} from \"effect\"\n\nimport { make } from \"./configSchema\"\nimport * as Importer from \"./importer\"\n\n/** A dependency's `./schema` export could not be read. */\nexport class SchemaRegistrationError extends Schema.TaggedError<\n\tSchemaRegistrationError,\n\t{ readonly brand: unique symbol }\n>()(\"SchemaRegistrationError\", {\n\tpackageName: Schema.String,\n\tdetail: Schema.String,\n\tcause: Schema.optionalKey(Schema.Unknown),\n}) {\n\toverride get message() {\n\t\treturn `${this.packageName}/schema: ${this.detail}`\n\t}\n}\n\nconst Dependencies = Schema.optionalKey(\n\tSchema.Record(Schema.String, Schema.String),\n)\nconst ProjectManifest = Schema.fromJsonString(\n\tSchema.Struct({\n\t\tdependencies: Dependencies,\n\t\tdevDependencies: Dependencies,\n\t\toptionalDependencies: Dependencies,\n\t}),\n)\nconst InstalledManifest = Schema.fromJsonString(\n\tSchema.Struct({\n\t\texports: Schema.optionalKey(Schema.Unknown),\n\t\tdependencies: Dependencies,\n\t\tpeerDependencies: Dependencies,\n\t}),\n)\nconst Registrations = Schema.Array(\n\tSchema.Struct({\n\t\tnames: Schema.Array(Schema.String),\n\t\tschema: Schema.Record(Schema.String, Schema.Unknown),\n\t\trequired: Schema.optionalKey(Schema.Boolean),\n\t}),\n)\n\n/**\n * The manifest of an installed package, looked up as Node does: in\n * `node_modules` of the directory and then of each parent, so hoisted\n * workspace installs are found.\n */\nconst installedManifest = (\n\tdirectory: string,\n\tpackageName: string,\n): Effect.Effect<\n\tOption.Option<string>,\n\tPlatformError.PlatformError,\n\tFileSystem.FileSystem | Path.Path\n> =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem\n\t\tconst path = yield* Path.Path\n\t\tconst file = path.join(\n\t\t\tdirectory,\n\t\t\t\"node_modules\",\n\t\t\tpackageName,\n\t\t\t\"package.json\",\n\t\t)\n\t\tif (yield* fs.exists(file)) return Option.some(file)\n\t\tconst parent = path.dirname(directory)\n\t\treturn parent === directory\n\t\t\t? Option.none()\n\t\t\t: yield* installedManifest(parent, packageName)\n\t})\n\n/**\n * Whether an installed dependency is a plugin package that exports `./schema`,\n * read without importing it. Other packages, such as `effect`, may export a\n * `./schema` of their own.\n */\nconst exportsSchema = Effect.fnUntraced(function* (\n\tdirectory: string,\n\tpackageName: string,\n) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst file = yield* installedManifest(directory, packageName)\n\tif (Option.isNone(file)) {\n\t\tyield* Effect.logWarning(\n\t\t\t`${packageName} is not installed; its config is left open`,\n\t\t)\n\t\treturn false\n\t}\n\tconst text = yield* fs.readFileString(file.value)\n\tconst manifest = yield* Schema.decodeEffect(InstalledManifest)(text)\n\treturn (\n\t\tPredicate.hasProperty(manifest.exports, \"./schema\") &&\n\t\t(Record.has(manifest.dependencies ?? {}, \"@graftland/graft\") ||\n\t\t\tRecord.has(manifest.peerDependencies ?? {}, \"@graftland/graft\"))\n\t)\n})\n\nconst load = Effect.fnUntraced(function* (\n\timporter: (specifier: string) => Promise<unknown>,\n\tpackageName: string,\n) {\n\tconst failed = (detail: string) => (cause: unknown) =>\n\t\tSchemaRegistrationError.make({ packageName, detail, cause })\n\tconst module = yield* Effect.tryPromise({\n\t\ttry: () => importer(`${packageName}/schema`),\n\t\tcatch: failed(\"cannot be imported\"),\n\t})\n\tif (\n\t\t!Predicate.hasProperty(module, \"entries\") ||\n\t\t!Predicate.isFunction(module.entries)\n\t)\n\t\treturn yield* SchemaRegistrationError.make({\n\t\t\tpackageName,\n\t\t\tdetail: \"does not export an entries function\",\n\t\t})\n\tconst entries = module.entries\n\tconst value = yield* Effect.try({\n\t\ttry: () => entries(),\n\t\tcatch: failed(\"entries() threw\"),\n\t})\n\treturn yield* Schema.decodeUnknownEffect(Registrations)(value).pipe(\n\t\tEffect.mapError(failed(\"entries() returned invalid registrations\")),\n\t)\n})\n\n/**\n * The registrations exported as `./schema` by the dependencies in the\n * project's package.json. Only these modules are imported, never the plugins.\n */\nexport const registrations = Effect.fn(\"EditorSchema.registrations\")(function* (\n\tdirectory: string,\n) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst path = yield* Path.Path\n\tconst text = yield* fs.readFileString(path.join(directory, \"package.json\"))\n\tconst manifest = yield* Schema.decodeEffect(ProjectManifest)(text)\n\tconst names = Array.dedupe(\n\t\tArray.flatMap(\n\t\t\t[\n\t\t\t\tmanifest.dependencies,\n\t\t\t\tmanifest.devDependencies,\n\t\t\t\tmanifest.optionalDependencies,\n\t\t\t],\n\t\t\t(dependencies) => Record.keys(dependencies ?? {}),\n\t\t),\n\t)\n\tconst plugins = yield* Effect.filter(names, (name) =>\n\t\texportsSchema(directory, name),\n\t)\n\tconst importer = yield* Importer.make(directory)\n\tconst loaded = yield* Effect.forEach(plugins, (name) => load(importer, name))\n\treturn { plugins, entries: Array.flatten(loaded) }\n}, Effect.scoped)\n\nconst encode = Schema.encodeEffect(\n\tSchema.fromJsonString(Schema.Unknown, { space: \"\\t\" }),\n)\n\n/** Writes the editor schema for the project in a directory. */\nexport const write = Effect.fn(\"EditorSchema.write\")(function* (\n\tdirectory: string,\n\toutput: string,\n) {\n\tconst fs = yield* FileSystem.FileSystem\n\tconst { plugins, entries } = yield* registrations(directory)\n\tconst text = yield* encode(make(entries))\n\tyield* fs.writeFileString(output, text + \"\\n\")\n\tyield* Effect.logInfo(\n\t\tplugins.length === 0\n\t\t\t? `Wrote ${output}; no dependency exports ./schema`\n\t\t\t: `Wrote ${output} with ${Array.join(plugins, \", \")}`,\n\t)\n})\n"],"mappings":";;;;;;AAiBA,IAAa,0BAAb,cAA6C,OAAO,YAGlD,CAAC,CAAC,2BAA2B;CAC9B,aAAa,OAAO;CACpB,QAAQ,OAAO;CACf,OAAO,OAAO,YAAY,OAAO,OAAO;AACzC,CAAC,CAAC,CAAC;CACF,IAAa,UAAU;EACtB,OAAO,GAAG,KAAK,YAAY,WAAW,KAAK;CAC5C;AACD;AAEA,MAAM,eAAe,OAAO,YAC3B,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,CAC3C;AACA,MAAM,kBAAkB,OAAO,eAC9B,OAAO,OAAO;CACb,cAAc;CACd,iBAAiB;CACjB,sBAAsB;AACvB,CAAC,CACF;AACA,MAAM,oBAAoB,OAAO,eAChC,OAAO,OAAO;CACb,SAAS,OAAO,YAAY,OAAO,OAAO;CAC1C,cAAc;CACd,kBAAkB;AACnB,CAAC,CACF;AACA,MAAM,gBAAgB,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AAW;CAC7B,MAAM,EAAE,SAAS,YAAY,OAAO,cAAc,SAAS;CAC3D,MAAM,OAAO,OAAO,OAAO,KAAK,OAAO,CAAC;CACxC,OAAO,GAAG,gBAAgB,QAAQ,OAAO,IAAI;CAC7C,OAAO,OAAO,QACb,QAAQ,WAAW,IAChB,SAAS,OAAO,oCAChB,SAAS,OAAO,QAAQ,MAAM,KAAK,SAAS,IAAI,GACpD;AACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaFileName.js","names":[],"sources":["../../src/internal/schemaFileName.ts"],"sourcesContent":["/** The editor schema that `graft schema` writes, and that add, remove and create keep current. */\nexport const schemaFileName = \"graft.schema.json\"\n"],"mappings":";;AACA,MAAa,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graftland/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.19.0"
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"vitest": "5.1.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@graftland/graft": "0.4.
|
|
41
|
-
"@graftland/loader": "0.4.
|
|
42
|
-
"@graftland/hmr": "0.4.
|
|
43
|
-
"@graftland/create": "0.4.
|
|
44
|
-
"@graftland/package-manager": "0.4.
|
|
40
|
+
"@graftland/graft": "0.4.3",
|
|
41
|
+
"@graftland/loader": "0.4.3",
|
|
42
|
+
"@graftland/hmr": "0.4.3",
|
|
43
|
+
"@graftland/create": "0.4.3",
|
|
44
|
+
"@graftland/package-manager": "0.4.3",
|
|
45
45
|
"@effect/platform-node": "4.1.2",
|
|
46
46
|
"yaml": "2.9.1"
|
|
47
47
|
},
|