@platforma-sdk/block-tools 2.6.44 → 2.6.45

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 (70) hide show
  1. package/README.md +16 -9
  2. package/bin/dev.js +4 -4
  3. package/bin/run.js +3 -3
  4. package/dist/cli.js.map +1 -1
  5. package/dist/cli.mjs +16 -6
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/cmd/index.d.ts +8 -8
  8. package/dist/cmd/mark-stable.d.ts +1 -1
  9. package/dist/cmd/publish.d.ts +1 -1
  10. package/dist/cmd/restore-overview-from-snapshot.d.ts +1 -1
  11. package/dist/{config-DKBY0B2u.mjs → config-Cc8_zV3b.mjs} +48 -17
  12. package/dist/config-Cc8_zV3b.mjs.map +1 -0
  13. package/dist/config-Ycas5fbX.js.map +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +6 -4
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/registry_v1/config_schema.d.ts +7 -7
  19. package/dist/registry_v1/v1_repo_schema.d.ts +1 -1
  20. package/dist/v2/model/block_components.d.ts +19 -19
  21. package/dist/v2/model/block_description.d.ts +102 -102
  22. package/dist/v2/model/block_meta.d.ts +20 -20
  23. package/dist/v2/model/content_conversion.d.ts +2 -2
  24. package/dist/v2/registry/registry.d.ts +1 -1
  25. package/dist/v2/source_package.d.ts +1 -1
  26. package/package.json +31 -29
  27. package/src/cmd/build-meta.ts +15 -15
  28. package/src/cmd/build-model.ts +23 -26
  29. package/src/cmd/index.ts +20 -20
  30. package/src/cmd/list-overview-snapshots.ts +12 -12
  31. package/src/cmd/mark-stable.ts +30 -33
  32. package/src/cmd/pack.ts +15 -15
  33. package/src/cmd/publish.ts +46 -34
  34. package/src/cmd/refresh-registry.ts +15 -15
  35. package/src/cmd/restore-overview-from-snapshot.ts +27 -25
  36. package/src/cmd/update-deps.ts +8 -8
  37. package/src/cmd/upload-package-v1.ts +33 -33
  38. package/src/common_types.ts +1 -1
  39. package/src/io/folder_reader.test.ts +13 -13
  40. package/src/io/folder_reader.ts +18 -20
  41. package/src/io/index.ts +2 -2
  42. package/src/io/storage.test.ts +48 -48
  43. package/src/io/storage.ts +20 -15
  44. package/src/lib.ts +3 -3
  45. package/src/registry_v1/config.ts +11 -11
  46. package/src/registry_v1/config_schema.ts +5 -5
  47. package/src/registry_v1/flags.ts +4 -4
  48. package/src/registry_v1/index.ts +3 -3
  49. package/src/registry_v1/registry.test.ts +54 -54
  50. package/src/registry_v1/registry.ts +29 -25
  51. package/src/registry_v1/v1_repo_schema.ts +3 -3
  52. package/src/util.ts +6 -9
  53. package/src/v2/build_dist.test.ts +8 -9
  54. package/src/v2/build_dist.ts +10 -13
  55. package/src/v2/index.ts +4 -4
  56. package/src/v2/model/block_components.ts +5 -5
  57. package/src/v2/model/block_description.ts +12 -8
  58. package/src/v2/model/block_meta.ts +4 -5
  59. package/src/v2/model/content_conversion.ts +44 -44
  60. package/src/v2/model/index.ts +4 -4
  61. package/src/v2/registry/index.ts +3 -3
  62. package/src/v2/registry/registry.test.ts +223 -197
  63. package/src/v2/registry/registry.ts +93 -66
  64. package/src/v2/registry/registry_reader.test.ts +15 -15
  65. package/src/v2/registry/registry_reader.ts +29 -27
  66. package/src/v2/registry/schema_internal.ts +11 -10
  67. package/src/v2/registry/schema_public.ts +56 -47
  68. package/src/v2/source_package.test.ts +15 -15
  69. package/src/v2/source_package.ts +33 -26
  70. package/dist/config-DKBY0B2u.mjs.map +0 -1
