move shim to new package
This commit is contained in:
parent
a0b44bde58
commit
fe11f30c01
66 changed files with 46 additions and 23 deletions
20
build.js
20
build.js
|
|
@ -1,25 +1,9 @@
|
||||||
const esbuild = require("esbuild");
|
const esbuild = require("esbuild");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
const { version: ignisVersion } = require("./package.json");
|
|
||||||
|
|
||||||
Promise.all([
|
Promise.all([
|
||||||
// Build shim-loader.js
|
// Build shim-loader.js (delegated to packages/shim)
|
||||||
esbuild.build({
|
require("./packages/shim/build.js"),
|
||||||
entryPoints: [path.join(__dirname, "src", "shims", "loader.js")],
|
|
||||||
bundle: true,
|
|
||||||
outfile: path.join(__dirname, "dist", "shim-loader.js"),
|
|
||||||
format: "iife",
|
|
||||||
platform: "browser",
|
|
||||||
target: ["chrome90"],
|
|
||||||
alias: {
|
|
||||||
path: "path-browserify",
|
|
||||||
},
|
|
||||||
define: {
|
|
||||||
__IGNIS_VERSION__: JSON.stringify(ignisVersion),
|
|
||||||
},
|
|
||||||
logLevel: "info",
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Build ignis-ui.js (delegated to packages/ui)
|
// Build ignis-ui.js (delegated to packages/ui)
|
||||||
require("./packages/ui/build.js"),
|
require("./packages/ui/build.js"),
|
||||||
|
|
|
||||||
13
package-lock.json
generated
13
package-lock.json
generated
|
|
@ -574,7 +574,6 @@
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz",
|
||||||
"integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==",
|
"integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 20.19.0"
|
"node": ">= 20.19.0"
|
||||||
|
|
@ -2739,7 +2738,6 @@
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
||||||
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
|
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/path-key": {
|
"node_modules/path-key": {
|
||||||
|
|
@ -4444,7 +4442,16 @@
|
||||||
},
|
},
|
||||||
"packages/shim": {
|
"packages/shim": {
|
||||||
"name": "@ignis/shim",
|
"name": "@ignis/shim",
|
||||||
"version": "0.0.0-internal"
|
"version": "0.0.0-internal",
|
||||||
|
"dependencies": {
|
||||||
|
"@ignis/services": "*",
|
||||||
|
"@noble/hashes": "^2.2.0",
|
||||||
|
"pako": "^2.1.0",
|
||||||
|
"path-browserify": "^1.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"esbuild": "^0.20.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"packages/ui": {
|
"packages/ui": {
|
||||||
"name": "@ignis/ui",
|
"name": "@ignis/ui",
|
||||||
|
|
|
||||||
20
packages/shim/build.js
Normal file
20
packages/shim/build.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
const esbuild = require("esbuild");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const { version: ignisVersion } = require("../../package.json");
|
||||||
|
|
||||||
|
module.exports = esbuild.build({
|
||||||
|
entryPoints: [path.join(__dirname, "src", "loader.js")],
|
||||||
|
bundle: true,
|
||||||
|
outfile: path.join(__dirname, "dist", "shim-loader.js"),
|
||||||
|
format: "iife",
|
||||||
|
platform: "browser",
|
||||||
|
target: ["chrome90"],
|
||||||
|
alias: {
|
||||||
|
path: "path-browserify",
|
||||||
|
},
|
||||||
|
define: {
|
||||||
|
__IGNIS_VERSION__: JSON.stringify(ignisVersion),
|
||||||
|
},
|
||||||
|
logLevel: "info",
|
||||||
|
});
|
||||||
|
|
@ -2,5 +2,17 @@
|
||||||
"name": "@ignis/shim",
|
"name": "@ignis/shim",
|
||||||
"version": "0.0.0-internal",
|
"version": "0.0.0-internal",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "src/loader.js"
|
"main": "src/loader.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "node build.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@ignis/services": "*",
|
||||||
|
"@noble/hashes": "^2.2.0",
|
||||||
|
"pako": "^2.1.0",
|
||||||
|
"path-browserify": "^1.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"esbuild": "^0.20.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ app.use((req, res, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(express.static(path.join(__dirname, "..", "packages", "ui", "dist")));
|
app.use(express.static(path.join(__dirname, "..", "packages", "ui", "dist")));
|
||||||
app.use(express.static(path.join(__dirname, "..", "dist")));
|
app.use(express.static(path.join(__dirname, "..", "packages", "shim", "dist")));
|
||||||
|
|
||||||
app.use(express.static(config.obsidianAssetsPath));
|
app.use(express.static(config.obsidianAssetsPath));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue