@jointhedots/gear 1.2.0 → 1.2.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.
Files changed (115) hide show
  1. package/esm/builder/build-app-bundle.d.ts +29 -0
  2. package/esm/builder/build-app-bundle.js +9 -6
  3. package/esm/builder/build-app-host.d.ts +28 -0
  4. package/esm/builder/build-app-host.js +20 -19
  5. package/esm/builder/build-application.d.ts +51 -0
  6. package/esm/builder/build-application.js +53 -74
  7. package/esm/builder/build-library.d.ts +21 -0
  8. package/esm/builder/build-library.js +13 -10
  9. package/esm/builder/build-target.d.ts +36 -0
  10. package/esm/builder/build-target.js +20 -12
  11. package/esm/builder/helpers/emit-artifact.d.ts +13 -0
  12. package/esm/builder/helpers/emit-artifact.js +40 -0
  13. package/esm/builder/helpers/emit-bundle-manifest.d.ts +19 -0
  14. package/esm/builder/helpers/emit-bundle-manifest.js +38 -16
  15. package/esm/builder/helpers/emit-components-dts.d.ts +9 -0
  16. package/esm/builder/helpers/emit-components-dts.js +1 -2
  17. package/esm/builder/helpers/emit-esmodules.d.ts +61 -0
  18. package/esm/builder/helpers/emit-esmodules.js +22 -23
  19. package/esm/builder/helpers/emit-package-manifest.d.ts +9 -0
  20. package/esm/builder/helpers/emit-package-manifest.js +1 -2
  21. package/esm/builder/helpers/emit-static-assets.d.ts +14 -0
  22. package/esm/builder/helpers/emit-static-assets.js +1 -2
  23. package/esm/builder/helpers/emit-typescript-definition.d.ts +35 -0
  24. package/esm/builder/helpers/emit-typescript-definition.js +7 -8
  25. package/esm/builder/helpers/path-helpers.d.ts +9 -0
  26. package/esm/builder/helpers/path-helpers.js +0 -1
  27. package/esm/builder/helpers/task.d.ts +8 -0
  28. package/esm/builder/helpers/task.js +0 -1
  29. package/esm/cli.d.ts +2 -0
  30. package/esm/cli.js +1 -4
  31. package/esm/commands/init.d.ts +2 -0
  32. package/esm/commands/init.js +0 -1
  33. package/esm/commands/install.d.ts +5 -0
  34. package/esm/commands/install.js +3 -4
  35. package/esm/commands/make.d.ts +17 -0
  36. package/esm/commands/make.js +12 -5
  37. package/esm/commands/run.d.ts +8 -0
  38. package/esm/commands/run.js +6 -7
  39. package/esm/commands/serve.d.ts +9 -0
  40. package/esm/commands/serve.js +11 -13
  41. package/esm/core/commands/interface.d.ts +26 -0
  42. package/esm/core/commands/interface.js +21 -0
  43. package/esm/core/components/components.d.ts +73 -0
  44. package/esm/core/components/components.js +2 -0
  45. package/esm/core/components/helpers.d.ts +7 -0
  46. package/esm/core/components/helpers.js +68 -0
  47. package/esm/core/components/manifold.d.ts +77 -0
  48. package/esm/core/components/manifold.js +442 -0
  49. package/esm/core/components/mod.d.ts +4 -0
  50. package/esm/core/components/mod.js +4 -0
  51. package/esm/core/components/provider.d.ts +42 -0
  52. package/esm/core/components/provider.js +127 -0
  53. package/esm/core/logging/mod.d.ts +53 -0
  54. package/esm/core/logging/mod.js +142 -0
  55. package/esm/core/logging/trace.d.ts +51 -0
  56. package/esm/core/logging/trace.js +17 -0
  57. package/esm/core/mod-browser.d.ts +1 -0
  58. package/esm/core/mod-browser.js +1 -0
  59. package/esm/core/mod-node.d.ts +1 -0
  60. package/esm/core/mod-node.js +1 -0
  61. package/esm/core/mod.d.ts +5 -0
  62. package/esm/core/mod.js +5 -0
  63. package/esm/core/schema/helpers.d.ts +36 -0
  64. package/esm/core/schema/helpers.js +163 -0
  65. package/esm/core/schema/mod.d.ts +3 -0
  66. package/esm/core/schema/mod.js +3 -0
  67. package/esm/core/schema/schema.d.ts +376 -0
  68. package/esm/core/schema/schema.js +234 -0
  69. package/esm/core/schema/zod.d.ts +44 -0
  70. package/esm/core/schema/zod.js +127 -0
  71. package/esm/core/services/mod.d.ts +5 -0
  72. package/esm/core/services/mod.js +5 -0
  73. package/esm/core/services/service-accessor.d.ts +17 -0
  74. package/esm/core/services/service-accessor.js +20 -0
  75. package/esm/core/services/service-definitions.d.ts +37 -0
  76. package/esm/core/services/service-definitions.js +44 -0
  77. package/esm/core/services/service-points.d.ts +40 -0
  78. package/esm/core/services/service-points.js +164 -0
  79. package/esm/core/services/service-specification.d.ts +52 -0
  80. package/esm/core/services/service-specification.js +59 -0
  81. package/esm/core/services/settings.d.ts +29 -0
  82. package/esm/core/services/settings.js +123 -0
  83. package/esm/utils/file.d.ts +39 -0
  84. package/esm/utils/file.js +3 -4
  85. package/esm/utils/graph-ordering.d.ts +21 -0
  86. package/esm/utils/graph-ordering.js +0 -1
  87. package/esm/utils/normalized-name.d.ts +17 -0
  88. package/esm/utils/normalized-name.js +0 -1
  89. package/esm/workspace/component.d.ts +70 -0
  90. package/esm/workspace/component.js +0 -1
  91. package/esm/workspace/helpers/config-loader.d.ts +37 -0
  92. package/esm/workspace/helpers/config-loader.js +4 -5
  93. package/esm/workspace/helpers/create-manifests.d.ts +13 -0
  94. package/esm/workspace/helpers/create-manifests.js +3 -4
  95. package/esm/workspace/helpers/discover-workspace.d.ts +4 -0
  96. package/esm/workspace/helpers/discover-workspace.js +19 -30
  97. package/esm/workspace/helpers/lockfile.d.ts +5 -0
  98. package/esm/workspace/helpers/lockfile.js +13 -14
  99. package/esm/workspace/helpers/logger.d.ts +65 -0
  100. package/esm/workspace/helpers/logger.js +1 -2
  101. package/esm/workspace/helpers/package-npm.d.ts +1 -0
  102. package/esm/workspace/helpers/package-npm.js +0 -1
  103. package/esm/workspace/mod.d.ts +1 -0
  104. package/esm/workspace/mod.js +1 -0
  105. package/esm/workspace/packager.d.ts +5 -0
  106. package/esm/workspace/packager.js +1 -2
  107. package/esm/workspace/packagers/packager-standard.d.ts +7 -0
  108. package/esm/workspace/packagers/packager-standard.js +3 -4
  109. package/esm/workspace/storage.d.ts +59 -0
  110. package/esm/workspace/storage.js +4 -5
  111. package/esm/workspace/workspace.d.ts +165 -0
  112. package/esm/workspace/workspace.js +27 -16
  113. package/package.json +74 -66
  114. package/esm/commands/publish.js +0 -36
  115. package/esm/publish/publish_aws_s3.js +0 -67
