@lapis-notes/history 0.1.0
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/CHANGELOG.md +6 -0
- package/LICENSE.md +8 -0
- package/README.md +20 -0
- package/dist/history-capture.d.ts +7 -0
- package/dist/history-capture.js +21 -0
- package/dist/history-compare-panel.css +126 -0
- package/dist/history-compare-panel.svelte +314 -0
- package/dist/history-compare-panel.svelte.d.ts +10 -0
- package/dist/history-compare-view.d.ts +24 -0
- package/dist/history-compare-view.js +97 -0
- package/dist/history-format.d.ts +3 -0
- package/dist/history-format.js +19 -0
- package/dist/history-panel.css +200 -0
- package/dist/history-panel.svelte +302 -0
- package/dist/history-panel.svelte.d.ts +8 -0
- package/dist/history-plugin.d.ts +88 -0
- package/dist/history-plugin.js +435 -0
- package/dist/history-settings-tab.d.ts +9 -0
- package/dist/history-settings-tab.js +72 -0
- package/dist/history-settings.d.ts +14 -0
- package/dist/history-settings.js +47 -0
- package/dist/history-tracking.d.ts +4 -0
- package/dist/history-tracking.js +49 -0
- package/dist/history-view-type.d.ts +2 -0
- package/dist/history-view-type.js +2 -0
- package/dist/history-view.d.ts +12 -0
- package/dist/history-view.js +36 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +9 -0
- package/dist/public-components.d.ts +2 -0
- package/dist/public-components.js +2 -0
- package/dist/register-history-settings.d.ts +105 -0
- package/dist/register-history-settings.js +199 -0
- package/dist/styles.css +2 -0
- package/manifest.json +27 -0
- package/package.json +72 -0
- package/styles.css +1 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { View } from "@lapis-notes/api";
|
|
2
|
+
import { mount, unmount } from "svelte";
|
|
3
|
+
import HistoryPanel from "./history-panel.svelte";
|
|
4
|
+
import { HistoryViewType } from "./history-view-type";
|
|
5
|
+
export class HistoryView extends View {
|
|
6
|
+
component = null;
|
|
7
|
+
constructor(leaf) {
|
|
8
|
+
super(leaf);
|
|
9
|
+
}
|
|
10
|
+
getViewType() {
|
|
11
|
+
return HistoryViewType;
|
|
12
|
+
}
|
|
13
|
+
getDisplayText() {
|
|
14
|
+
return "History";
|
|
15
|
+
}
|
|
16
|
+
getIcon() {
|
|
17
|
+
return "history";
|
|
18
|
+
}
|
|
19
|
+
onOpen() {
|
|
20
|
+
return Promise.resolve();
|
|
21
|
+
}
|
|
22
|
+
onClose() {
|
|
23
|
+
return Promise.resolve();
|
|
24
|
+
}
|
|
25
|
+
onload() {
|
|
26
|
+
this.component = mount(HistoryPanel, {
|
|
27
|
+
target: this.containerEl,
|
|
28
|
+
props: { app: this.app },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
onunload() {
|
|
32
|
+
if (this.component)
|
|
33
|
+
void unmount(this.component);
|
|
34
|
+
this.component = null;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
export { default as manifest } from "../../manifest.json";
|
|
3
|
+
export { HistoryComparePanel, HistoryPanel } from "./public-components";
|
|
4
|
+
export { HISTORY_PLUGIN_ID, HistoryPlugin, } from "./history-plugin";
|
|
5
|
+
export type { HistoryCaptureEventType, HistoryCompareAnchor, HistoryCompareMode, HistoryCompareViewState, HistoryComparisonModel, HistoryFileHistory, HistoryRevision, HistoryViewModel, } from "./history-plugin";
|
|
6
|
+
export { DEFAULT_HISTORY_EXCLUDE_GLOBS, DEFAULT_HISTORY_SETTINGS, mergeHistorySettings, patchHistorySettings, } from "./history-settings";
|
|
7
|
+
export type { HistoryPluginSettings, HistoryPluginSettingsPatch, } from "./history-settings";
|
|
8
|
+
export { HISTORY_SETTING_IDS, HISTORY_SETTINGS_SECTION_ID, createHistorySettingsSection, historyFieldValuesToPatch, historySettingsToFieldValues, registerHistorySettings, } from "./register-history-settings";
|
|
9
|
+
export { HistoryCompareView } from "./history-compare-view";
|
|
10
|
+
export { HistoryView } from "./history-view";
|
|
11
|
+
export { HistoryCompareViewType, HistoryViewType, } from "./history-view-type";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
export { default as manifest } from "../../manifest.json";
|
|
3
|
+
export { HistoryComparePanel, HistoryPanel } from "./public-components";
|
|
4
|
+
export { HISTORY_PLUGIN_ID, HistoryPlugin, } from "./history-plugin";
|
|
5
|
+
export { DEFAULT_HISTORY_EXCLUDE_GLOBS, DEFAULT_HISTORY_SETTINGS, mergeHistorySettings, patchHistorySettings, } from "./history-settings";
|
|
6
|
+
export { HISTORY_SETTING_IDS, HISTORY_SETTINGS_SECTION_ID, createHistorySettingsSection, historyFieldValuesToPatch, historySettingsToFieldValues, registerHistorySettings, } from "./register-history-settings";
|
|
7
|
+
export { HistoryCompareView } from "./history-compare-view";
|
|
8
|
+
export { HistoryView } from "./history-view";
|
|
9
|
+
export { HistoryCompareViewType, HistoryViewType, } from "./history-view-type";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Plugin } from "@lapis-notes/api";
|
|
2
|
+
import type { HistoryPlugin } from "./history-plugin";
|
|
3
|
+
import { type HistoryPluginSettings, type HistoryPluginSettingsPatch } from "./history-settings";
|
|
4
|
+
export declare const HISTORY_SETTING_IDS: {
|
|
5
|
+
readonly excludeGlobs: "history.excludeGlobs";
|
|
6
|
+
readonly includeGlobs: "history.includeGlobs";
|
|
7
|
+
readonly trackedExtensions: "history.trackedExtensions";
|
|
8
|
+
readonly retentionCount: "history.retentionCount";
|
|
9
|
+
readonly maxFileSizeKib: "history.maxFileSizeKib";
|
|
10
|
+
readonly mergeWindowSeconds: "history.mergeWindowSeconds";
|
|
11
|
+
readonly debounceMs: "history.debounceMs";
|
|
12
|
+
};
|
|
13
|
+
export declare const HISTORY_SETTINGS_SECTION_ID = "history";
|
|
14
|
+
export interface HistorySettingsFieldValues {
|
|
15
|
+
[HISTORY_SETTING_IDS.excludeGlobs]: string[];
|
|
16
|
+
[HISTORY_SETTING_IDS.includeGlobs]: string[];
|
|
17
|
+
[HISTORY_SETTING_IDS.trackedExtensions]: string[];
|
|
18
|
+
[HISTORY_SETTING_IDS.retentionCount]: number;
|
|
19
|
+
[HISTORY_SETTING_IDS.maxFileSizeKib]: number;
|
|
20
|
+
[HISTORY_SETTING_IDS.mergeWindowSeconds]: number;
|
|
21
|
+
[HISTORY_SETTING_IDS.debounceMs]: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function historySettingsToFieldValues(settings: HistoryPluginSettings): HistorySettingsFieldValues;
|
|
24
|
+
export declare function historyFieldValuesToPatch(values: Record<string, unknown>): HistoryPluginSettingsPatch;
|
|
25
|
+
export declare function createHistorySettingsSection(): {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
icon: "history";
|
|
30
|
+
order: number;
|
|
31
|
+
navigationGroupId: string;
|
|
32
|
+
sourcePluginId: string;
|
|
33
|
+
fields: ({
|
|
34
|
+
id: "history.excludeGlobs";
|
|
35
|
+
type: "list";
|
|
36
|
+
itemType: "string";
|
|
37
|
+
title: string;
|
|
38
|
+
description: string;
|
|
39
|
+
default: string[];
|
|
40
|
+
minimum?: undefined;
|
|
41
|
+
maximum?: undefined;
|
|
42
|
+
step?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
id: "history.includeGlobs";
|
|
45
|
+
type: "list";
|
|
46
|
+
itemType: "string";
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
default: string[];
|
|
50
|
+
minimum?: undefined;
|
|
51
|
+
maximum?: undefined;
|
|
52
|
+
step?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
id: "history.trackedExtensions";
|
|
55
|
+
type: "list";
|
|
56
|
+
itemType: "string";
|
|
57
|
+
title: string;
|
|
58
|
+
description: string;
|
|
59
|
+
default: string[];
|
|
60
|
+
minimum?: undefined;
|
|
61
|
+
maximum?: undefined;
|
|
62
|
+
step?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
id: "history.retentionCount";
|
|
65
|
+
type: "integer";
|
|
66
|
+
title: string;
|
|
67
|
+
description: string;
|
|
68
|
+
default: number;
|
|
69
|
+
minimum: number;
|
|
70
|
+
maximum: number;
|
|
71
|
+
step: number;
|
|
72
|
+
itemType?: undefined;
|
|
73
|
+
} | {
|
|
74
|
+
id: "history.maxFileSizeKib";
|
|
75
|
+
type: "integer";
|
|
76
|
+
title: string;
|
|
77
|
+
description: string;
|
|
78
|
+
default: number;
|
|
79
|
+
minimum: number;
|
|
80
|
+
maximum: number;
|
|
81
|
+
step: number;
|
|
82
|
+
itemType?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
id: "history.mergeWindowSeconds";
|
|
85
|
+
type: "integer";
|
|
86
|
+
title: string;
|
|
87
|
+
description: string;
|
|
88
|
+
default: number;
|
|
89
|
+
minimum: number;
|
|
90
|
+
maximum: number;
|
|
91
|
+
step: number;
|
|
92
|
+
itemType?: undefined;
|
|
93
|
+
} | {
|
|
94
|
+
id: "history.debounceMs";
|
|
95
|
+
type: "integer";
|
|
96
|
+
title: string;
|
|
97
|
+
description: string;
|
|
98
|
+
default: number;
|
|
99
|
+
minimum: number;
|
|
100
|
+
maximum: number;
|
|
101
|
+
step: number;
|
|
102
|
+
itemType?: undefined;
|
|
103
|
+
})[];
|
|
104
|
+
};
|
|
105
|
+
export declare function registerHistorySettings(plugin: HistoryPlugin & Plugin): void;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { getWorkspaceHostBinding } from "@lapis-notes/api/workspace-host";
|
|
2
|
+
import { DEFAULT_HISTORY_SETTINGS, patchHistorySettings, } from "./history-settings";
|
|
3
|
+
export const HISTORY_SETTING_IDS = {
|
|
4
|
+
excludeGlobs: "history.excludeGlobs",
|
|
5
|
+
includeGlobs: "history.includeGlobs",
|
|
6
|
+
trackedExtensions: "history.trackedExtensions",
|
|
7
|
+
retentionCount: "history.retentionCount",
|
|
8
|
+
maxFileSizeKib: "history.maxFileSizeKib",
|
|
9
|
+
mergeWindowSeconds: "history.mergeWindowSeconds",
|
|
10
|
+
debounceMs: "history.debounceMs",
|
|
11
|
+
};
|
|
12
|
+
export const HISTORY_SETTINGS_SECTION_ID = "history";
|
|
13
|
+
function bytesToKib(bytes) {
|
|
14
|
+
return Math.max(1, Math.round(bytes / 1024));
|
|
15
|
+
}
|
|
16
|
+
function kibToBytes(kib) {
|
|
17
|
+
return Math.max(1, Math.round(kib) * 1024);
|
|
18
|
+
}
|
|
19
|
+
function msToSeconds(ms) {
|
|
20
|
+
return Math.max(0, Math.round(ms / 1000));
|
|
21
|
+
}
|
|
22
|
+
function secondsToMs(seconds) {
|
|
23
|
+
return Math.max(0, Math.round(seconds) * 1000);
|
|
24
|
+
}
|
|
25
|
+
function asStringList(value) {
|
|
26
|
+
return Array.isArray(value)
|
|
27
|
+
? value.filter((entry) => typeof entry === "string")
|
|
28
|
+
: [];
|
|
29
|
+
}
|
|
30
|
+
function asInteger(value, fallback) {
|
|
31
|
+
return typeof value === "number" && Number.isFinite(value)
|
|
32
|
+
? Math.round(value)
|
|
33
|
+
: fallback;
|
|
34
|
+
}
|
|
35
|
+
function listsEqual(left, right) {
|
|
36
|
+
return (left.length === right.length &&
|
|
37
|
+
left.every((entry, index) => entry === right[index]));
|
|
38
|
+
}
|
|
39
|
+
export function historySettingsToFieldValues(settings) {
|
|
40
|
+
return {
|
|
41
|
+
[HISTORY_SETTING_IDS.excludeGlobs]: [...settings.excludeGlobs],
|
|
42
|
+
[HISTORY_SETTING_IDS.includeGlobs]: [...settings.includeGlobs],
|
|
43
|
+
[HISTORY_SETTING_IDS.trackedExtensions]: [...settings.trackedExtensions],
|
|
44
|
+
[HISTORY_SETTING_IDS.retentionCount]: settings.retentionCount,
|
|
45
|
+
[HISTORY_SETTING_IDS.maxFileSizeKib]: bytesToKib(settings.maxFileSizeBytes),
|
|
46
|
+
[HISTORY_SETTING_IDS.mergeWindowSeconds]: msToSeconds(settings.mergeWindowMs),
|
|
47
|
+
[HISTORY_SETTING_IDS.debounceMs]: settings.debounceMs,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function historyFieldValuesToPatch(values) {
|
|
51
|
+
return {
|
|
52
|
+
excludeGlobs: asStringList(values[HISTORY_SETTING_IDS.excludeGlobs]),
|
|
53
|
+
includeGlobs: asStringList(values[HISTORY_SETTING_IDS.includeGlobs]),
|
|
54
|
+
trackedExtensions: asStringList(values[HISTORY_SETTING_IDS.trackedExtensions]),
|
|
55
|
+
retentionCount: asInteger(values[HISTORY_SETTING_IDS.retentionCount], DEFAULT_HISTORY_SETTINGS.retentionCount),
|
|
56
|
+
maxFileSizeBytes: kibToBytes(asInteger(values[HISTORY_SETTING_IDS.maxFileSizeKib], bytesToKib(DEFAULT_HISTORY_SETTINGS.maxFileSizeBytes))),
|
|
57
|
+
mergeWindowMs: secondsToMs(asInteger(values[HISTORY_SETTING_IDS.mergeWindowSeconds], msToSeconds(DEFAULT_HISTORY_SETTINGS.mergeWindowMs))),
|
|
58
|
+
debounceMs: asInteger(values[HISTORY_SETTING_IDS.debounceMs], DEFAULT_HISTORY_SETTINGS.debounceMs),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function createHistorySettingsSection() {
|
|
62
|
+
const defaults = historySettingsToFieldValues(DEFAULT_HISTORY_SETTINGS);
|
|
63
|
+
return {
|
|
64
|
+
id: HISTORY_SETTINGS_SECTION_ID,
|
|
65
|
+
title: "History",
|
|
66
|
+
description: "Which vault files to snapshot and how long to keep those revisions.",
|
|
67
|
+
icon: "history",
|
|
68
|
+
order: 40,
|
|
69
|
+
navigationGroupId: "core-plugins",
|
|
70
|
+
sourcePluginId: "history",
|
|
71
|
+
fields: [
|
|
72
|
+
{
|
|
73
|
+
id: HISTORY_SETTING_IDS.excludeGlobs,
|
|
74
|
+
type: "list",
|
|
75
|
+
itemType: "string",
|
|
76
|
+
title: "Exclude globs",
|
|
77
|
+
description: "Skip matching paths. Clearing the list restores the default .obsidian, .lapis, .git, and .jj excludes.",
|
|
78
|
+
default: defaults[HISTORY_SETTING_IDS.excludeGlobs],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: HISTORY_SETTING_IDS.includeGlobs,
|
|
82
|
+
type: "list",
|
|
83
|
+
itemType: "string",
|
|
84
|
+
title: "Include globs",
|
|
85
|
+
description: "Optional path allowlist. Leave empty to snapshot remaining paths after excludes.",
|
|
86
|
+
default: defaults[HISTORY_SETTING_IDS.includeGlobs],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: HISTORY_SETTING_IDS.trackedExtensions,
|
|
90
|
+
type: "list",
|
|
91
|
+
itemType: "string",
|
|
92
|
+
title: "Included extensions",
|
|
93
|
+
description: "Optional extension allowlist without dots. Leave empty to snapshot remaining UTF-8 text under the size cap.",
|
|
94
|
+
default: defaults[HISTORY_SETTING_IDS.trackedExtensions],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: HISTORY_SETTING_IDS.retentionCount,
|
|
98
|
+
type: "integer",
|
|
99
|
+
title: "Revisions per file",
|
|
100
|
+
description: "Maximum stored snapshots for one path.",
|
|
101
|
+
default: defaults[HISTORY_SETTING_IDS.retentionCount],
|
|
102
|
+
minimum: 1,
|
|
103
|
+
maximum: 200,
|
|
104
|
+
step: 1,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: HISTORY_SETTING_IDS.maxFileSizeKib,
|
|
108
|
+
type: "integer",
|
|
109
|
+
title: "Maximum file size (KiB)",
|
|
110
|
+
description: "Files larger than this are not snapshotted.",
|
|
111
|
+
default: defaults[HISTORY_SETTING_IDS.maxFileSizeKib],
|
|
112
|
+
minimum: 1,
|
|
113
|
+
maximum: 2048,
|
|
114
|
+
step: 1,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: HISTORY_SETTING_IDS.mergeWindowSeconds,
|
|
118
|
+
type: "integer",
|
|
119
|
+
title: "Merge window (seconds)",
|
|
120
|
+
description: "Replace the latest modify for the same path when another modify arrives inside this window.",
|
|
121
|
+
default: defaults[HISTORY_SETTING_IDS.mergeWindowSeconds],
|
|
122
|
+
minimum: 0,
|
|
123
|
+
maximum: 120,
|
|
124
|
+
step: 1,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: HISTORY_SETTING_IDS.debounceMs,
|
|
128
|
+
type: "integer",
|
|
129
|
+
title: "Capture debounce (ms)",
|
|
130
|
+
description: "Delay before create and modify snapshots are stored.",
|
|
131
|
+
default: defaults[HISTORY_SETTING_IDS.debounceMs],
|
|
132
|
+
minimum: 0,
|
|
133
|
+
maximum: 5000,
|
|
134
|
+
step: 50,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function fieldValuesEqual(left, right) {
|
|
140
|
+
if (Array.isArray(left) && Array.isArray(right)) {
|
|
141
|
+
return (left.length === right.length &&
|
|
142
|
+
left.every((entry, index) => entry === right[index]));
|
|
143
|
+
}
|
|
144
|
+
return left === right;
|
|
145
|
+
}
|
|
146
|
+
const HISTORY_LIST_SETTING_IDS = new Set([
|
|
147
|
+
HISTORY_SETTING_IDS.excludeGlobs,
|
|
148
|
+
HISTORY_SETTING_IDS.includeGlobs,
|
|
149
|
+
HISTORY_SETTING_IDS.trackedExtensions,
|
|
150
|
+
]);
|
|
151
|
+
function applyHistorySettingsToController(controller, settings, options = { lists: true }) {
|
|
152
|
+
const values = historySettingsToFieldValues(settings);
|
|
153
|
+
for (const [id, value] of Object.entries(values)) {
|
|
154
|
+
if (!options.lists && HISTORY_LIST_SETTING_IDS.has(id)) {
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (!fieldValuesEqual(controller.settings.get(id), value)) {
|
|
158
|
+
controller.settings.update(id, value);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function historySettingsEqual(left, right) {
|
|
163
|
+
return (left.retentionCount === right.retentionCount &&
|
|
164
|
+
left.debounceMs === right.debounceMs &&
|
|
165
|
+
left.mergeWindowMs === right.mergeWindowMs &&
|
|
166
|
+
left.maxFileSizeBytes === right.maxFileSizeBytes &&
|
|
167
|
+
listsEqual(left.excludeGlobs, right.excludeGlobs) &&
|
|
168
|
+
listsEqual(left.includeGlobs, right.includeGlobs) &&
|
|
169
|
+
listsEqual(left.trackedExtensions, right.trackedExtensions));
|
|
170
|
+
}
|
|
171
|
+
export function registerHistorySettings(plugin) {
|
|
172
|
+
const binding = getWorkspaceHostBinding(plugin.app.workspace);
|
|
173
|
+
if (!binding)
|
|
174
|
+
return;
|
|
175
|
+
const controller = binding.controller;
|
|
176
|
+
const settings = plugin.getSettings();
|
|
177
|
+
plugin.register(controller.registerSettingsSection(createHistorySettingsSection()));
|
|
178
|
+
applyHistorySettingsToController(controller, settings);
|
|
179
|
+
const changeRef = controller.settings.on("change", (event) => {
|
|
180
|
+
if (!event.id || !event.id.startsWith("history."))
|
|
181
|
+
return;
|
|
182
|
+
const patch = historyFieldValuesToPatch(controller.settings.getSnapshot().values);
|
|
183
|
+
const current = plugin.getSettings();
|
|
184
|
+
const next = patchHistorySettings(current, patch);
|
|
185
|
+
void (async () => {
|
|
186
|
+
if (!historySettingsEqual(current, next)) {
|
|
187
|
+
await plugin.updateSettings(patch);
|
|
188
|
+
}
|
|
189
|
+
const saved = plugin.getSettings();
|
|
190
|
+
applyHistorySettingsToController(controller, saved, { lists: false });
|
|
191
|
+
const excludeDraft = asStringList(controller.settings.get(HISTORY_SETTING_IDS.excludeGlobs));
|
|
192
|
+
if (excludeDraft.every((entry) => entry.trim().length === 0) &&
|
|
193
|
+
listsEqual(saved.excludeGlobs, DEFAULT_HISTORY_SETTINGS.excludeGlobs)) {
|
|
194
|
+
controller.settings.update(HISTORY_SETTING_IDS.excludeGlobs, saved.excludeGlobs);
|
|
195
|
+
}
|
|
196
|
+
})();
|
|
197
|
+
});
|
|
198
|
+
plugin.register(() => controller.settings.offref(changeRef));
|
|
199
|
+
}
|
package/dist/styles.css
ADDED
package/manifest.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "history",
|
|
3
|
+
"name": "History",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"minAppVersion": "0.1.0",
|
|
6
|
+
"description": "File history",
|
|
7
|
+
"author": "Lapis Notes",
|
|
8
|
+
"lapis": {
|
|
9
|
+
"manifestVersion": 1,
|
|
10
|
+
"source": "official",
|
|
11
|
+
"locked": false,
|
|
12
|
+
"enabledByDefault": true,
|
|
13
|
+
"runtime": {
|
|
14
|
+
"entries": {
|
|
15
|
+
"workspace": {
|
|
16
|
+
"path": "main.mjs",
|
|
17
|
+
"format": "esm",
|
|
18
|
+
"sharedDependencies": [
|
|
19
|
+
"@lapis-notes/api",
|
|
20
|
+
"@lapis-notes/api/workspace-host"
|
|
21
|
+
],
|
|
22
|
+
"requiresReloadOnUpdate": false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lapis-notes/history",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lapis Notes file history plugin",
|
|
5
|
+
"license": "AGPL-3.0-or-later",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"manifest.json",
|
|
10
|
+
"styles.css",
|
|
11
|
+
"README.md",
|
|
12
|
+
"CHANGELOG.md",
|
|
13
|
+
"LICENSE.md",
|
|
14
|
+
"!dist/**/*.test.*",
|
|
15
|
+
"!dist/**/*.spec.*"
|
|
16
|
+
],
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"**/*.css"
|
|
19
|
+
],
|
|
20
|
+
"svelte": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"svelte": "./dist/index.js",
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./manifest.json": "./manifest.json",
|
|
30
|
+
"./styles.css": "./styles.css"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@lapis-notes/api": "^0.1.0",
|
|
34
|
+
"@lapismd/design-core": "^0.1.0",
|
|
35
|
+
"@lucide/svelte": "^0.523.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"svelte": "^5.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@sveltejs/package": "^2.5.0",
|
|
42
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
|
43
|
+
"@tsconfig/svelte": "^5.0.5",
|
|
44
|
+
"publint": "^0.3.12",
|
|
45
|
+
"svelte": "^5.38.2",
|
|
46
|
+
"svelte-check": "^4.3.1",
|
|
47
|
+
"typescript": "~5.8.3",
|
|
48
|
+
"vite": "^6.4.2",
|
|
49
|
+
"vitest": "^4.1.8"
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/lapismd/lapis-plugins.git",
|
|
54
|
+
"directory": "packages/history"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/lapismd/lapis-plugins/tree/main/packages/history#readme",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/lapismd/lapis-plugins/issues"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "pnpm run prepack",
|
|
65
|
+
"check": "pnpm check:svelte && pnpm check:types",
|
|
66
|
+
"check:svelte": "svelte-check --tsconfig ./tsconfig.app.json --fail-on-warnings --output human",
|
|
67
|
+
"check:types": "tsc -p tsconfig.node.json --noEmit",
|
|
68
|
+
"test": "vitest run --passWithNoTests",
|
|
69
|
+
"publint": "publint",
|
|
70
|
+
"pack": "pnpm pack --pack-destination ../../.release/npm"
|
|
71
|
+
}
|
|
72
|
+
}
|
package/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./dist/styles.css";
|