repopo 0.2.2

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/LICENSE +21 -0
  3. package/README.md +103 -0
  4. package/THIRD-PARTY-LICENSES.txt +198 -0
  5. package/bin/dev.cmd +3 -0
  6. package/bin/dev.js +5 -0
  7. package/bin/run.cmd +3 -0
  8. package/bin/run.js +5 -0
  9. package/esm/commands/check.d.ts +46 -0
  10. package/esm/commands/check.d.ts.map +1 -0
  11. package/esm/commands/check.js +330 -0
  12. package/esm/commands/check.js.map +1 -0
  13. package/esm/config.d.ts +35 -0
  14. package/esm/config.d.ts.map +1 -0
  15. package/esm/config.js +6 -0
  16. package/esm/config.js.map +1 -0
  17. package/esm/index.d.ts +6 -0
  18. package/esm/index.d.ts.map +1 -0
  19. package/esm/index.js +3 -0
  20. package/esm/index.js.map +1 -0
  21. package/esm/policies/NoJsFileExtensions.d.ts +10 -0
  22. package/esm/policies/NoJsFileExtensions.d.ts.map +1 -0
  23. package/esm/policies/NoJsFileExtensions.js +23 -0
  24. package/esm/policies/NoJsFileExtensions.js.map +1 -0
  25. package/esm/policies/PackageJsonProperties.d.ts +21 -0
  26. package/esm/policies/PackageJsonProperties.d.ts.map +1 -0
  27. package/esm/policies/PackageJsonProperties.js +45 -0
  28. package/esm/policies/PackageJsonProperties.js.map +1 -0
  29. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts +7 -0
  30. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -0
  31. package/esm/policies/PackageJsonRepoDirectoryProperty.js +48 -0
  32. package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -0
  33. package/esm/policies/PackageJsonSortedPolicy.d.ts +6 -0
  34. package/esm/policies/PackageJsonSortedPolicy.d.ts.map +1 -0
  35. package/esm/policies/PackageJsonSortedPolicy.js +48 -0
  36. package/esm/policies/PackageJsonSortedPolicy.js.map +1 -0
  37. package/esm/policies/SortTsconfigs.d.ts +10 -0
  38. package/esm/policies/SortTsconfigs.d.ts.map +1 -0
  39. package/esm/policies/SortTsconfigs.js +33 -0
  40. package/esm/policies/SortTsconfigs.js.map +1 -0
  41. package/esm/policy.d.ts +104 -0
  42. package/esm/policy.d.ts.map +1 -0
  43. package/esm/policy.js +53 -0
  44. package/esm/policy.js.map +1 -0
  45. package/esm/tsdoc-metadata.json +11 -0
  46. package/oclif.manifest.json +104 -0
  47. package/package.json +100 -0