@@ -1,36 +0,0 @@
1
- import Path from 'node:path';
2
- import {} from "yargs";
3
- import { publish_aws_s3 } from '../publish/publish_aws_s3.js';
4
- import { open_workspace } from "../workspace/workspace.js";
5
- export function command_publish() {
6
- return {
7
- command: 'publish',
8
- describe: 'publish resources to AWS S3',
9
- builder: (yargs) => yargs
10
- .option("app", {
11
- type: "string",
12
- required: true,
13
- })
14
- .option("bucket", {
15
- type: "string",
16
- required: true,
17
- })
18
- .option("region", {
19
- type: "string",
20
- default: "eu-north-1",
21
- })
22
- .option("dist", {
23
- type: "string",
24
- default: "./dist",
25
- }),
26
- handler: async (argv) => {
27
- const outputDir = Path.resolve(argv.dist);
28
- const ws = await open_workspace({
29
- workspace_path: ".",
30
- devmode: false,
31
- });
32
- await publish_aws_s3(argv.app, ws, argv.bucket, argv.region, outputDir);
33
- }
34
- };
35
- }
36
- //# sourceMappingURL=publish.js.map
@@ -1,67 +0,0 @@
1
- import Fs from "node:fs";
2
- import Path from "node:path";
3
- import * as AWS from "@aws-sdk/client-s3";
4
- import MIME from "mime";
5
- import { StorageFiles } from "../workspace/storage.js";
6
- import { build_application } from "../builder/build-application.js";
7
- import { Workspace } from "../workspace/workspace.js";
8
- export async function publish_aws_s3(appname, ws, bucket, region, outputDir) {
9
- const storage = new StorageFiles(ws.name, outputDir);
10
- const app = ws.get_application(appname);
11
- if (!app)
12
- throw new Error(`Application '${appname}' not exists`);
13
- console.time("build");
14
- await build_application({
15
- app,
16
- storage,
17
- version: "aws_s3",
18
- devmode: false,
19
- });
20
- console.timeEnd("build");
21
- console.time("load-files");
22
- const files = [];
23
- await collectFilesFromDirectory(outputDir, "", files);
24
- console.timeEnd("load-files");
25
- console.log(files.reduce((acc, x) => acc + x.data.length, 0) / (1034 * 1024), "Mi");
26
- console.log(files.length, "files");
27
- console.time("upload-aws-s3");
28
- const s3 = new AWS.S3({ region: region });
29
- await emitFilesToAmzS3(s3, bucket, files);
30
- console.time("upload-aws-s3");
31
- }
32
- async function collectFilesFromDirectory(path, key, files) {
33
- for (const fname of Fs.readdirSync(path)) {
34
- const fpath = Path.join(path, fname);
35
- const fkey = key ? `${key}/${fname}` : fname;
36
- const fstat = Fs.statSync(fpath);
37
- if (fstat.isFile()) {
38
- files.push({
39
- key: fkey,
40
- data: Fs.readFileSync(fpath),
41
- media: MIME.getType(fpath),
42
- });
43
- }
44
- else if (fstat.isDirectory()) {
45
- await collectFilesFromDirectory(fpath, fkey, files);
46
- }
47
- }
48
- }
49
- async function emitFilesToAmzS3(s3, bucketS3, files) {
50
- const heads = await Promise.all(files.map((item) => {
51
- return s3.headObject({
52
- Bucket: bucketS3,
53
- Key: item.key,
54
- }).then(res => res.Metadata, err => null);
55
- }));
56
- await Promise.all(files.map(async (item, i) => {
57
- const head = heads[i];
58
- await s3.putObject({
59
- Bucket: bucketS3,
60
- ACL: "public-read",
61
- Key: item.key,
62
- ContentType: item.media,
63
- Body: item.data,
64
- });
65
- }));
66
- }
67
- //# sourceMappingURL=publish_aws_s3.js.map