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

+1 -1
View File
@@ -14,7 +14,7 @@ import {
getTankStats,
idToRegion,
} from '@blitzkit/core';
import { chunk, times } from 'lodash';
import { chunk, times } from 'lodash-es';
import { commitAssets } from './core/github/commitAssets';
import { fetchPreDiscoveredIds } from './core/github/fetchPreDiscoveredIds';
@@ -451,7 +451,7 @@ export async function definitions() {
const wargamingTankopedia = (await fetch(
`https://api.wotblitz.com/wotb/encyclopedia/vehicles/?application_id=${assertSecret(
process.env.NEXT_PUBLIC_WARGAMING_APPLICATION_ID,
process.env.PUBLIC_WARGAMING_APPLICATION_ID,
)}&fields=description`,
).then((response) => response.json())) as {
data: { [key: number]: { description: null | string } };
@@ -14,7 +14,7 @@ import {
regionSubdomainToRegion,
superCompress,
} from '@blitzkit/core';
import { chunk } from 'lodash';
import { chunk } from 'lodash-es';
import { argv } from 'process';
import { commitAssets } from './core/github/commitAssets';
import { FileChange } from './core/github/commitMultipleFiles';
@@ -5,7 +5,7 @@ import {
VertexAttribute,
} from '@blitzkit/core';
import { Accessor, Document, Node, Scene } from '@gltf-transform/core';
import { times } from 'lodash';
import { times } from 'lodash-es';
import {
vertexAttributeGLTFName,
vertexAttributeGltfVectorSizes,
@@ -6,7 +6,7 @@ import {
VertexAttribute,
} from '@blitzkit/core';
import { Document, Material, Node, Scene } from '@gltf-transform/core';
import { times } from 'lodash';
import { times } from 'lodash-es';
import { dirname } from 'path';
import { Matrix4, Quaternion, Vector3, Vector4Tuple } from 'three';
import { readDVPLFile } from '../readDVPLFile';
@@ -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';
+1 -1
View File
@@ -10,7 +10,7 @@ import {
idToRegion,
retryAbleBlitzFetchEvent,
} from '@blitzkit/core';
import { chunk, times, uniq } from 'lodash';
import { chunk, times, uniq } from 'lodash-es';
import { compress, decompress } from 'lz4js';
import { commitAssets } from './core/github/commitAssets';
+2 -2
View File
@@ -9,7 +9,7 @@ import {
} from '@blitzkit/core';
import { readdir } from 'fs/promises';
import { google } from 'googleapis';
import { cloneDeep, uniqBy } from 'lodash';
import { cloneDeep, uniqBy } from 'lodash-es';
import { parse as parseYaml } from 'yaml';
import { DATA } from './buildAssets/constants';
import {
@@ -118,7 +118,7 @@ for (const tank of tanksSanitized) {
({
id: item.id!.videoId!,
author: item.snippet!.channelId!,
} satisfies Video),
}) satisfies Video,
),
};