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 # Exclude macOS Finder (System Explorer) View States
.DS_Store .DS_Store
# Added by cargo # Added by cargo
/target target

View File

View File

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

View File

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

View File

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

View File

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

View File