@@ -383,8 +383,8 @@ export declare function BlockPackMetaDescription(root: string): z.ZodObject<{
383
383
  title: string;
384
384
  description: string;
385
385
  organization: {
386
- name: string;
387
386
  url: string;
387
+ name: string;
388
388
  logo?: {
389
389
  type: "absolute-file";
390
390
  file: string;
@@ -403,7 +403,6 @@ export declare function BlockPackMetaDescription(root: string): z.ZodObject<{
403
403
  } & {
404
404
  [k: string]: unknown;
405
405
  };
406
- tags?: string[] | undefined;
407
406
  longDescription?: {
408
407
  type: "absolute-file";
409
408
  file: string;
@@ -448,6 +447,7 @@ export declare function BlockPackMetaDescription(root: string): z.ZodObject<{
448
447
  url?: string | undefined;
449
448
  docs?: string | undefined;
450
449
  support?: string | undefined;
450
+ tags?: string[] | undefined;
451
451
  marketplaceRanking?: number | undefined;
452
452
  deprecated?: boolean | undefined;
453
453
  termsOfServiceUrl?: string | undefined;
@@ -456,8 +456,8 @@ export declare function BlockPackMetaDescription(root: string): z.ZodObject<{
456
456
  title: string;
457
457
  description: string;
458
458
  organization: {
459
- name: string;
460
459
  url: string;
460
+ name: string;
461
461
  logo?: string | {
462
462
  type: "explicit-base64";
463
463
  content: string;
@@ -472,7 +472,6 @@ export declare function BlockPackMetaDescription(root: string): z.ZodObject<{
472
472
  } & {
473
473
  [k: string]: unknown;
474
474
  };
475
- tags?: string[] | undefined;
476
475
  longDescription?: string | {
477
476
  type: "explicit-string";
478
477
  content: string;
@@ -507,6 +506,7 @@ export declare function BlockPackMetaDescription(root: string): z.ZodObject<{
507
506
  url?: string | undefined;
508
507
  docs?: string | undefined;
509
508
  support?: string | undefined;
509
+ tags?: string[] | undefined;
510
510
  marketplaceRanking?: number | undefined;
511
511
  deprecated?: boolean | undefined;
512
512
  termsOfServiceUrl?: string | undefined;
@@ -744,8 +744,8 @@ export declare function BlockPackMetaConsolidate(dstFolder: string, fileAccumula
744
744
  title: string;
745
745
  description: string;
746
746
  organization: {
747
- name: string;
748
747
  url: string;
748
+ name: string;
749
749
  logo?: {
750
750
  type: "relative";
751
751
  path: string;
@@ -757,7 +757,6 @@ export declare function BlockPackMetaConsolidate(dstFolder: string, fileAccumula
757
757
  } & {
758
758
  [k: string]: unknown;
759
759
  };
760
- tags?: string[] | undefined;
761
760
  longDescription?: {
762
761
  type: "relative";
763
762
  path: string;
@@ -783,6 +782,7 @@ export declare function BlockPackMetaConsolidate(dstFolder: string, fileAccumula
783
782
  url?: string | undefined;
784
783
  docs?: string | undefined;
785
784
  support?: string | undefined;
785
+ tags?: string[] | undefined;
786
786
  marketplaceRanking?: number | undefined;
787
787
  deprecated?: boolean | undefined;
788
788
  termsOfServiceUrl?: string | undefined;
@@ -791,8 +791,8 @@ export declare function BlockPackMetaConsolidate(dstFolder: string, fileAccumula
791
791
  title: string;
792
792
  description: string;
793
793
  organization: {
794
- name: string;
795
794
  url: string;
795
+ name: string;
796
796
  logo?: {
797
797
  type: "explicit-base64";
798
798
  content: string;
@@ -804,7 +804,6 @@ export declare function BlockPackMetaConsolidate(dstFolder: string, fileAccumula
804
804
  } & {
805
805
  [k: string]: unknown;
806
806
  };
807
- tags?: string[] | undefined;
808
807
  longDescription?: {
809
808
  type: "explicit-string";
810
809
  content: string;
@@ -830,6 +829,7 @@ export declare function BlockPackMetaConsolidate(dstFolder: string, fileAccumula
830
829
  url?: string | undefined;
831
830
  docs?: string | undefined;
832
831
  support?: string | undefined;
832
+ tags?: string[] | undefined;
833
833
  marketplaceRanking?: number | undefined;
834
834
  deprecated?: boolean | undefined;
835
835
  termsOfServiceUrl?: string | undefined;
@@ -1042,8 +1042,8 @@ export declare const BlockPackMetaEmbedAbsoluteBase64: z.ZodPipeline<z.ZodObject
1042
1042
  title: string;
1043
1043
  description: string;
1044
1044
  organization: {
1045
- name: string;
1046
1045
  url: string;
1046
+ name: string;
1047
1047
  logo?: {
1048
1048
  type: "explicit-base64";
1049
1049
  content: string;
@@ -1052,7 +1052,6 @@ export declare const BlockPackMetaEmbedAbsoluteBase64: z.ZodPipeline<z.ZodObject
1052
1052
  } & {
1053
1053
  [k: string]: unknown;
1054
1054
  };
1055
- tags?: string[] | undefined;
1056
1055
  longDescription?: string | undefined;
1057
1056
  changelog?: string | undefined;
1058
1057
  logo?: {
@@ -1063,6 +1062,7 @@ export declare const BlockPackMetaEmbedAbsoluteBase64: z.ZodPipeline<z.ZodObject
1063
1062
  url?: string | undefined;
1064
1063
  docs?: string | undefined;
1065
1064
  support?: string | undefined;
1065
+ tags?: string[] | undefined;
1066
1066
  marketplaceRanking?: number | undefined;
1067
1067
  deprecated?: boolean | undefined;
1068
1068
  termsOfServiceUrl?: string | undefined;
@@ -1071,8 +1071,8 @@ export declare const BlockPackMetaEmbedAbsoluteBase64: z.ZodPipeline<z.ZodObject
1071
1071
  title: string;
1072
1072
  description: string;
1073
1073
  organization: {
1074
- name: string;
1075
1074
  url: string;
1075
+ name: string;
1076
1076
  logo?: {
1077
1077
  type: "explicit-base64";
1078
1078
  content: string;
@@ -1084,7 +1084,6 @@ export declare const BlockPackMetaEmbedAbsoluteBase64: z.ZodPipeline<z.ZodObject
1084
1084
  } & {
1085
1085
  [k: string]: unknown;
1086
1086
  };
1087
- tags?: string[] | undefined;
1088
1087
  longDescription?: {
1089
1088
  type: "explicit-string";
1090
1089
  content: string;
@@ -1110,6 +1109,7 @@ export declare const BlockPackMetaEmbedAbsoluteBase64: z.ZodPipeline<z.ZodObject
1110
1109
  url?: string | undefined;
1111
1110
  docs?: string | undefined;
1112
1111
  support?: string | undefined;
1112
+ tags?: string[] | undefined;
1113
1113
  marketplaceRanking?: number | undefined;
1114
1114
  deprecated?: boolean | undefined;
1115
1115
  termsOfServiceUrl?: string | undefined;
@@ -1455,8 +1455,8 @@ export declare const BlockPackMetaEmbedAbsoluteBytes: z.ZodPipeline<z.ZodObject<
1455
1455
  title: string;
1456
1456
  description: string;
1457
1457
  organization: {
1458
- name: string;
1459
1458
  url: string;
1459
+ name: string;
1460
1460
  logo?: {
1461
1461
  type: "explicit-bytes";
1462
1462
  content: Uint8Array;
@@ -1465,7 +1465,6 @@ export declare const BlockPackMetaEmbedAbsoluteBytes: z.ZodPipeline<z.ZodObject<
1465
1465
  } & {
1466
1466
  [k: string]: unknown;
1467
1467
  };
1468
- tags?: string[] | undefined;
1469
1468
  longDescription?: string | undefined;
1470
1469
  changelog?: string | undefined;
1471
1470
  logo?: {
@@ -1476,6 +1475,7 @@ export declare const BlockPackMetaEmbedAbsoluteBytes: z.ZodPipeline<z.ZodObject<
1476
1475
  url?: string | undefined;
1477
1476
  docs?: string | undefined;
1478
1477
  support?: string | undefined;
1478
+ tags?: string[] | undefined;
1479
1479
  marketplaceRanking?: number | undefined;
1480
1480
  deprecated?: boolean | undefined;
1481
1481
  termsOfServiceUrl?: string | undefined;
@@ -1484,8 +1484,8 @@ export declare const BlockPackMetaEmbedAbsoluteBytes: z.ZodPipeline<z.ZodObject<
1484
1484
  title: string;
1485
1485
  description: string;
1486
1486
  organization: {
1487
- name: string;
1488
1487
  url: string;
1488
+ name: string;
1489
1489
  logo?: {
1490
1490
  type: "explicit-base64";
1491
1491
  content: string;
@@ -1497,7 +1497,6 @@ export declare const BlockPackMetaEmbedAbsoluteBytes: z.ZodPipeline<z.ZodObject<
1497
1497
  } & {
1498
1498
  [k: string]: unknown;
1499
1499
  };
1500
- tags?: string[] | undefined;
1501
1500
  longDescription?: {
1502
1501
  type: "explicit-string";
1503
1502
  content: string;
@@ -1523,6 +1522,7 @@ export declare const BlockPackMetaEmbedAbsoluteBytes: z.ZodPipeline<z.ZodObject<
1523
1522
  url?: string | undefined;
1524
1523
  docs?: string | undefined;
1525
1524
  support?: string | undefined;
1525
+ tags?: string[] | undefined;
1526
1526
  marketplaceRanking?: number | undefined;
1527
1527
  deprecated?: boolean | undefined;
1528
1528
  termsOfServiceUrl?: string | undefined;
@@ -1868,8 +1868,8 @@ export declare function BlockPackMetaEmbedBytes(reader: RelativeContentReader):
1868
1868
  title: string;
1869
1869
  description: string;
1870
1870
  organization: {
1871
- name: string;
1872
1871
  url: string;
1872
+ name: string;
1873
1873
  logo?: {
1874
1874
  type: "explicit-bytes";
1875
1875
  content: Uint8Array;
@@ -1878,7 +1878,6 @@ export declare function BlockPackMetaEmbedBytes(reader: RelativeContentReader):
1878
1878
  } & {
1879
1879
  [k: string]: unknown;
1880
1880
  };
1881
- tags?: string[] | undefined;
1882
1881
  longDescription?: string | undefined;
1883
1882
  changelog?: string | undefined;
1884
1883
  logo?: {
@@ -1889,6 +1888,7 @@ export declare function BlockPackMetaEmbedBytes(reader: RelativeContentReader):
1889
1888
  url?: string | undefined;
1890
1889
  docs?: string | undefined;
1891
1890
  support?: string | undefined;
1891
+ tags?: string[] | undefined;
1892
1892
  marketplaceRanking?: number | undefined;
1893
1893
  deprecated?: boolean | undefined;
1894
1894
  termsOfServiceUrl?: string | undefined;
@@ -1897,8 +1897,8 @@ export declare function BlockPackMetaEmbedBytes(reader: RelativeContentReader):
1897
1897
  title: string;
1898
1898
  description: string;
1899
1899
  organization: {
1900
- name: string;
1901
1900
  url: string;
1901
+ name: string;
1902
1902
  logo?: {
1903
1903
  type: "explicit-base64";
1904
1904
  content: string;
@@ -1910,7 +1910,6 @@ export declare function BlockPackMetaEmbedBytes(reader: RelativeContentReader):
1910
1910
  } & {
1911
1911
  [k: string]: unknown;
1912
1912
  };
1913
- tags?: string[] | undefined;
1914
1913
  longDescription?: {
1915
1914
  type: "explicit-string";
1916
1915
  content: string;
@@ -1936,6 +1935,7 @@ export declare function BlockPackMetaEmbedBytes(reader: RelativeContentReader):
1936
1935
  url?: string | undefined;
1937
1936
  docs?: string | undefined;
1938
1937
  support?: string | undefined;
1938
+ tags?: string[] | undefined;
1939
1939
  marketplaceRanking?: number | undefined;
1940
1940
  deprecated?: boolean | undefined;
1941
1941
  termsOfServiceUrl?: string | undefined;
@@ -1,12 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { ContentAbsoluteBinaryLocal, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAnyLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText } from '@milaboratories/pl-model-middle-layer';
3
3
  type ContentCtxFs = {
4
- type: 'local';
4
+ type: "local";
5
5
  /** Folder relative to which content should be resolved */
6
6
  path: string;
7
7
  };
8
8
  type ContentCtxUrl = {
9
- type: 'remote';
9
+ type: "remote";
10
10
  /** URL prefix from which content should be resolved */
11
11
  url: string;
12
12
  };
@@ -22,7 +22,7 @@ export declare class BlockRegistryV2 {
22
22
  private createGlobalOverviewSnapshot;
23
23
  private createPackageOverviewSnapshot;
24
24
  private updateRegistry;
25
- updateIfNeeded(mode?: 'force' | 'normal' | 'dry-run'): Promise<void>;
25
+ updateIfNeeded(mode?: "force" | "normal" | "dry-run"): Promise<void>;
26
26
  getPackageOverview(name: BlockPackIdNoVersion): Promise<undefined | PackageOverview>;
27
27
  getGlobalOverview(): Promise<undefined | GlobalOverviewReg>;
28
28
  private marchChanged;
@@ -2,7 +2,7 @@ import { BlockPackDescriptionAbsolute } from './model';
2
2
  import { MiLogger } from '@milaboratories/ts-helpers';
3
3
  import { BlockPackDescriptionRaw, BlockPackId } from '@milaboratories/pl-model-middle-layer';
4
4
  export declare const BlockDescriptionPackageJsonField = "block";
5
- export declare function parsePackageName(packageName: string): Pick<BlockPackId, 'organization' | 'name'>;
5
+ export declare function parsePackageName(packageName: string): Pick<BlockPackId, "organization" | "name">;
6
6
  export declare function tryLoadPackDescription(moduleRoot: string, logger?: MiLogger): Promise<BlockPackDescriptionAbsolute | undefined>;
7
7
  export declare function loadPackDescriptionRaw(moduleRoot: string): Promise<BlockPackDescriptionRaw>;
8
8
  export declare function loadPackDescription(moduleRoot: string): Promise<BlockPackDescriptionAbsolute>;
package/package.json CHANGED
@@ -1,17 +1,8 @@
1
1
  {
2
2
  "name": "@platforma-sdk/block-tools",
3
- "version": "2.6.44",
3
+ "version": "2.6.45",
4
4
  "description": "Utility to manipulate Platforma Blocks and Block Registry",
5
- "types": "./dist/lib.d.ts",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/lib.d.ts",
11
- "require": "./dist/index.js",
12
- "import": "./dist/index.mjs"
13
- }
14
- },
5
+ "license": "UNLICENSED",
15
6
  "bin": {
16
7
  "block-tools": "./bin/run.js"
17
8
  },
@@ -21,25 +12,34 @@
21
12
  "./src/**/*",
22
13
  "./README.md"
23
14
  ],
24
- "license": "UNLICENSED",
15
+ "main": "./dist/index.js",
16
+ "module": "./dist/index.mjs",
17
+ "types": "./dist/lib.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/lib.d.ts",
21
+ "require": "./dist/index.js",
22
+ "import": "./dist/index.mjs"
23
+ }
24
+ },
25
25
  "dependencies": {
26
26
  "@aws-sdk/client-s3": "3.859.0",
27
- "remeda": "^2.28.0",
28
27
  "@oclif/core": "^4.0.37",
29
28
  "canonicalize": "~2.1.0",
30
29
  "lru-cache": "^11.2.2",
31
- "undici": "~7.16.0",
32
30
  "mime-types": "^2.1.35",
31
+ "remeda": "^2.28.0",
33
32
  "tar": "^7.4.3",
33
+ "undici": "~7.16.0",
34
34
  "yaml": "^2.8.0",
35
35
  "zod": "~3.23.8",
36
- "@milaboratories/pl-http": "1.2.0",
36
+ "@milaboratories/pl-http": "1.2.1",
37
+ "@milaboratories/pl-model-middle-layer": "1.11.5",
37
38
  "@milaboratories/resolve-helper": "1.1.1",
38
- "@milaboratories/pl-model-middle-layer": "1.11.4",
39
- "@milaboratories/pl-model-common": "1.24.3",
40
- "@milaboratories/ts-helpers": "1.7.0",
41
- "@platforma-sdk/blocks-deps-updater": "2.0.0",
42
- "@milaboratories/ts-helpers-oclif": "1.1.35"
39
+ "@milaboratories/ts-helpers-oclif": "1.1.36",
40
+ "@milaboratories/pl-model-common": "1.24.4",
41
+ "@milaboratories/ts-helpers": "1.7.1",
42
+ "@platforma-sdk/blocks-deps-updater": "2.0.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -47,36 +47,38 @@
47
47
  "@types/node": "~24.5.2",
48
48
  "@types/semver": "^7.7.0",
49
49
  "@vitest/coverage-istanbul": "^4.0.16",
50
- "eslint": "^9.25.1",
51
50
  "oclif": "^4.16.2",
52
51
  "rollup-plugin-node-externals": "^8.0.0",
53
52
  "semver": "^7.7.2",
54
53
  "typescript": "~5.6.3",
55
- "vite": "^6.3.5",
54
+ "vite": "^6.4.1",
56
55
  "vite-plugin-dts": "^4.5.3",
57
56
  "vitest": "^4.0.16",
58
- "@milaboratories/build-configs": "1.4.0",
57
+ "@milaboratories/build-configs": "1.4.1",
58
+ "@milaboratories/oclif-index": "1.1.1",
59
59
  "@milaboratories/ts-configs": "1.2.0",
60
- "@milaboratories/eslint-config": "1.0.5",
61
- "@milaboratories/oclif-index": "1.1.1"
60
+ "@milaboratories/ts-builder": "1.2.5"
62
61
  },
63
62
  "oclif": {
64
63
  "bin": "block-tools",
65
64
  "commands": {
65
+ "identifier": "COMMANDS",
66
66
  "strategy": "explicit",
67
- "target": "./dist/cli.js",
68
- "identifier": "COMMANDS"
67
+ "target": "./dist/cli.js"
69
68
  },
70
69
  "dirname": "block-tools",
71
70
  "topicSeparator": " "
72
71
  },
73
72
  "scripts": {
74
- "type-check": "tsc --noEmit --composite false",
75
73
  "oclif:index": "oclif-index --commands-root=./src/cmd/ --index-file=./src/cmd/index.ts",
76
74
  "build": "vite build",
77
75
  "readme": "oclif readme",
78
76
  "test": "vitest run --coverage",
79
77
  "do-pack": "rm -f *.tgz && pnpm pack && mv *.tgz package.tgz",
80
- "lint": "eslint ."
78
+ "check": "ts-builder check --target node",
79
+ "formatter:check": "ts-builder formatter --check",
80
+ "linter:check": "ts-builder linter --check",
81
+ "types:check": "ts-builder type-check --target node",
82
+ "fmt": "ts-builder format"
81
83
  }
82
84
  }
@@ -1,26 +1,26 @@
1
- import { Command, Flags } from '@oclif/core';
2
- import path from 'node:path';
3
- import fs from 'node:fs';
4
- import { loadPackDescriptionRaw } from '../v2';
5
- import { BlockPackMetaDescription, BlockPackMetaEmbedAbsoluteBase64 } from '../v2/model/block_meta';
1
+ import { Command, Flags } from "@oclif/core";
2
+ import path from "node:path";
3
+ import fs from "node:fs";
4
+ import { loadPackDescriptionRaw } from "../v2";
5
+ import { BlockPackMetaDescription, BlockPackMetaEmbedAbsoluteBase64 } from "../v2/model/block_meta";
6
6
 
7
7
  export default class BuildMeta extends Command {
8
- static override description
9
- = 'Extracts meta information from blocks package.json and outputs meta.json with embedded binary '
10
- + 'and textual information linked from the meta section.';
8
+ static override description =
9
+ "Extracts meta information from blocks package.json and outputs meta.json with embedded binary " +
10
+ "and textual information linked from the meta section.";
11
11
 
12
12
  static flags = {
13
13
  modulePath: Flags.string({
14
- char: 'i',
15
- summary: 'input module path',
16
- helpValue: '<path>',
17
- default: '.',
14
+ char: "i",
15
+ summary: "input module path",
16
+ helpValue: "<path>",
17
+ default: ".",
18
18
  }),
19
19
 
20
20
  destination: Flags.string({
21
- char: 'o',
22
- summary: 'output meta.json file',
23
- helpValue: '<path>',
21
+ char: "o",
22
+ summary: "output meta.json file",
23
+ helpValue: "<path>",
24
24
  required: true,
25
25
  }),
26
26
  };
@@ -1,12 +1,12 @@
1
- import { Command, Flags } from '@oclif/core';
2
- import fs from 'node:fs';
3
- import path from 'node:path';
1
+ import { Command, Flags } from "@oclif/core";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
4
 
5
5
  async function getFileContent(path: string) {
6
6
  try {
7
- return await fs.promises.readFile(path, 'utf8');
7
+ return await fs.promises.readFile(path, "utf8");
8
8
  } catch (error: unknown) {
9
- if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
9
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
10
10
  return undefined;
11
11
  }
12
12
  throw error;
@@ -14,29 +14,29 @@ async function getFileContent(path: string) {
14
14
  }
15
15
 
16
16
  export default class BuildModel extends Command {
17
- static override description
18
- = 'Extracts and outputs block model JSON from pre-built block model module';
17
+ static override description =
18
+ "Extracts and outputs block model JSON from pre-built block model module";
19
19
 
20
20
  static flags = {
21
21
  modulePath: Flags.string({
22
- char: 'i',
23
- summary: 'input module path',
24
- helpValue: '<path>',
25
- default: '.',
22
+ char: "i",
23
+ summary: "input module path",
24
+ helpValue: "<path>",
25
+ default: ".",
26
26
  }),
27
27
 
28
28
  sourceBundle: Flags.string({
29
- char: 'b',
30
- summary: 'bundled model code to embed into the model for callback-based rendering to work',
31
- helpValue: '<path>',
32
- default: './dist/bundle.js',
29
+ char: "b",
30
+ summary: "bundled model code to embed into the model for callback-based rendering to work",
31
+ helpValue: "<path>",
32
+ default: "./dist/bundle.js",
33
33
  }),
34
34
 
35
35
  destination: Flags.string({
36
- char: 'o',
37
- summary: 'output model file',
38
- helpValue: '<path>',
39
- default: './dist/model.json',
36
+ char: "o",
37
+ summary: "output model file",
38
+ helpValue: "<path>",
39
+ default: "./dist/model.json",
40
40
  }),
41
41
  };
42
42
 
@@ -55,21 +55,18 @@ export default class BuildModel extends Command {
55
55
 
56
56
  if (!config)
57
57
  throw new Error(
58
- 'Malformed "model" object, check it is created with "BlockModel" '
59
- + 'and ".done()" is executed as the call in the chain.',
58
+ 'Malformed "model" object, check it is created with "BlockModel" ' +
59
+ 'and ".done()" is executed as the call in the chain.',
60
60
  );
61
61
 
62
- if (
63
- !('outputs' in config)
64
- || !('sections' in config)
65
- )
62
+ if (!("outputs" in config) || !("sections" in config))
66
63
  throw new Error('"config" has unexpected structure');
67
64
 
68
65
  const code = await getFileContent(flags.sourceBundle);
69
66
  if (code !== undefined) {
70
67
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
71
68
  config.code = {
72
- type: 'plain',
69
+ type: "plain",
73
70
  content: code,
74
71
  };
75
72
  }
package/src/cmd/index.ts CHANGED
@@ -1,25 +1,25 @@
1
1
  // DO NOT EDIT. This file was generated by oclif-index utility.
2
2
 
3
- import Cmd0 from './build-meta';
4
- import Cmd1 from './build-model';
5
- import Cmd3 from './list-overview-snapshots';
6
- import Cmd4 from './mark-stable';
7
- import Cmd5 from './pack';
8
- import Cmd6 from './publish';
9
- import Cmd7 from './refresh-registry';
10
- import Cmd8 from './restore-overview-from-snapshot';
11
- import Cmd9 from './upload-package-v1';
12
- import Cmd10 from './update-deps';
3
+ import Cmd0 from "./build-meta";
4
+ import Cmd1 from "./build-model";
5
+ import Cmd3 from "./list-overview-snapshots";
6
+ import Cmd4 from "./mark-stable";
7
+ import Cmd5 from "./pack";
8
+ import Cmd6 from "./publish";
9
+ import Cmd7 from "./refresh-registry";
10
+ import Cmd8 from "./restore-overview-from-snapshot";
11
+ import Cmd9 from "./upload-package-v1";
12
+ import Cmd10 from "./update-deps";
13
13
 
14
14
  export const COMMANDS = {
15
- 'build-meta': Cmd0,
16
- 'build-model': Cmd1,
17
- 'list-overview-snapshots': Cmd3,
18
- 'mark-stable': Cmd4,
19
- 'pack': Cmd5,
20
- 'publish': Cmd6,
21
- 'refresh-registry': Cmd7,
22
- 'restore-overview-from-snapshot': Cmd8,
23
- 'upload-package-v1': Cmd9,
24
- 'update-deps': Cmd10,
15
+ "build-meta": Cmd0,
16
+ "build-model": Cmd1,
17
+ "list-overview-snapshots": Cmd3,
18
+ "mark-stable": Cmd4,
19
+ pack: Cmd5,
20
+ publish: Cmd6,
21
+ "refresh-registry": Cmd7,
22
+ "restore-overview-from-snapshot": Cmd8,
23
+ "upload-package-v1": Cmd9,
24
+ "update-deps": Cmd10,
25
25
  };
@@ -1,22 +1,22 @@
1
- import { Command, Flags } from '@oclif/core';
2
- import { BlockRegistryV2 } from '../v2/registry/registry';
3
- import { storageByUrl } from '../io/storage';
4
- import { OclifLoggerAdapter } from '@milaboratories/ts-helpers-oclif';
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { BlockRegistryV2 } from "../v2/registry/registry";
3
+ import { storageByUrl } from "../io/storage";
4
+ import { OclifLoggerAdapter } from "@milaboratories/ts-helpers-oclif";
5
5
 
6
6
  export default class ListOverviewSnapshots extends Command {
7
- static description = 'List all available global overview snapshots in the registry';
7
+ static description = "List all available global overview snapshots in the registry";
8
8
 
9
9
  static flags = {
10
10
  registry: Flags.string({
11
- char: 'r',
12
- summary: 'full address of the registry',
13
- helpValue: '<address>',
14
- env: 'PL_REGISTRY',
11
+ char: "r",
12
+ summary: "full address of the registry",
13
+ helpValue: "<address>",
14
+ env: "PL_REGISTRY",
15
15
  required: true,
16
16
  }),
17
17
 
18
18
  json: Flags.boolean({
19
- summary: 'output in JSON format',
19
+ summary: "output in JSON format",
20
20
  default: false,
21
21
  }),
22
22
  };
@@ -32,13 +32,13 @@ export default class ListOverviewSnapshots extends Command {
32
32
  this.log(JSON.stringify(snapshots, null, 2));
33
33
  } else {
34
34
  if (snapshots.length === 0) {
35
- this.log('No snapshots found.');
35
+ this.log("No snapshots found.");
36
36
  } else {
37
37
  this.log(`Found ${snapshots.length} snapshot(s):\n`);
38
38
  for (const snapshot of snapshots) {
39
39
  this.log(` ${snapshot.timestamp}`);
40
40
  this.log(` Path: ${snapshot.path}`);
41
- this.log('');
41
+ this.log("");
42
42
  }
43
43
  }
44
44
  }