@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.
- package/esm/builder/build-app-bundle.d.ts +29 -0
- package/esm/builder/build-app-bundle.js +9 -6
- package/esm/builder/build-app-host.d.ts +28 -0
- package/esm/builder/build-app-host.js +20 -19
- package/esm/builder/build-application.d.ts +51 -0
- package/esm/builder/build-application.js +53 -74
- package/esm/builder/build-library.d.ts +21 -0
- package/esm/builder/build-library.js +13 -10
- package/esm/builder/build-target.d.ts +36 -0
- package/esm/builder/build-target.js +20 -12
- package/esm/builder/helpers/emit-artifact.d.ts +13 -0
- package/esm/builder/helpers/emit-artifact.js +40 -0
- package/esm/builder/helpers/emit-bundle-manifest.d.ts +19 -0
- package/esm/builder/helpers/emit-bundle-manifest.js +38 -16
- package/esm/builder/helpers/emit-components-dts.d.ts +9 -0
- package/esm/builder/helpers/emit-components-dts.js +1 -2
- package/esm/builder/helpers/emit-esmodules.d.ts +61 -0
- package/esm/builder/helpers/emit-esmodules.js +22 -23
- package/esm/builder/helpers/emit-package-manifest.d.ts +9 -0
- package/esm/builder/helpers/emit-package-manifest.js +1 -2
- package/esm/builder/helpers/emit-static-assets.d.ts +14 -0
- package/esm/builder/helpers/emit-static-assets.js +1 -2
- package/esm/builder/helpers/emit-typescript-definition.d.ts +35 -0
- package/esm/builder/helpers/emit-typescript-definition.js +7 -8
- package/esm/builder/helpers/path-helpers.d.ts +9 -0
- package/esm/builder/helpers/path-helpers.js +0 -1
- package/esm/builder/helpers/task.d.ts +8 -0
- package/esm/builder/helpers/task.js +0 -1
- package/esm/cli.d.ts +2 -0
- package/esm/cli.js +1 -4
- package/esm/commands/init.d.ts +2 -0
- package/esm/commands/init.js +0 -1
- package/esm/commands/install.d.ts +5 -0
- package/esm/commands/install.js +3 -4
- package/esm/commands/make.d.ts +17 -0
- package/esm/commands/make.js +12 -5
- package/esm/commands/run.d.ts +8 -0
- package/esm/commands/run.js +6 -7
- package/esm/commands/serve.d.ts +9 -0
- package/esm/commands/serve.js +11 -13
- package/esm/core/commands/interface.d.ts +26 -0
- package/esm/core/commands/interface.js +21 -0
- package/esm/core/components/components.d.ts +73 -0
- package/esm/core/components/components.js +2 -0
- package/esm/core/components/helpers.d.ts +7 -0
- package/esm/core/components/helpers.js +68 -0
- package/esm/core/components/manifold.d.ts +77 -0
- package/esm/core/components/manifold.js +442 -0
- package/esm/core/components/mod.d.ts +4 -0
- package/esm/core/components/mod.js +4 -0
- package/esm/core/components/provider.d.ts +42 -0
- package/esm/core/components/provider.js +127 -0
- package/esm/core/logging/mod.d.ts +53 -0
- package/esm/core/logging/mod.js +142 -0
- package/esm/core/logging/trace.d.ts +51 -0
- package/esm/core/logging/trace.js +17 -0
- package/esm/core/mod-browser.d.ts +1 -0
- package/esm/core/mod-browser.js +1 -0
- package/esm/core/mod-node.d.ts +1 -0
- package/esm/core/mod-node.js +1 -0
- package/esm/core/mod.d.ts +5 -0
- package/esm/core/mod.js +5 -0
- package/esm/core/schema/helpers.d.ts +36 -0
- package/esm/core/schema/helpers.js +163 -0
- package/esm/core/schema/mod.d.ts +3 -0
- package/esm/core/schema/mod.js +3 -0
- package/esm/core/schema/schema.d.ts +376 -0
- package/esm/core/schema/schema.js +234 -0
- package/esm/core/schema/zod.d.ts +44 -0
- package/esm/core/schema/zod.js +127 -0
- package/esm/core/services/mod.d.ts +5 -0
- package/esm/core/services/mod.js +5 -0
- package/esm/core/services/service-accessor.d.ts +17 -0
- package/esm/core/services/service-accessor.js +20 -0
- package/esm/core/services/service-definitions.d.ts +37 -0
- package/esm/core/services/service-definitions.js +44 -0
- package/esm/core/services/service-points.d.ts +40 -0
- package/esm/core/services/service-points.js +164 -0
- package/esm/core/services/service-specification.d.ts +52 -0
- package/esm/core/services/service-specification.js +59 -0
- package/esm/core/services/settings.d.ts +29 -0
- package/esm/core/services/settings.js +123 -0
- package/esm/utils/file.d.ts +39 -0
- package/esm/utils/file.js +3 -4
- package/esm/utils/graph-ordering.d.ts +21 -0
- package/esm/utils/graph-ordering.js +0 -1
- package/esm/utils/normalized-name.d.ts +17 -0
- package/esm/utils/normalized-name.js +0 -1
- package/esm/workspace/component.d.ts +70 -0
- package/esm/workspace/component.js +0 -1
- package/esm/workspace/helpers/config-loader.d.ts +37 -0
- package/esm/workspace/helpers/config-loader.js +4 -5
- package/esm/workspace/helpers/create-manifests.d.ts +13 -0
- package/esm/workspace/helpers/create-manifests.js +3 -4
- package/esm/workspace/helpers/discover-workspace.d.ts +4 -0
- package/esm/workspace/helpers/discover-workspace.js +19 -30
- package/esm/workspace/helpers/lockfile.d.ts +5 -0
- package/esm/workspace/helpers/lockfile.js +13 -14
- package/esm/workspace/helpers/logger.d.ts +65 -0
- package/esm/workspace/helpers/logger.js +1 -2
- package/esm/workspace/helpers/package-npm.d.ts +1 -0
- package/esm/workspace/helpers/package-npm.js +0 -1
- package/esm/workspace/mod.d.ts +1 -0
- package/esm/workspace/mod.js +1 -0
- package/esm/workspace/packager.d.ts +5 -0
- package/esm/workspace/packager.js +1 -2
- package/esm/workspace/packagers/packager-standard.d.ts +7 -0
- package/esm/workspace/packagers/packager-standard.js +3 -4
- package/esm/workspace/storage.d.ts +59 -0
- package/esm/workspace/storage.js +4 -5
- package/esm/workspace/workspace.d.ts +165 -0
- package/esm/workspace/workspace.js +27 -16
- package/package.json +74 -66
- package/esm/commands/publish.js +0 -36
- package/esm/publish/publish_aws_s3.js +0 -67
package/esm/commands/publish.js
DELETED
|
@@ -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
|