mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-20 11:36:04 +00:00
refactor: consume Commonlib as a package
This commit is contained in:
@@ -2,15 +2,19 @@ import { glob } from "glob";
|
||||
import { resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { promises as fs } from "node:fs";
|
||||
import { isPlainText, shouldSplitAsPlainText } from "../../src/lib/src/string_and_binary/path";
|
||||
import { splitPiecesRabinKarp } from "../../src/lib/src/string_and_binary/chunks";
|
||||
import { isPlainText, shouldSplitAsPlainText } from "@vrtmrz/livesync-commonlib/compat/string_and_binary/path";
|
||||
import { splitPiecesRabinKarp } from "@vrtmrz/livesync-commonlib/compat/string_and_binary/chunks";
|
||||
import {
|
||||
PREFERRED_BASE,
|
||||
PREFERRED_JOURNAL_SYNC,
|
||||
PREFERRED_SETTING_CLOUDANT,
|
||||
PREFERRED_SETTING_SELF_HOSTED,
|
||||
} from "../../src/lib/src/common/models/setting.const.preferred";
|
||||
import { type ObsidianLiveSyncSettings, DEFAULT_SETTINGS, MAX_DOC_SIZE_BIN } from "../../src/lib/src/common/types";
|
||||
} from "@vrtmrz/livesync-commonlib/compat/common/models/setting.const.preferred";
|
||||
import {
|
||||
type ObsidianLiveSyncSettings,
|
||||
DEFAULT_SETTINGS,
|
||||
MAX_DOC_SIZE_BIN,
|
||||
} from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
|
||||
async function blobFromString(content: string): Promise<Blob> {
|
||||
return new Blob([content], { type: "text/plain" });
|
||||
|
||||
@@ -130,20 +130,13 @@ describe("release notes", () => {
|
||||
});
|
||||
|
||||
describe("release workflow", () => {
|
||||
it("regenerates and stages fallback type definitions", () => {
|
||||
it("uses the locked Commonlib package instead of generated fallback declarations", () => {
|
||||
const workflow = readFileSync(prepareReleaseWorkflow, "utf8");
|
||||
|
||||
expect(workflow).toContain("npm run build:lib:types");
|
||||
expect(workflow).toMatch(/git add[^\n]*_types/);
|
||||
});
|
||||
|
||||
it("installs Deno before post-processing fallback type definitions", () => {
|
||||
const workflow = readFileSync(prepareReleaseWorkflow, "utf8");
|
||||
const setupDeno = workflow.indexOf("denoland/setup-deno@v2");
|
||||
const buildTypes = workflow.indexOf("npm run build:lib:types");
|
||||
|
||||
expect(setupDeno).toBeGreaterThan(-1);
|
||||
expect(setupDeno).toBeLessThan(buildTypes);
|
||||
expect(workflow).not.toContain("npm run build:lib:types");
|
||||
expect(workflow).not.toMatch(/git add[^\n]*_types/);
|
||||
expect(workflow).toMatch(/git add[^\n]*package-lock\.json/);
|
||||
expect(workflow).toContain("locked Commonlib package version");
|
||||
});
|
||||
|
||||
it("keeps the release PR in draft until BRAT validation", () => {
|
||||
|
||||
Reference in New Issue
Block a user