@@ -0,0 +1,48 @@
1
+ import assert from "node:assert/strict";
2
+ import path from "node:path";
3
+ import { updatePackageJsonFile } from "@fluidframework/build-tools";
4
+ import { readJson } from "fs-extra/esm";
5
+ /**
6
+ * A RepoPolicy that checks that the repository.directory property in package.json is set correctly. If the repository
7
+ * field is a string instead of an object the package will be ignored.
8
+ */
9
+ export const PackageJsonRepoDirectoryProperty = {
10
+ name: "PackageJsonRepoDirectoryProperty",
11
+ match: /(^|\/)package\.json/i,
12
+ handler: async ({ file, root, resolve }) => {
13
+ const failResult = {
14
+ name: PackageJsonRepoDirectoryProperty.name,
15
+ file,
16
+ autoFixable: true,
17
+ };
18
+ const fixResult = {
19
+ ...failResult,
20
+ resolved: false,
21
+ };
22
+ const pkg = (await readJson(file));
23
+ const pkgDir = path.dirname(file);
24
+ const relativePkgDir = path.relative(root, pkgDir);
25
+ if (typeof pkg.repository === "object") {
26
+ if (pkg.repository.directory !== relativePkgDir) {
27
+ if (resolve) {
28
+ try {
29
+ updatePackageJsonFile(file, (json) => {
30
+ assert(typeof json.repository === "object");
31
+ json.repository.directory = relativePkgDir;
32
+ });
33
+ fixResult.resolved = true;
34
+ }
35
+ catch (error) {
36
+ fixResult.resolved = false;
37
+ fixResult.errorMessage = `${error.message}\n${error.stack}`;
38
+ }
39
+ return fixResult;
40
+ }
41
+ failResult.errorMessage = `repository.directory value is wrong. Expected '${relativePkgDir}', got '${pkg.repository.directory}'`;
42
+ return failResult;
43
+ }
44
+ }
45
+ return true;
46
+ },
47
+ };
48
+ //# sourceMappingURL=PackageJsonRepoDirectoryProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageJsonRepoDirectoryProperty.js","sourceRoot":"","sources":["../../src/policies/PackageJsonRepoDirectoryProperty.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAe;IAC3D,IAAI,EAAE,kCAAkC;IACxC,KAAK,EAAE,sBAAsB;IAC7B,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAkB;YACjC,IAAI,EAAE,gCAAgC,CAAC,IAAI;YAC3C,IAAI;YACJ,WAAW,EAAE,IAAI;SACjB,CAAC;QAEF,MAAM,SAAS,GAAoB;YAClC,GAAG,UAAU;YACb,QAAQ,EAAE,KAAK;SACf,CAAC;QAEF,MAAM,GAAG,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAgB,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEnD,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YACxC,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,KAAK,cAAc,EAAE,CAAC;gBACjD,IAAI,OAAO,EAAE,CAAC;oBACb,IAAI,CAAC;wBACJ,qBAAqB,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;4BACpC,MAAM,CAAC,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC;4BAC5C,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,cAAc,CAAC;wBAC5C,CAAC,CAAC,CAAC;wBACH,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAC3B,CAAC;oBAAC,OAAO,KAAc,EAAE,CAAC;wBACzB,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC;wBAC3B,SAAS,CAAC,YAAY,GAAG,GAAI,KAAe,CAAC,OAAO,KAClD,KAAe,CAAC,KAClB,EAAE,CAAC;oBACJ,CAAC;oBACD,OAAO,SAAS,CAAC;gBAClB,CAAC;gBACD,UAAU,CAAC,YAAY,GAAG,kDAAkD,cAAc,WAAW,GAAG,CAAC,UAAU,CAAC,SAAS,GAAG,CAAC;gBACjI,OAAO,UAAU,CAAC;YACnB,CAAC;QACF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import assert from \"node:assert/strict\";\nimport path from \"node:path\";\nimport { updatePackageJsonFile } from \"@fluidframework/build-tools\";\nimport { readJson } from \"fs-extra/esm\";\nimport type { PackageJson } from \"type-fest\";\nimport type { PolicyFailure, PolicyFixResult, RepoPolicy } from \"../policy.js\";\n\n/**\n * A RepoPolicy that checks that the repository.directory property in package.json is set correctly. If the repository\n * field is a string instead of an object the package will be ignored.\n */\nexport const PackageJsonRepoDirectoryProperty: RepoPolicy = {\n\tname: \"PackageJsonRepoDirectoryProperty\",\n\tmatch: /(^|\\/)package\\.json/i,\n\thandler: async ({ file, root, resolve }) => {\n\t\tconst failResult: PolicyFailure = {\n\t\t\tname: PackageJsonRepoDirectoryProperty.name,\n\t\t\tfile,\n\t\t\tautoFixable: true,\n\t\t};\n\n\t\tconst fixResult: PolicyFixResult = {\n\t\t\t...failResult,\n\t\t\tresolved: false,\n\t\t};\n\n\t\tconst pkg = (await readJson(file)) as PackageJson;\n\t\tconst pkgDir = path.dirname(file);\n\t\tconst relativePkgDir = path.relative(root, pkgDir);\n\n\t\tif (typeof pkg.repository === \"object\") {\n\t\t\tif (pkg.repository.directory !== relativePkgDir) {\n\t\t\t\tif (resolve) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tupdatePackageJsonFile(file, (json) => {\n\t\t\t\t\t\t\tassert(typeof json.repository === \"object\");\n\t\t\t\t\t\t\tjson.repository.directory = relativePkgDir;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfixResult.resolved = true;\n\t\t\t\t\t} catch (error: unknown) {\n\t\t\t\t\t\tfixResult.resolved = false;\n\t\t\t\t\t\tfixResult.errorMessage = `${(error as Error).message}\\n${\n\t\t\t\t\t\t\t(error as Error).stack\n\t\t\t\t\t\t}`;\n\t\t\t\t\t}\n\t\t\t\t\treturn fixResult;\n\t\t\t\t}\n\t\t\t\tfailResult.errorMessage = `repository.directory value is wrong. Expected '${relativePkgDir}', got '${pkg.repository.directory}'`;\n\t\t\t\treturn failResult;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import type { RepoPolicy } from "../policy.js";
2
+ /**
3
+ * A repo policy that checks if package.json files in the repo are sorted using sort-package-json.
4
+ */
5
+ export declare const PackageJsonSortedPolicy: RepoPolicy;
6
+ //# sourceMappingURL=PackageJsonSortedPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageJsonSortedPolicy.d.ts","sourceRoot":"","sources":["../../src/policies/PackageJsonSortedPolicy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkC,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,UAwCrC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { updatePackageJsonFile } from "@tylerbu/cli-api";
2
+ import { readJson } from "fs-extra/esm";
3
+ import { sortPackageJson } from "sort-package-json";
4
+ /**
5
+ * A repo policy that checks if package.json files in the repo are sorted using sort-package-json.
6
+ */
7
+ export const PackageJsonSortedPolicy = {
8
+ name: "PackageJsonSortedPolicy",
9
+ match: /(^|\/)package\.json/i,
10
+ handler: async ({ file, resolve }) => {
11
+ const json = await readJson(file);
12
+ const sortedJson = sortPackageJson(json);
13
+ const isSorted = JSON.stringify(sortedJson) === JSON.stringify(json);
14
+ if (isSorted) {
15
+ return true;
16
+ }
17
+ if (resolve) {
18
+ try {
19
+ await updatePackageJsonFile(file, (json) => json, { sort: true });
20
+ const result = {
21
+ name: PackageJsonSortedPolicy.name,
22
+ file,
23
+ resolved: true,
24
+ };
25
+ return result;
26
+ }
27
+ catch (error) {
28
+ const result = {
29
+ name: PackageJsonSortedPolicy.name,
30
+ file,
31
+ resolved: false,
32
+ autoFixable: true,
33
+ errorMessage: error.message,
34
+ };
35
+ return result;
36
+ }
37
+ }
38
+ else {
39
+ const result = {
40
+ name: PackageJsonSortedPolicy.name,
41
+ file,
42
+ autoFixable: true,
43
+ };
44
+ return result;
45
+ }
46
+ },
47
+ };
48
+ //# sourceMappingURL=PackageJsonSortedPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageJsonSortedPolicy.js","sourceRoot":"","sources":["../../src/policies/PackageJsonSortedPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAe;IAClD,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,sBAAsB;IAC7B,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QACpC,MAAM,IAAI,GAAgB,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAErE,IAAI,QAAQ,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;QACb,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACb,IAAI,CAAC;gBACJ,MAAM,qBAAqB,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;gBAClE,MAAM,MAAM,GAAoB;oBAC/B,IAAI,EAAE,uBAAuB,CAAC,IAAI;oBAClC,IAAI;oBACJ,QAAQ,EAAE,IAAI;iBACd,CAAC;gBACF,OAAO,MAAM,CAAC;YACf,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACzB,MAAM,MAAM,GAAoB;oBAC/B,IAAI,EAAE,uBAAuB,CAAC,IAAI;oBAClC,IAAI;oBACJ,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE,IAAI;oBACjB,YAAY,EAAG,KAAe,CAAC,OAAO;iBACtC,CAAC;gBACF,OAAO,MAAM,CAAC;YACf,CAAC;QACF,CAAC;aAAM,CAAC;YACP,MAAM,MAAM,GAAkB;gBAC7B,IAAI,EAAE,uBAAuB,CAAC,IAAI;gBAClC,IAAI;gBACJ,WAAW,EAAE,IAAI;aACjB,CAAC;YACF,OAAO,MAAM,CAAC;QACf,CAAC;IACF,CAAC;CACD,CAAC","sourcesContent":["import { updatePackageJsonFile } from \"@tylerbu/cli-api\";\nimport { readJson } from \"fs-extra/esm\";\nimport { sortPackageJson } from \"sort-package-json\";\nimport type { PackageJson } from \"type-fest\";\nimport type { PolicyFailure, PolicyFixResult, RepoPolicy } from \"../policy.js\";\n\n/**\n * A repo policy that checks if package.json files in the repo are sorted using sort-package-json.\n */\nexport const PackageJsonSortedPolicy: RepoPolicy = {\n\tname: \"PackageJsonSortedPolicy\",\n\tmatch: /(^|\\/)package\\.json/i,\n\thandler: async ({ file, resolve }) => {\n\t\tconst json: PackageJson = await readJson(file);\n\t\tconst sortedJson = sortPackageJson(json);\n\t\tconst isSorted = JSON.stringify(sortedJson) === JSON.stringify(json);\n\n\t\tif (isSorted) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (resolve) {\n\t\t\ttry {\n\t\t\t\tawait updatePackageJsonFile(file, (json) => json, { sort: true });\n\t\t\t\tconst result: PolicyFixResult = {\n\t\t\t\t\tname: PackageJsonSortedPolicy.name,\n\t\t\t\t\tfile,\n\t\t\t\t\tresolved: true,\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t} catch (error: unknown) {\n\t\t\t\tconst result: PolicyFixResult = {\n\t\t\t\t\tname: PackageJsonSortedPolicy.name,\n\t\t\t\t\tfile,\n\t\t\t\t\tresolved: false,\n\t\t\t\t\tautoFixable: true,\n\t\t\t\t\terrorMessage: (error as Error).message,\n\t\t\t\t};\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else {\n\t\t\tconst result: PolicyFailure = {\n\t\t\t\tname: PackageJsonSortedPolicy.name,\n\t\t\t\tfile,\n\t\t\t\tautoFixable: true,\n\t\t\t};\n\t\t\treturn result;\n\t\t}\n\t},\n};\n"]}
@@ -0,0 +1,10 @@
1
+ import type { RepoPolicy } from "../policy.js";
2
+ /**
3
+ * A repo policy that checks for JavaScript source files that just use the .js file extension. Such files may be
4
+ * interpreted by node as either CommonJS or ESM based on the `type` field in the nearest package.json file. This
5
+ * can create unexpected behavior for JS files; changing the package.json nearest to one will change how the JS
6
+ * is processed by node. Using explicit file extensions reduces ambiguity and ensures a CJS file isn't suddenly treated
7
+ * like an ESM file.
8
+ */
9
+ export declare const SortTsconfigs: RepoPolicy;
10
+ //# sourceMappingURL=SortTsconfigs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortTsconfigs.d.ts","sourceRoot":"","sources":["../../src/policies/SortTsconfigs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkC,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,UA2B3B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { isSorted, sortTsconfigFile } from "sort-tsconfig";
2
+ /**
3
+ * A repo policy that checks for JavaScript source files that just use the .js file extension. Such files may be
4
+ * interpreted by node as either CommonJS or ESM based on the `type` field in the nearest package.json file. This
5
+ * can create unexpected behavior for JS files; changing the package.json nearest to one will change how the JS
6
+ * is processed by node. Using explicit file extensions reduces ambiguity and ensures a CJS file isn't suddenly treated
7
+ * like an ESM file.
8
+ */
9
+ export const SortTsconfigs = {
10
+ name: "SortTsconfigs",
11
+ match: /(^|\/)[^/]+tsconfig\..*\.json$/i,
12
+ // biome-ignore lint/suspicious/useAwait: <explanation>
13
+ handler: async ({ file, config, resolve }) => {
14
+ if (config === undefined) {
15
+ return true;
16
+ }
17
+ const failResult = {
18
+ name: SortTsconfigs.name,
19
+ file,
20
+ autoFixable: true,
21
+ };
22
+ if (resolve) {
23
+ sortTsconfigFile(file, true);
24
+ const fixResult = {
25
+ ...failResult,
26
+ resolved: true,
27
+ };
28
+ return fixResult;
29
+ }
30
+ return isSorted(file) === true ? true : failResult;
31
+ },
32
+ };
33
+ //# sourceMappingURL=SortTsconfigs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortTsconfigs.js","sourceRoot":"","sources":["../../src/policies/SortTsconfigs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAe;IACxC,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,iCAAiC;IACxC,uDAAuD;IACvD,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,UAAU,GAAkB;YACjC,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,IAAI;YACJ,WAAW,EAAE,IAAI;SACjB,CAAC;QAEF,IAAI,OAAO,EAAE,CAAC;YACb,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7B,MAAM,SAAS,GAAoB;gBAClC,GAAG,UAAU;gBACb,QAAQ,EAAE,IAAI;aACd,CAAC;YAEF,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;IACpD,CAAC;CACD,CAAC","sourcesContent":["import { isSorted, sortTsconfigFile } from \"sort-tsconfig\";\nimport type { PolicyFailure, PolicyFixResult, RepoPolicy } from \"../policy.js\";\n\n/**\n * A repo policy that checks for JavaScript source files that just use the .js file extension. Such files may be\n * interpreted by node as either CommonJS or ESM based on the `type` field in the nearest package.json file. This\n * can create unexpected behavior for JS files; changing the package.json nearest to one will change how the JS\n * is processed by node. Using explicit file extensions reduces ambiguity and ensures a CJS file isn't suddenly treated\n * like an ESM file.\n */\nexport const SortTsconfigs: RepoPolicy = {\n\tname: \"SortTsconfigs\",\n\tmatch: /(^|\\/)[^/]+tsconfig\\..*\\.json$/i,\n\t// biome-ignore lint/suspicious/useAwait: <explanation>\n\thandler: async ({ file, config, resolve }) => {\n\t\tif (config === undefined) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst failResult: PolicyFailure = {\n\t\t\tname: SortTsconfigs.name,\n\t\t\tfile,\n\t\t\tautoFixable: true,\n\t\t};\n\n\t\tif (resolve) {\n\t\t\tsortTsconfigFile(file, true);\n\t\t\tconst fixResult: PolicyFixResult = {\n\t\t\t\t...failResult,\n\t\t\t\tresolved: true,\n\t\t\t};\n\n\t\t\treturn fixResult;\n\t\t}\n\n\t\treturn isSorted(file) === true ? true : failResult;\n\t},\n};\n"]}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * A type representing a policy name.
3
+ *
4
+ * @alpha
5
+ */
6
+ export type PolicyName = string;
7
+ /**
8
+ * @alpha
9
+ */
10
+ export interface PolicyFunctionArguments<C = unknown | undefined> {
11
+ file: string;
12
+ root: string;
13
+ resolve: boolean;
14
+ config?: C;
15
+ }
16
+ /**
17
+ * A policy handler is a function that is called to check policy against a file.
18
+ *
19
+ * @alpha
20
+ */
21
+ export type PolicyHandler<C = unknown | undefined> = (args: PolicyFunctionArguments<C>) => Promise<true | PolicyFailure | PolicyFixResult>;
22
+ /**
23
+ * A standalone function that can be called to resolve a policy failure.
24
+ *
25
+ * @alpha
26
+ */
27
+ export type PolicyStandaloneResolver<C = unknown | undefined> = (args: Omit<PolicyFunctionArguments<C>, "resolve">) => PolicyFixResult;
28
+ /**
29
+ * A RepoPolicy checks and applies policies to files in the repository.
30
+ *
31
+ * Each policy has a name and a match regex for matching which files it should apply to. Every file in th repo is
32
+ * enumerated and if it matches the regex for a policy, that policy is applied.
33
+ *
34
+ * Each policy includes a handler function that checks a file against the policy and can optionally resolve any problems
35
+ * (automated resolutions depend on the policy implementation).
36
+ *
37
+ * @typeParam C - type of configuration object used by the policy
38
+ *
39
+ * @alpha
40
+ */
41
+ export interface RepoPolicy<C = any | undefined> {
42
+ /**
43
+ * The name of the policy; displayed in UI and used in settings.
44
+ */
45
+ name: PolicyName;
46
+ /**
47
+ * A more detailed description of the policy and its intended function.
48
+ */
49
+ description?: string;
50
+ /**
51
+ * A regular expression that is used to match files in the repo.
52
+ */
53
+ match: RegExp;
54
+ /**
55
+ * A handler function that checks if a file is compliant with the policy.
56
+ *
57
+ * @param file - Repo-relative path to the file to check.
58
+ * @param root - Absolute path to the root of the repo.
59
+ * @param resolve - If true, automated policy fixes will be applied. Not all policies support automated fixes.
60
+ * @returns True if the file passed the policy; otherwise a PolicyFailure object will be returned.
61
+ */
62
+ handler: PolicyHandler<C>;
63
+ /**
64
+ * A resolver function that can be used to automatically address the policy violation.
65
+ *
66
+ * @param file - Repo-relative path to the file to check.
67
+ * @param root - Absolute path to the root of the repo.
68
+ * @returns true if the file passed the policy; otherwise a PolicyFailure object will be returned.
69
+ */
70
+ resolver?: PolicyStandaloneResolver<C> | undefined;
71
+ }
72
+ export declare class RepoPolicyClass implements RepoPolicy {
73
+ readonly name: string;
74
+ readonly match: RegExp;
75
+ handler: PolicyHandler;
76
+ resolver?: PolicyStandaloneResolver | undefined;
77
+ static createRepoPolicy(name: string, match: RegExp, handler: PolicyHandler, resolver?: PolicyStandaloneResolver): RepoPolicyClass;
78
+ constructor(name: string, match: RegExp, handler: PolicyHandler, resolver?: PolicyStandaloneResolver | undefined);
79
+ }
80
+ /**
81
+ * A policy failure.
82
+ *
83
+ * @alpha
84
+ */
85
+ export interface PolicyFailure {
86
+ name: PolicyName;
87
+ file: string;
88
+ autoFixable?: boolean | undefined;
89
+ errorMessage?: string | undefined;
90
+ }
91
+ /**
92
+ * @alpha
93
+ */
94
+ export interface PolicyFixResult extends PolicyFailure {
95
+ resolved: boolean;
96
+ }
97
+ export declare function isPolicyFixResult(toCheck: any): toCheck is PolicyFixResult;
98
+ /**
99
+ * Default policies included with repopo.
100
+ *
101
+ * @alpha
102
+ */
103
+ export declare const DefaultPolicies: RepoPolicy[];
104
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,CAAC;CACX;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS,IAAI,CACpD,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,IAAI,GAAG,aAAa,GAAG,eAAe,CAAC,CAAC;AAOrD;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,GAAG,OAAO,GAAG,SAAS,IAAI,CAC/D,IAAI,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAC7C,eAAe,CAAC;AAIrB;;;;;;;;;;;;GAYG;AAGH,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS;IAC9C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAE1B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACnD;AAED,qBAAa,eAAgB,YAAW,UAAU;aAWhC,IAAI,EAAE,MAAM;aACZ,KAAK,EAAE,MAAM;IACtB,OAAO,EAAE,aAAa;IACtB,QAAQ,CAAC,EAAE,wBAAwB;WAb7B,gBAAgB,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,wBAAwB,GACjC,eAAe;gBAKD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACtB,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,wBAAwB,YAAA;CAI3C;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACrD,QAAQ,EAAE,OAAO,CAAC;CAClB;AAGD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,eAAe,CAK1E;AAiBD;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,UAAU,EAMvC,CAAC"}
package/esm/policy.js ADDED
@@ -0,0 +1,53 @@
1
+ import { NoJsFileExtensions } from "./policies/NoJsFileExtensions.js";
2
+ import { PackageJsonProperties } from "./policies/PackageJsonProperties.js";
3
+ import { PackageJsonRepoDirectoryProperty } from "./policies/PackageJsonRepoDirectoryProperty.js";
4
+ import { PackageJsonSortedPolicy } from "./policies/PackageJsonSortedPolicy.js";
5
+ import { SortTsconfigs } from "./policies/SortTsconfigs.js";
6
+ export class RepoPolicyClass {
7
+ name;
8
+ match;
9
+ handler;
10
+ resolver;
11
+ static createRepoPolicy(name, match, handler, resolver) {
12
+ return new RepoPolicyClass(name, match, handler, resolver);
13
+ }
14
+ constructor(name, match, handler, resolver) {
15
+ this.name = name;
16
+ this.match = match;
17
+ this.handler = handler;
18
+ this.resolver = resolver;
19
+ // empty
20
+ }
21
+ }
22
+ // biome-ignore lint/suspicious/noExplicitAny: type guard
23
+ export function isPolicyFixResult(toCheck) {
24
+ if (typeof toCheck !== "object") {
25
+ return false;
26
+ }
27
+ return "resolved" in toCheck;
28
+ }
29
+ // export const commonMatchPatterns = {
30
+ // "package.json": /(^|\/)package\.json/i,
31
+ // } as const;
32
+ // export function createPackageJsonPolicy(
33
+ // props: Omit<RepoPolicy, "match">,
34
+ // ): RepoPolicy {
35
+ // const newPolicy: RepoPolicy = {
36
+ // ...props,
37
+ // match: commonMatchPatterns["package.json"],
38
+ // };
39
+ // return newPolicy;
40
+ // }
41
+ /**
42
+ * Default policies included with repopo.
43
+ *
44
+ * @alpha
45
+ */
46
+ export const DefaultPolicies = [
47
+ NoJsFileExtensions,
48
+ PackageJsonRepoDirectoryProperty,
49
+ PackageJsonProperties,
50
+ PackageJsonSortedPolicy,
51
+ SortTsconfigs,
52
+ ];
53
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AA+F5D,MAAM,OAAO,eAAe;IAWV;IACA;IACT;IACA;IAbD,MAAM,CAAC,gBAAgB,CAC7B,IAAY,EACZ,KAAa,EACb,OAAsB,EACtB,QAAmC;QAEnC,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED,YACiB,IAAY,EACZ,KAAa,EACtB,OAAsB,EACtB,QAAmC;QAH1B,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAQ;QACtB,YAAO,GAAP,OAAO,CAAe;QACtB,aAAQ,GAAR,QAAQ,CAA2B;QAE1C,QAAQ;IACT,CAAC;CACD;AAqBD,yDAAyD;AACzD,MAAM,UAAU,iBAAiB,CAAC,OAAY;IAC7C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,UAAU,IAAI,OAAO,CAAC;AAC9B,CAAC;AAED,uCAAuC;AACvC,2CAA2C;AAC3C,cAAc;AAEd,2CAA2C;AAC3C,qCAAqC;AACrC,kBAAkB;AAClB,mCAAmC;AACnC,cAAc;AACd,gDAAgD;AAChD,MAAM;AAEN,qBAAqB;AACrB,IAAI;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiB;IAC5C,kBAAkB;IAClB,gCAAgC;IAChC,qBAAqB;IACrB,uBAAuB;IACvB,aAAa;CACb,CAAC","sourcesContent":["import { NoJsFileExtensions } from \"./policies/NoJsFileExtensions.js\";\nimport { PackageJsonProperties } from \"./policies/PackageJsonProperties.js\";\nimport { PackageJsonRepoDirectoryProperty } from \"./policies/PackageJsonRepoDirectoryProperty.js\";\nimport { PackageJsonSortedPolicy } from \"./policies/PackageJsonSortedPolicy.js\";\nimport { SortTsconfigs } from \"./policies/SortTsconfigs.js\";\n\n/**\n * A type representing a policy name.\n *\n * @alpha\n */\nexport type PolicyName = string;\n\n/**\n * @alpha\n */\nexport interface PolicyFunctionArguments<C = unknown | undefined> {\n\tfile: string;\n\troot: string;\n\tresolve: boolean;\n\tconfig?: C;\n}\n\n/**\n * A policy handler is a function that is called to check policy against a file.\n *\n * @alpha\n */\nexport type PolicyHandler<C = unknown | undefined> = (\n\targs: PolicyFunctionArguments<C>,\n) => Promise<true | PolicyFailure | PolicyFixResult>;\n\n// export type PolicyCheckOnly = (\n// \tfile: string,\n// \troot: string,\n// ) => Promise<true | PolicyFailure | PolicyFixResult>;\n\n/**\n * A standalone function that can be called to resolve a policy failure.\n *\n * @alpha\n */\nexport type PolicyStandaloneResolver<C = unknown | undefined> = (\n\targs: Omit<PolicyFunctionArguments<C>, \"resolve\">,\n) => PolicyFixResult;\n\n// function isPolicyHandler(input: PolicyHandler | PolicyCheckOnly): input is PolicyHandler\n\n/**\n * A RepoPolicy checks and applies policies to files in the repository.\n *\n * Each policy has a name and a match regex for matching which files it should apply to. Every file in th repo is\n * enumerated and if it matches the regex for a policy, that policy is applied.\n *\n * Each policy includes a handler function that checks a file against the policy and can optionally resolve any problems\n * (automated resolutions depend on the policy implementation).\n *\n * @typeParam C - type of configuration object used by the policy\n *\n * @alpha\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: TODO - figure out if this can work with unknown or in another typesafe manner\nexport interface RepoPolicy<C = any | undefined> {\n\t/**\n\t * The name of the policy; displayed in UI and used in settings.\n\t */\n\tname: PolicyName;\n\n\t/**\n\t * A more detailed description of the policy and its intended function.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * A regular expression that is used to match files in the repo.\n\t */\n\tmatch: RegExp;\n\n\t/**\n\t * A handler function that checks if a file is compliant with the policy.\n\t *\n\t * @param file - Repo-relative path to the file to check.\n\t * @param root - Absolute path to the root of the repo.\n\t * @param resolve - If true, automated policy fixes will be applied. Not all policies support automated fixes.\n\t * @returns True if the file passed the policy; otherwise a PolicyFailure object will be returned.\n\t */\n\thandler: PolicyHandler<C>;\n\n\t/**\n\t * A resolver function that can be used to automatically address the policy violation.\n\t *\n\t * @param file - Repo-relative path to the file to check.\n\t * @param root - Absolute path to the root of the repo.\n\t * @returns true if the file passed the policy; otherwise a PolicyFailure object will be returned.\n\t */\n\tresolver?: PolicyStandaloneResolver<C> | undefined;\n}\n\nexport class RepoPolicyClass implements RepoPolicy {\n\tpublic static createRepoPolicy(\n\t\tname: string,\n\t\tmatch: RegExp,\n\t\thandler: PolicyHandler,\n\t\tresolver?: PolicyStandaloneResolver,\n\t): RepoPolicyClass {\n\t\treturn new RepoPolicyClass(name, match, handler, resolver);\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly name: string,\n\t\tpublic readonly match: RegExp,\n\t\tpublic handler: PolicyHandler,\n\t\tpublic resolver?: PolicyStandaloneResolver,\n\t) {\n\t\t// empty\n\t}\n}\n\n/**\n * A policy failure.\n *\n * @alpha\n */\nexport interface PolicyFailure {\n\tname: PolicyName;\n\tfile: string;\n\tautoFixable?: boolean | undefined;\n\terrorMessage?: string | undefined;\n}\n\n/**\n * @alpha\n */\nexport interface PolicyFixResult extends PolicyFailure {\n\tresolved: boolean;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: type guard\nexport function isPolicyFixResult(toCheck: any): toCheck is PolicyFixResult {\n\tif (typeof toCheck !== \"object\") {\n\t\treturn false;\n\t}\n\treturn \"resolved\" in toCheck;\n}\n\n// export const commonMatchPatterns = {\n// \t\"package.json\": /(^|\\/)package\\.json/i,\n// } as const;\n\n// export function createPackageJsonPolicy(\n// \tprops: Omit<RepoPolicy, \"match\">,\n// ): RepoPolicy {\n// \tconst newPolicy: RepoPolicy = {\n// \t\t...props,\n// \t\tmatch: commonMatchPatterns[\"package.json\"],\n// \t};\n\n// \treturn newPolicy;\n// }\n\n/**\n * Default policies included with repopo.\n *\n * @alpha\n */\nexport const DefaultPolicies: RepoPolicy[] = [\n\tNoJsFileExtensions,\n\tPackageJsonRepoDirectoryProperty,\n\tPackageJsonProperties,\n\tPackageJsonSortedPolicy,\n\tSortTsconfigs,\n];\n"]}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.47.9"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,104 @@
1
+ {
2
+ "commands": {
3
+ "check": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "flags": {
7
+ "verbose": {
8
+ "char": "v",
9
+ "description": "Enable verbose logging.",
10
+ "exclusive": [
11
+ "quiet"
12
+ ],
13
+ "helpGroup": "LOGGING",
14
+ "name": "verbose",
15
+ "required": false,
16
+ "allowNo": false,
17
+ "type": "boolean"
18
+ },
19
+ "quiet": {
20
+ "description": "Disable all logging.",
21
+ "exclusive": [
22
+ "verbose"
23
+ ],
24
+ "helpGroup": "LOGGING",
25
+ "name": "quiet",
26
+ "required": false,
27
+ "allowNo": false,
28
+ "type": "boolean"
29
+ },
30
+ "fix": {
31
+ "aliases": [
32
+ "resolve"
33
+ ],
34
+ "char": "f",
35
+ "description": "Fix errors if possible.",
36
+ "name": "fix",
37
+ "required": false,
38
+ "allowNo": false,
39
+ "type": "boolean"
40
+ },
41
+ "policy": {
42
+ "char": "d",
43
+ "description": "Filter policies to apply by <regex>. Only policies with a name matching the regex will be applied.",
44
+ "name": "policy",
45
+ "required": false,
46
+ "hasDynamicHelp": false,
47
+ "multiple": false,
48
+ "type": "option"
49
+ },
50
+ "excludePolicy": {
51
+ "char": "D",
52
+ "description": "Exclude policies by name. Can be specified multiple times to exclude multiple policies.",
53
+ "exclusive": [
54
+ "policy"
55
+ ],
56
+ "name": "excludePolicy",
57
+ "hasDynamicHelp": false,
58
+ "multiple": true,
59
+ "type": "option"
60
+ },
61
+ "path": {
62
+ "char": "p",
63
+ "description": "Filter file paths by <regex>.",
64
+ "name": "path",
65
+ "required": false,
66
+ "hasDynamicHelp": false,
67
+ "multiple": false,
68
+ "type": "option"
69
+ },
70
+ "stdin": {
71
+ "description": "Read list of files from stdin.",
72
+ "name": "stdin",
73
+ "required": false,
74
+ "allowNo": false,
75
+ "type": "boolean"
76
+ },
77
+ "config": {
78
+ "description": "The path to a configuration file.",
79
+ "helpGroup": "CONFIGURATION",
80
+ "hidden": true,
81
+ "name": "config",
82
+ "hasDynamicHelp": false,
83
+ "multiple": false,
84
+ "type": "option"
85
+ }
86
+ },
87
+ "hasDynamicHelp": false,
88
+ "hiddenAliases": [],
89
+ "id": "check",
90
+ "pluginAlias": "repopo",
91
+ "pluginName": "repopo",
92
+ "pluginType": "core",
93
+ "strict": true,
94
+ "summary": "Checks and applies policies to the files in the repository.",
95
+ "isESM": true,
96
+ "relativePath": [
97
+ "esm",
98
+ "commands",
99
+ "check.js"
100
+ ]
101
+ }
102
+ },
103
+ "version": "0.2.2"
104
+ }
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "repopo",
3
+ "version": "0.2.2",
4
+ "description": "Enforce policies on all or some of the files in a git repository.",
5
+ "keywords": [
6
+ "policy",
7
+ "ci"
8
+ ],
9
+ "homepage": "https://github.com/tylerbutler/tools-monorepo/tree/main/packages/repopo#repopo---police-the-files-in-your-git-repo-with-extensible-policies",
10
+ "bugs": "https://github.com/tylerbutler/tools-monorepo/issues",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/tylerbutler/tools-monorepo.git",
14
+ "directory": "packages/repopo"
15
+ },
16
+ "license": "MIT",
17
+ "author": "Tyler Butler <tyler@tylerbutler.com>",
18
+ "type": "module",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./esm/index.d.ts",
22
+ "import": "./esm/index.js"
23
+ }
24
+ },
25
+ "types": "esm/index.d.ts",
26
+ "bin": {
27
+ "repopo": "./bin/run.js"
28
+ },
29
+ "files": [
30
+ "/CHANGELOG.md",
31
+ "/bin",
32
+ "/oclif.manifest.json",
33
+ "/esm",
34
+ "/THIRD-PARTY-LICENSES.txt"
35
+ ],
36
+ "oclif": {
37
+ "bin": "repopo",
38
+ "commands": {
39
+ "strategy": "pattern",
40
+ "target": "./esm/commands"
41
+ },
42
+ "devPlugins": [],
43
+ "dirname": "repopo",
44
+ "plugins": [],
45
+ "repositoryPrefix": "<%- repo %>/blob/main/packages/repopo/<%- commandPath %>"
46
+ },
47
+ "dependencies": {
48
+ "@fluidframework/build-tools": "^0.44.0",
49
+ "@oclif/core": "^4.0.19",
50
+ "@oclif/plugin-help": "^6.2.10",
51
+ "@rushstack/node-core-library": "^5.7.0",
52
+ "chalk": "^5.3.0",
53
+ "cosmiconfig": "^9.0.0",
54
+ "fs-extra": "^11.2.0",
55
+ "sort-package-json": "2.10.0",
56
+ "@tylerbu/cli-api": "^0.4.0",
57
+ "sort-tsconfig": "^0.1.1"
58
+ },
59
+ "devDependencies": {
60
+ "@biomejs/biome": "1.8.3",
61
+ "@microsoft/api-extractor": "^7.43.4",
62
+ "@oclif/plugin-command-snapshot": "^5.2.14",
63
+ "@oclif/test": "^4.0.9",
64
+ "@types/fs-extra": "^11.0.4",
65
+ "@types/node": "^20.12.7",
66
+ "@types/tmp": "^0.2.6",
67
+ "lefthook": "^1.6.11",
68
+ "oclif": "^4.14.26",
69
+ "rimraf": "^6.0.0",
70
+ "serve": "^14.2.3",
71
+ "start-server-and-test": "^2.0.3",
72
+ "tmp-promise": "^3.0.3",
73
+ "ts-node": "^10.9.2",
74
+ "type-fest": "^4.18.2",
75
+ "typescript": "~5.5.4",
76
+ "vitest": "^2.0.0"
77
+ },
78
+ "engines": {
79
+ "node": ">=18.0.0"
80
+ },
81
+ "scripts": {
82
+ "api": "api-extractor run --local",
83
+ "api:markdown": "api-documenter markdown -i _temp/api-extractor -o _temp/docs",
84
+ "build": "fluid-build . --task build",
85
+ "check": "concurrently npm:check:format",
86
+ "check:format": "biome check . --linter-enabled=false",
87
+ "check:snapshot": "./bin/dev.js snapshot:compare --filepath test/commands/__snapshots__/commands.json",
88
+ "clean": "concurrently npm:clean:build npm:clean:manifest",
89
+ "clean:build": "rimraf esm *.tsbuildinfo *.done.build.log",
90
+ "clean:manifest": "rimraf oclif.manifest.json",
91
+ "compile": "tsc --project ./tsconfig.json",
92
+ "format": "biome check . --linter-enabled=false --write",
93
+ "full": "fluid-build . --task full",
94
+ "lint": "biome lint .",
95
+ "lint:fix": "biome lint . --write",
96
+ "manifest": "oclif manifest",
97
+ "readme": "oclif readme --no-aliases",
98
+ "sort-package-json": "sort-package-json"
99
+ }
100
+ }