Skip to content

Commit

Permalink
Update jarvis-api dependency to version 0.0.2-alpha.8
Browse files Browse the repository at this point in the history
  • Loading branch information
HuakunShen committed May 30, 2024
1 parent 58baa9c commit 9599b38
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ci/build-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ for (const buildResult of buildResults) {
const pkgIcon = buildResult.pkg.jarvis.icon;
const iconClone = { ...pkgIcon };
if (buildResult.pkg.jarvis.icon.type === "asset") {
const iconPath = join(buildResult.extPath, pkgIcon.icon);
const iconPath = join(buildResult.extPath, pkgIcon.value);
if (fs.existsSync(iconPath)) {
} else {
console.error(`Icon file not found: ${iconPath}`);
}
iconClone.icon = await uploadImage(iconPath);
iconClone.value = await uploadImage(iconPath);
}
/* ---------- Update README, icon, description in extensions table ---------- */
await supabase
Expand Down
1 change: 1 addition & 0 deletions ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "module",
"scripts": {
"build-upload": "bun build-upload.ts",
"validate": "bun validate.ts",
"build-upload:watch": "bun --watch build-upload.ts",
"gen:supabase-types": "pnpm dlx supabase gen types typescript --project-id \"$SUPABASE_PROJECT_REF\" --schema public > supabase/types/supabase.ts"
},
Expand Down
4 changes: 2 additions & 2 deletions ci/src/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { createClient } from "@supabase/supabase-js";
import { type Database } from "../supabase/types/supabase";

export const supabase = createClient<Database>(
z.string().parse(process.env.SUPABASE_URL),
z.string().parse(process.env.SUPABASE_SERVICE_ROLE_KEY),
z.string().describe("Supabase URL").parse(process.env.SUPABASE_URL),
z.string().describe("Supabase Service Role Key").parse(process.env.SUPABASE_SERVICE_ROLE_KEY),
);
1 change: 1 addition & 0 deletions ci/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function computeTarballName(packageName: string, version: string): string
}

export function parsePackageJson(pkgJsonPath: string) {

const parse = ExtPackageJson.safeParse(JSON.parse(fs.readFileSync(pkgJsonPath, "utf8")));
if (parse.error) {
console.error(`Error parsing ${pkgJsonPath}: ${parse.error}`);
Expand Down
19 changes: 19 additions & 0 deletions ci/validate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import fs from "fs";
import { join } from "path";
import { buildWithDockerAndValidate, checkPackagesValidity } from "./src/utils";

// type SupabaseExtensionTable = Tables<"extensions">;
// iterate over all files in extensions directory
const extensionsDir = join(__dirname, "..", "extensions");
console.log(extensionsDir);

const extensionsCandidateFolders = fs
.readdirSync(extensionsDir)
.map((folder) => join(extensionsDir, folder)) // get full path
.filter((folder) => fs.statSync(folder).isDirectory()) // only directories
.filter((folder) => fs.existsSync(join(folder, "package.json"))); // only those with package.json
console.log(extensionsCandidateFolders);

checkPackagesValidity(extensionsCandidateFolders);

// buildWithDockerAndValidate(join(extensionsDir, "jwt"));
4 changes: 2 additions & 2 deletions extensions/git-skyline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"shortDescription": "Git Skyline 3D Model",
"longDescription": "Display Git Skyline 3D Model",
"icon": {
"type": "iconify",
"value": "tabler:building-skyscraper"
"value": "tabler:building-skyscraper",
"type": "iconify"
},
"demoImages": [],
"uiCmds": [
Expand Down

0 comments on commit 9599b38

Please sign in to comment.