restructure project

This commit is contained in:
Jack
2023-08-18 19:47:22 +01:00
parent f84aa034c6
commit d3e8c0d434
21 changed files with 16 additions and 15 deletions

10
.gitignore vendored
View File

@ -20,8 +20,8 @@ data.json
# Exclude macOS Finder (System Explorer) View States
.DS_Store
# Added by cargo
/target
# Added by cargo
target

View File

View File

@ -47,7 +47,7 @@ const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["main.ts"],
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",

View File

@ -4,11 +4,12 @@
"description": "Renders `typst` code blocks to images with Typst.",
"main": "main.js",
"scripts": {
"wasm": "wasm-pack build --target web",
"dev": "node esbuild.config.mjs",
"wasm-dev": "wasm-pack build --target web --dev && node esbuild.config.mjs",
"wasm-build": "wasm-pack build --target web && tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"build-dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"wasm": "wasm-pack build compiler --target web",
"wasm-dev": "wasm-pack build compiler --target web --dev",
"wasm-build-dev": "npm run wasm-dev && npm run build-dev",
"wasm-build": "npm run wasm && npm run build",
"version": "node version-bump.mjs && git add manifest.json versions.json"
},
"keywords": [],

View File

@ -1,8 +1,8 @@
//@ts-ignore
import wasmBin from './pkg/obsidian_typst_bg.wasm'
import * as typst from './pkg'
import wasmBin from '../pkg/obsidian_typst_bg.wasm'
import * as typst from '../pkg'
import { CompileCommand, WorkerRequest } from "types";
import { CompileCommand, WorkerRequest } from "src/types";
typst.initSync(wasmBin);

View File

@ -3,8 +3,8 @@ import { App, renderMath, HexString, Platform, Plugin, PluginSettingTab, Setting
// @ts-ignore
import CompilerWorker from "./compiler.worker.ts"
import TypstCanvasElement from 'typst-canvas-element';
import { WorkerRequest } from 'types.js';
import TypstCanvasElement from './typst-canvas-element';
import { WorkerRequest } from './types';
interface TypstPluginSettings {
noFill: boolean,

View File