feat: more migration

This commit is contained in:
TrèsAbhi committed 2024-09-14 19:43:14 -05:00
1 parent a1721eb05e
commit 502dcf4e54
146 files changed
+481 -666

No files matched your search

@@ -11,7 +11,7 @@ export class AssetCommit {
const blob = await createBlob(
'tresabhi',
assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
assertSecret(process.env.PUBLIC_ASSET_REPO),
{
content,
encoding,
@@ -28,14 +28,14 @@ export class AssetCommit {
const latestCommitSha = (
await octokit.git.getRef({
owner: 'tresabhi',
repo: assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
ref: `heads/${assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
repo: assertSecret(process.env.PUBLIC_ASSET_REPO),
ref: `heads/${assertSecret(process.env.PUBLIC_ASSET_BRANCH)}`,
})
).data.object.sha;
const treeSha = (
await octokit.git.getCommit({
owner: 'tresabhi',
repo: assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
repo: assertSecret(process.env.PUBLIC_ASSET_REPO),
commit_sha: latestCommitSha,
})
).data.tree.sha;
@@ -43,21 +43,21 @@ export class AssetCommit {
const { data: treeData } = await octokit.git.createTree({
owner: 'tresabhi',
repo: assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
repo: assertSecret(process.env.PUBLIC_ASSET_REPO),
base_tree: treeSha,
tree: blobs,
});
const { data: newCommitData } = await octokit.git.createCommit({
owner: 'tresabhi',
repo: assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
repo: assertSecret(process.env.PUBLIC_ASSET_REPO),
message: this.message,
tree: treeData.sha,
parents: [latestCommitSha],
});
await octokit.git.updateRef({
owner: 'tresabhi',
repo: assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
ref: `heads/${assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
repo: assertSecret(process.env.PUBLIC_ASSET_REPO),
ref: `heads/${assertSecret(process.env.PUBLIC_ASSET_BRANCH)}`,
sha: newCommitData.sha,
});
}
@@ -8,8 +8,8 @@ export async function commitAssets(message: string, changes: FileChange[]) {
await commitMultipleFiles(
'tresabhi',
assertSecret(process.env.NEXT_PUBLIC_ASSET_REPO),
assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH),
assertSecret(process.env.PUBLIC_ASSET_REPO),
assertSecret(process.env.PUBLIC_ASSET_BRANCH),
`${message} - ${new Date().toDateString()}`,
changes,
);
@@ -1,4 +1,4 @@
import { throttle } from 'lodash';
import { throttle } from 'lodash-es';
import { FileChange } from './commitMultipleFiles';
import { octokit } from './octokit';
@@ -3,7 +3,7 @@ import {
DidsReadStream,
DiscoveredIdsDefinitions,
} from '@blitzkit/core';
import { times } from 'lodash';
import { times } from 'lodash-es';
import { decompress } from 'lz4js';
import ProgressBar from 'progress';