@yongdall/assets 0.1.0 → 0.2.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/cli/assets.mjs +16 -0
- package/cli/assets.mjs.map +1 -0
- package/cli/yongdall.yml +4 -0
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/package.json +4 -4
- /package/{types.d.mts → index.d.mts} +0 -0
package/cli/assets.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import configuration, { assetsRoot, boot, projectRoot } from "@yongdall/configuration";
|
|
2
|
+
import { assets, initAssets } from "#index";
|
|
3
|
+
|
|
4
|
+
//#region cli/assets/cli/assets.mjs
|
|
5
|
+
async function assets_default() {
|
|
6
|
+
const { pluginAssets, nodeModules } = await assets(projectRoot);
|
|
7
|
+
await initAssets(projectRoot, assetsRoot, pluginAssets, nodeModules, {
|
|
8
|
+
title: configuration.title || "",
|
|
9
|
+
bootModule: configuration.bootModule,
|
|
10
|
+
bootName: configuration.bootName
|
|
11
|
+
}, boot);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { assets_default as default };
|
|
16
|
+
//# sourceMappingURL=assets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.mjs","names":[],"sources":["../../../cli/assets/cli/assets.mjs"],"sourcesContent":["import configuration, { assetsRoot, boot, projectRoot } from '@yongdall/configuration';\nimport { initAssets, assets } from '#index';\n\n\nexport default async function() {\n\tconst { pluginAssets, nodeModules } = await assets(projectRoot);\n\tawait initAssets(projectRoot, assetsRoot, pluginAssets, nodeModules, {\n\t\ttitle: configuration.title || '',\n\t\tbootModule: configuration.bootModule,\n\t\tbootName: configuration.bootName,\n\t}, boot);\n\n}\n"],"mappings":";;;;AAIA,gCAAgC;CAC/B,MAAM,EAAE,cAAc,gBAAgB,MAAM,OAAO,YAAY;AAC/D,OAAM,WAAW,aAAa,YAAY,cAAc,aAAa;EACpE,OAAO,cAAc,SAAS;EAC9B,YAAY,cAAc;EAC1B,UAAU,cAAc;EACxB,EAAE,KAAK"}
|
package/cli/yongdall.yml
ADDED
package/index.mjs
CHANGED
|
@@ -203,7 +203,7 @@ async function readPluginPackageJSON(path) {
|
|
|
203
203
|
* @param {string} name
|
|
204
204
|
*/
|
|
205
205
|
async function findNodeModule(root, name) {
|
|
206
|
-
for (let basepath = root;;) {
|
|
206
|
+
for (let basepath = await fsPromises.realpath(root);;) {
|
|
207
207
|
const path = pathFn.resolve(basepath, "node_modules", name);
|
|
208
208
|
const version = (await fsPromises.readFile(pathFn.resolve(path, "package.json"), "utf-8").then((v) => JSON.parse(v)).catch(() => null))?.version;
|
|
209
209
|
if (version && typeof version === "string") return {
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../cli/assets/createImportmap.mjs","../../cli/assets/assets.mjs","../../cli/assets/initAssets.mjs"],"sourcesContent":["/** @import {NodeModuleAssets, PluginAssets} from './types.mjs' */\nimport { pluginIdRegex } from '@yongdall/common';\nimport * as pathPosix from 'node:path/posix';\n\n\n/**\n * \n * @param {string} text \n * @param {Record<string, string | undefined>} values \n * @returns \n */\nfunction replace(text, values) {\n\tconst { index } = /#|\\?/.exec(text) || { index: Infinity };\n\treturn text.replace(/\\{%([^%]*)%\\}/g, (_, k, no) => {\n\t\tconst v = k in values && values[k];\n\t\tif (typeof v !== 'string') { return ''; }\n\t\tconst s = encodeURIComponent(v);\n\t\tif (index < no) { return s; }\n\t\treturn s.replace(/%2F/ig, '/').replace(/%40/g, '@');\n\t});\n}\n/**\n * \n * @param {Record<string, Record<string, string>>} scopes \n * @param {string} scope \n * @returns \n */\nfunction getScope(scopes, scope) {\n\tif (!(scope in scopes)) {\n\t\tscopes[scope] = {};\n\t}\n\treturn scopes[scope];\n}\n\n/**\n * \n * @param {string} serverRoot \n * @param {string} origin \n * @param {string} version \n * @param {Record<string, string>} scope \n * @param {Record<string, string>} map \n * @param {Record<string, string>} [values] \n */\nfunction replaceScope(serverRoot, origin, version, scope, map, values) {\n\n\tconst assetsRoot = `${serverRoot}/assets`;\n\tconst originRoot = `${assetsRoot}/plugins/${origin}/${version}`;\n\tconst value = {\n\t\t...values,\n\t\torigin,\n\t\t'root:server': serverRoot,\n\t\t'root:assets': assetsRoot,\n\t\t'root:origin': originRoot,\n\t};\n\tfor (const [path, url] of Object.entries(map)) {\n\t\tscope[replace(path, { origin })] = replace(url, { url: scope[path], ...value });\n\t}\n}\n/**\n * \n * @param {string} root \n * @param {Record<string, PluginAssets | undefined>} plugins \n * @param {Record<string, NodeModuleAssets>} [nodeModules] \n * @returns \n */\nexport default function createImportmap(root, plugins, nodeModules = {}) {\n\t/** @type {Record<string, string>} */\n\tconst imports = {};\n\t/** @type {Record<string, Record<string, string>>} */\n\tconst scopes = {};\n\n\n\tfor (const [itemName, assets] of Object.entries(plugins)) {\n\t\tif (!assets) { continue; }\n\t\tconst { dir, esm, alias, version } = assets;\n\t\tconst encodedPlugin = encodeURIComponent(itemName).replace(/%2F/ig, '/').replace(/%40/g, '@');\n\n\t\tconst assetsRoot = pathPosix.join(`${root}/assets/plugins/`, itemName, version);\n\t\t/** @type {Record<string, string>} */\n\t\tconst scope = { '@/': pathPosix.join(assetsRoot, `./`) };\n\t\tscopes[`${root}/assets/plugins/${encodedPlugin}/`] = scope;\n\t\tif (!esm) { continue; }\n\t\tconst nameRoot = [...new Set([itemName, pathPosix.join(itemName, dir || '')])];\n\t\tconst indexEsm = alias?.['.'];\n\t\tif (indexEsm && Object.hasOwn(esm, indexEsm)) {\n\t\t\tconst indexFile = esm[indexEsm];\n\t\t\tif (indexFile) {\n\t\t\t\tconst indexPath = pathPosix.join(assetsRoot, indexFile);\n\t\t\t\tscope['@'] = indexPath;\n\t\t\t\tfor (const name of nameRoot) {\n\t\t\t\t\timports[name] = indexPath;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const name of nameRoot) {\n\t\t\tconst path = encodeURIComponent(name).replace(/%2F/ig, '/').replace(/%40/g, '@');\n\t\t\tfor (const [k, v] of Object.entries(esm)) {\n\t\t\t\tconst key = pathPosix.join(name, k);\n\t\t\t\tif (nameRoot.includes(key)) { continue; }\n\t\t\t\timports[key] = pathPosix.join(`${root}/assets/plugins/`, path, version, v);\n\t\t\t}\n\t\t\tif (alias) {\n\t\t\t\tfor (const [k, ev] of Object.entries(alias)) {\n\t\t\t\t\tconst v = Object.hasOwn(esm, ev) && esm[ev];\n\t\t\t\t\tif (!v) { continue; }\n\t\t\t\t\tconst key = pathPosix.join(name, k);\n\t\t\t\t\tif (nameRoot.includes(key)) { continue; }\n\t\t\t\t\timports[key] = pathPosix.join(`${root}/assets/plugins/`, path, version, v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor (const [itemName, { esm, version }] of Object.entries(nodeModules)) {\n\t\t// TODO: 从 package.json 中加载\n\t\tconst exports = esm || {};\n\t\tconst encodedName = encodeURIComponent(pathPosix.join(itemName, version)).replace(/%2F/ig, '/').replace(/%40/g, '@');\n\t\timports[itemName + '/'] = pathPosix.join(`${root}/assets/node_modules/`, encodedName, './');\n\t\tfor (const [k, v] of Object.entries(exports)) {\n\t\t\tconst key = pathPosix.join(itemName, k);\n\t\t\timports[key] = pathPosix.join(`${root}/assets/node_modules/`, encodedName, v);\n\t\t}\n\t}\n\tfor (const [origin, assets] of Object.entries(plugins)) {\n\t\tif (!assets) { continue; }\n\t\tconst { importmap, esm, version } = assets;\n\n\t\t/** @type {Record<string, string>} */\n\t\tconst esmValues = {};\n\t\tfor (const [k, v] of Object.entries(esm || {})) {\n\t\t\tesmValues[`esm:${k}`] = v;\n\t\t}\n\t\tif (!importmap) { continue; }\n\t\tfor (const [id, map] of Object.entries(importmap)) {\n\t\t\tif (!map) { continue; }\n\t\t\tif (id === '/') {\n\t\t\t\treplaceScope(root, origin, version, imports, map, esmValues);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id[0] === '/') {\n\t\t\t\treplaceScope(root, origin, version, getScope(scopes, id), map, { ...esmValues, scope: id });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id === '.') {\n\t\t\t\tconst scope = `${root}/assets/plugins/${origin}/`;\n\t\t\t\treplaceScope(root, origin, version, getScope(scopes, scope), map, { ...esmValues, scope, plugin: origin });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id[0] === '.') { continue; }\n\t\t\tif (id === '*') {\n\t\t\t\tfor (const plugin of Object.keys(plugins)) {\n\t\t\t\t\tconst scope = `${root}/assets/plugins/${plugin}/`;\n\t\t\t\t\treplaceScope(root, origin, version, getScope(scopes, scope), map, { ...esmValues, scope, plugin });\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!pluginIdRegex.test(id)) { continue; }\n\t\t\tconst scope = `${root}/assets/plugins/${id}/`;\n\t\t\treplaceScope(root, origin, version, getScope(scopes, scope), map, { ...esmValues, scope, plugin: id });\n\t\t}\n\t}\n\n\treturn { imports, scopes };\n}\n","/** @import {NodeModuleAssets, PluginAssets} from './types.mjs' */\nimport * as pathFn from 'node:path';\nimport * as fsPromises from 'node:fs/promises';\nimport { loadCfg } from '@yongdall/configuration';\nimport pluginRoots from '@yongdall/plugins';\n\n/**\n * \n * @param {string} path \n * @returns \n */\nasync function importIfExist(path) {\n\tconst r = await fsPromises.stat(path).catch(() => null);\n\tif (!r?.isFile()) { return null; }\n\treturn await import(path).catch(e => { console.error(e); return null; });\n}\n/**\n * \n * @param {string} path \n */\nasync function readPluginPackageJSON(path) {\n\tconst file = pathFn.resolve(path, 'package.json');\n\tconst packageJson = await fsPromises.readFile(file, 'utf-8')\n\t\t.then(v => JSON.parse(v))\n\t\t.catch(e => { console.error(e); return null; });\n\tconst version = packageJson?.version;\n\tif (version && typeof version === 'string') {\n\t\treturn { version };\n\t}\n\treturn null;\n}\n/**\n * \n * @param {string} root \n * @param {string} name \n */\nasync function findNodeModule(root, name) {\n\tfor (let basepath = root; ;) {\n\t\tconst path = pathFn.resolve(basepath, 'node_modules', name);\n\t\tconst packageJson = await fsPromises.readFile(pathFn.resolve(path, 'package.json'), 'utf-8').then(v => JSON.parse(v)).catch(() => null);\n\t\tconst version = packageJson?.version;\n\t\tif (version && typeof version === 'string') {\n\t\t\treturn { path, version };\n\t\t}\n\t\tconst parent = pathFn.dirname(basepath);\n\t\tif (parent === basepath) { break; }\n\t\tbasepath = parent;\n\t}\n\treturn null;\n}\n/**\n * \n * @param {string} projectRoot\n */\nexport default async function assets(projectRoot) {\n\n\n\t/** @type {Record<string, NodeModuleAssets & {path: string}>} */\n\tconst nodeModules = Object.create(null);\n\t/** @type {Record<string, PluginAssets & {path: string}>} */\n\tconst pluginAssets = Object.create(null);\n\n\tconst now = `${Date.now()}`;\n\n\tfor (const [plugin, { root: pluginRoot, development }] of Object.entries(pluginRoots)) {\n\n\t\tconst assets = await importIfExist(pathFn.resolve(pluginRoot, 'assets.yongdall.mjs'));\n\t\tif (!assets) { continue; }\n\t\tconst assetPackage = await readPluginPackageJSON(pluginRoot);\n\t\tpluginAssets[plugin] = {\n\t\t\t...assets, path: pathFn.resolve(pluginRoot, assets.dir || ''),\n\t\t\tversion: !development && String(assets.version || assetPackage?.version || '').replace(/[^.\\da-zA-Z_-]/g, '') || now,\n\t\t};\n\t\tfor (const [name, value] of Object.entries(assets?.nodeModules || {})) {\n\t\t\tif (!value) { continue; }\n\t\t\tconst info = await findNodeModule(pluginRoot, name);\n\t\t\tif (!info) { continue; }\n\t\t\tnodeModules[name] = {\n\t\t\t\t...value, ...info,\n\t\t\t\tversion: String(info.version || value.version || now).replace(/[^.\\da-zA-Z_-]/g, ''),\n\t\t\t};\n\t\t}\n\t}\n\n\tfor (const [name, value] of Object.entries(await loadCfg('nodeModules') || {})) {\n\t\tconst info = await findNodeModule(projectRoot, name);\n\t\tif (!info) { continue; }\n\t\tnodeModules[name] = {\n\t\t\t...value, ...info,\n\t\t\tversion: String(info.version || value.version || 'VERSION').replace(/[^.\\da-zA-Z_-]/g, ''),\n\t\t};\n\t}\n\n\treturn {\n\t\tpluginAssets, nodeModules,\n\t};\n}\n","/** @import { Plugin } from '@yongdall/common' */\n/** @import {NodeModuleAssets, PluginAssets} from './types.mjs' */\nimport * as pathFn from 'node:path';\nimport * as pathPosix from 'node:path/posix';\nimport * as fsPromises from 'node:fs/promises';\nimport createImportmap from './createImportmap.mjs';\n\n/**\n * \n * @param {string} path \n * @returns {Promise<void>}\n */\nexport async function rm(path) {\n const stat = await fsPromises.lstat(path).catch(() => {})\n\t\tif (!stat) { return }\n\t\tif (!stat.isDirectory()) {\n\t\t\tawait fsPromises.unlink(path);\n\t\t\treturn\n\t\t}\n\t\tconst files = await fsPromises.readdir(path);\n\t\tfor (const file of files) {\n\t\t\tawait rm(pathFn.resolve(path, file));\n\t\t}\n\t\tawait fsPromises.rmdir(path);\n}\n\n\n/**\n * \n * @param {string} pluginsRoot \n * @param {Record<string, {path: string; version?: string;}>} plugins \n * @param {string} [type] \n * @returns {Promise<void>}\n */\nexport async function linkPluginAssets(pluginsRoot, plugins, type = 'Plugin Assets') {\n\tawait fsPromises.mkdir(pluginsRoot, { recursive: true })\n\tfor (const [plugin, {path, version}] of Object.entries(plugins)) {\n\t\tconsole.log(`Link ${type}: ${plugin}`);\n\t\tawait fsPromises.mkdir(pathFn.resolve(pluginsRoot, plugin), { recursive: true });\n\t\tawait fsPromises.symlink(path, pathFn.resolve(pluginsRoot, plugin, (version || `VERSION`).replace(/[^.\\da-zA-Z_-]/g, '')));\n}\n\n}\n/**\n * \n * @param {string} bootFileName\n * @param {string} [root] \n * @param {string} [title] \n * @param {string} [boot] \n * @param {string[]} [polyfill] \n * @returns {string}\n */\nexport function getIndexHtml(bootFileName, root, title, boot, polyfill) {\n\treturn `<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>${title || '拥道YongDall'}</title>\n${polyfill?.map(src => `<script src=\"${root || ''}/assets/${src}\"></script>`).join('\\n') || ''}\n<script src=\"${root || ''}/assets/${bootFileName}\"${boot ? ` boot-module=\"${boot}\"` : ''}></script>\n</head>\n<body></body>\n</html>\n`\n}\n\n/**\n * \n * @param {ReturnType<typeof createImportmap>} importmap\n * @param {Record<string, PluginAssets>} [plugins] \n */\nexport function getBootloaderJs(importmap, plugins) {\n\treturn `;(function() {\ndocument.write('<script type=\"importmap\">' + JSON.stringify(${JSON.stringify(importmap)}) + '</script>');\nwindow.yongdallPlugins = ${JSON.stringify(getPluginConfig(typeof plugins === 'object' && plugins || {}))};\nconst currentScript = document.currentScript;\nif (!currentScript) { return; }\nconst boot = currentScript.getAttribute('boot-module');\nif (boot) { import(boot); }\n})();`\n}\n/**\n * \n * @param {ReturnType<typeof createImportmap>} importmap\n */\nfunction getImportmapJs(importmap) {\n\treturn `document.write('<script type=\"importmap\">' + JSON.stringify(${JSON.stringify(importmap)}) + '</script>');`\n}\n\n/**\n * \n * @param {string} assetsDir\n */\nexport async function clearAssets(assetsDir) {\n\tconst stat = await fsPromises.lstat(assetsDir).catch(() => {})\n\tif (!stat) { return }\n\tif (!stat.isDirectory()) {\n\t\tawait fsPromises.unlink(assetsDir);\n\t\treturn\n\t}\n\tconst files = await fsPromises.readdir(assetsDir);\n\tfor (const file of files) {\n\t\tif (['index.html', 'plugins', 'node_modules'].includes(file) || /^(bootloader|importmap)(\\.\\d+)?\\.js(on)?$/.test(file)) {\n\t\t\tawait rm(pathFn.resolve(assetsDir, file));\n\t\t}\n\t}\n}\n\n/**\n * \n * @param {Record<string, PluginAssets>} pluginAssetDefines\n */\nfunction getPluginConfig(pluginAssetDefines) {\n\t/** @type {Record<string, Plugin>} */\n\tconst plugins = {}\n\tfor (const [plugin, assets] of Object.entries(pluginAssetDefines)) {\n\t\t/** @type {Plugin} */\n\t\tconst pluginDef = {}\n\t\tplugins[plugin] = pluginDef;\n\t\tif (!assets) { continue; }\n\t\tconst { files, hooks, styles } = assets;\n\t\tif (typeof hooks === 'string' && hooks) { pluginDef.hooks = hooks; }\n\t\tif (files && Object.keys(files).length) { pluginDef.assets = files; }\n\t\tif (Array.isArray(styles) && styles.length) { pluginDef.styles = styles; }\n\t\tpluginDef.version = assets.version;\n\t}\n\treturn plugins;\n}\n\n/**\n * \n * @param {string} root \n * @param {string} assetsDir \n * @param {Record<string, PluginAssets & {path: string}>} pluginAssets\n * @param {Record<string, NodeModuleAssets & {path: string}>} nodeModules\n * @param {object} options \n * @param {string} [options.serverRoot] \n * @param {string} [options.bootModule] \n * @param {string} [options.bootName] \n * @param {string} [options.title] \n * @param {object} bootConfig \n */\nexport default async function initAssets(root, assetsDir, pluginAssets, nodeModules, {\n\tserverRoot, bootModule, bootName, title,\n}, bootConfig) {\n\tconst sRoot = pathPosix.join('/', serverRoot || '', '.').replace(/\\/$/, '')\n\tconst importmap = createImportmap(sRoot, pluginAssets, nodeModules);\n\tawait clearAssets(assetsDir);\n\tawait linkPluginAssets(pathFn.resolve(assetsDir, 'plugins'), pluginAssets)\n\tawait linkPluginAssets(pathFn.resolve(assetsDir, 'node_modules'), nodeModules, 'Node Module')\n\tawait fsPromises.mkdir(pathFn.resolve(assetsDir), { recursive: true })\n\tconst polyfill = Object.values(pluginAssets).flatMap(v => v.polyfill || []);\n\n\tconst date = Date.now();\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.js`),\n\t\tgetImportmapJs(importmap),\n\t);\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.json`),\n\t\tJSON.stringify(importmap),\n\t);\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, `bootloader.${date}.js`),\n\t\tgetBootloaderJs(importmap, pluginAssets),\n\t);\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, 'index.html'),\n\t\tgetIndexHtml(`bootloader.${date}.js`, sRoot, title, bootModule, polyfill),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, `bootloader.${date}.js`),\n\t\tpathFn.resolve(assetsDir, `bootloader.js`),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.js`),\n\t\tpathFn.resolve(assetsDir, `importmap.js`),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.json`),\n\t\tpathFn.resolve(assetsDir, `importmap.json`),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, 'index.html'),\n\t\tpathFn.resolve(root, 'index.html'),\n\t).catch(() => { });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAWA,SAAS,QAAQ,MAAM,QAAQ;CAC9B,MAAM,EAAE,UAAU,OAAO,KAAK,KAAK,IAAI,EAAE,OAAO,UAAU;AAC1D,QAAO,KAAK,QAAQ,mBAAmB,GAAG,GAAG,OAAO;EACnD,MAAM,IAAI,KAAK,UAAU,OAAO;AAChC,MAAI,OAAO,MAAM,SAAY,QAAO;EACpC,MAAM,IAAI,mBAAmB,EAAE;AAC/B,MAAI,QAAQ,GAAM,QAAO;AACzB,SAAO,EAAE,QAAQ,SAAS,IAAI,CAAC,QAAQ,QAAQ,IAAI;GAClD;;;;;;;;AAQH,SAAS,SAAS,QAAQ,OAAO;AAChC,KAAI,EAAE,SAAS,QACd,QAAO,SAAS,EAAE;AAEnB,QAAO,OAAO;;;;;;;;;;;AAYf,SAAS,aAAa,YAAY,QAAQ,SAAS,OAAO,KAAK,QAAQ;CAEtE,MAAM,aAAa,GAAG,WAAW;CACjC,MAAM,aAAa,GAAG,WAAW,WAAW,OAAO,GAAG;CACtD,MAAM,QAAQ;EACb,GAAG;EACH;EACA,eAAe;EACf,eAAe;EACf,eAAe;EACf;AACD,MAAK,MAAM,CAAC,MAAM,QAAQ,OAAO,QAAQ,IAAI,CAC5C,OA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AM,WAAW,QAChB,OAAO,QAAQ,WAAW,aAAa,KAAK,OAAO,EACnD,OAAO,QAAQ,WAAW,iBAAiB,CAC3C;AACD,OAAM,WAAW,QAChB,OAAO,QAAQ,WAAW,aAAa,EACvC,OAAO,QAAQ,MAAM,aAAa,CAClC,CAAC,YAAY,GAAI"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../cli/assets/createImportmap.mjs","../../cli/assets/assets.mjs","../../cli/assets/initAssets.mjs"],"sourcesContent":["/** @import {NodeModuleAssets, PluginAssets} from './types.mjs' */\nimport { pluginIdRegex } from '@yongdall/common';\nimport * as pathPosix from 'node:path/posix';\n\n\n/**\n * \n * @param {string} text \n * @param {Record<string, string | undefined>} values \n * @returns \n */\nfunction replace(text, values) {\n\tconst { index } = /#|\\?/.exec(text) || { index: Infinity };\n\treturn text.replace(/\\{%([^%]*)%\\}/g, (_, k, no) => {\n\t\tconst v = k in values && values[k];\n\t\tif (typeof v !== 'string') { return ''; }\n\t\tconst s = encodeURIComponent(v);\n\t\tif (index < no) { return s; }\n\t\treturn s.replace(/%2F/ig, '/').replace(/%40/g, '@');\n\t});\n}\n/**\n * \n * @param {Record<string, Record<string, string>>} scopes \n * @param {string} scope \n * @returns \n */\nfunction getScope(scopes, scope) {\n\tif (!(scope in scopes)) {\n\t\tscopes[scope] = {};\n\t}\n\treturn scopes[scope];\n}\n\n/**\n * \n * @param {string} serverRoot \n * @param {string} origin \n * @param {string} version \n * @param {Record<string, string>} scope \n * @param {Record<string, string>} map \n * @param {Record<string, string>} [values] \n */\nfunction replaceScope(serverRoot, origin, version, scope, map, values) {\n\n\tconst assetsRoot = `${serverRoot}/assets`;\n\tconst originRoot = `${assetsRoot}/plugins/${origin}/${version}`;\n\tconst value = {\n\t\t...values,\n\t\torigin,\n\t\t'root:server': serverRoot,\n\t\t'root:assets': assetsRoot,\n\t\t'root:origin': originRoot,\n\t};\n\tfor (const [path, url] of Object.entries(map)) {\n\t\tscope[replace(path, { origin })] = replace(url, { url: scope[path], ...value });\n\t}\n}\n/**\n * \n * @param {string} root \n * @param {Record<string, PluginAssets | undefined>} plugins \n * @param {Record<string, NodeModuleAssets>} [nodeModules] \n * @returns \n */\nexport default function createImportmap(root, plugins, nodeModules = {}) {\n\t/** @type {Record<string, string>} */\n\tconst imports = {};\n\t/** @type {Record<string, Record<string, string>>} */\n\tconst scopes = {};\n\n\n\tfor (const [itemName, assets] of Object.entries(plugins)) {\n\t\tif (!assets) { continue; }\n\t\tconst { dir, esm, alias, version } = assets;\n\t\tconst encodedPlugin = encodeURIComponent(itemName).replace(/%2F/ig, '/').replace(/%40/g, '@');\n\n\t\tconst assetsRoot = pathPosix.join(`${root}/assets/plugins/`, itemName, version);\n\t\t/** @type {Record<string, string>} */\n\t\tconst scope = { '@/': pathPosix.join(assetsRoot, `./`) };\n\t\tscopes[`${root}/assets/plugins/${encodedPlugin}/`] = scope;\n\t\tif (!esm) { continue; }\n\t\tconst nameRoot = [...new Set([itemName, pathPosix.join(itemName, dir || '')])];\n\t\tconst indexEsm = alias?.['.'];\n\t\tif (indexEsm && Object.hasOwn(esm, indexEsm)) {\n\t\t\tconst indexFile = esm[indexEsm];\n\t\t\tif (indexFile) {\n\t\t\t\tconst indexPath = pathPosix.join(assetsRoot, indexFile);\n\t\t\t\tscope['@'] = indexPath;\n\t\t\t\tfor (const name of nameRoot) {\n\t\t\t\t\timports[name] = indexPath;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const name of nameRoot) {\n\t\t\tconst path = encodeURIComponent(name).replace(/%2F/ig, '/').replace(/%40/g, '@');\n\t\t\tfor (const [k, v] of Object.entries(esm)) {\n\t\t\t\tconst key = pathPosix.join(name, k);\n\t\t\t\tif (nameRoot.includes(key)) { continue; }\n\t\t\t\timports[key] = pathPosix.join(`${root}/assets/plugins/`, path, version, v);\n\t\t\t}\n\t\t\tif (alias) {\n\t\t\t\tfor (const [k, ev] of Object.entries(alias)) {\n\t\t\t\t\tconst v = Object.hasOwn(esm, ev) && esm[ev];\n\t\t\t\t\tif (!v) { continue; }\n\t\t\t\t\tconst key = pathPosix.join(name, k);\n\t\t\t\t\tif (nameRoot.includes(key)) { continue; }\n\t\t\t\t\timports[key] = pathPosix.join(`${root}/assets/plugins/`, path, version, v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor (const [itemName, { esm, version }] of Object.entries(nodeModules)) {\n\t\t// TODO: 从 package.json 中加载\n\t\tconst exports = esm || {};\n\t\tconst encodedName = encodeURIComponent(pathPosix.join(itemName, version)).replace(/%2F/ig, '/').replace(/%40/g, '@');\n\t\timports[itemName + '/'] = pathPosix.join(`${root}/assets/node_modules/`, encodedName, './');\n\t\tfor (const [k, v] of Object.entries(exports)) {\n\t\t\tconst key = pathPosix.join(itemName, k);\n\t\t\timports[key] = pathPosix.join(`${root}/assets/node_modules/`, encodedName, v);\n\t\t}\n\t}\n\tfor (const [origin, assets] of Object.entries(plugins)) {\n\t\tif (!assets) { continue; }\n\t\tconst { importmap, esm, version } = assets;\n\n\t\t/** @type {Record<string, string>} */\n\t\tconst esmValues = {};\n\t\tfor (const [k, v] of Object.entries(esm || {})) {\n\t\t\tesmValues[`esm:${k}`] = v;\n\t\t}\n\t\tif (!importmap) { continue; }\n\t\tfor (const [id, map] of Object.entries(importmap)) {\n\t\t\tif (!map) { continue; }\n\t\t\tif (id === '/') {\n\t\t\t\treplaceScope(root, origin, version, imports, map, esmValues);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id[0] === '/') {\n\t\t\t\treplaceScope(root, origin, version, getScope(scopes, id), map, { ...esmValues, scope: id });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id === '.') {\n\t\t\t\tconst scope = `${root}/assets/plugins/${origin}/`;\n\t\t\t\treplaceScope(root, origin, version, getScope(scopes, scope), map, { ...esmValues, scope, plugin: origin });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (id[0] === '.') { continue; }\n\t\t\tif (id === '*') {\n\t\t\t\tfor (const plugin of Object.keys(plugins)) {\n\t\t\t\t\tconst scope = `${root}/assets/plugins/${plugin}/`;\n\t\t\t\t\treplaceScope(root, origin, version, getScope(scopes, scope), map, { ...esmValues, scope, plugin });\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!pluginIdRegex.test(id)) { continue; }\n\t\t\tconst scope = `${root}/assets/plugins/${id}/`;\n\t\t\treplaceScope(root, origin, version, getScope(scopes, scope), map, { ...esmValues, scope, plugin: id });\n\t\t}\n\t}\n\n\treturn { imports, scopes };\n}\n","/** @import {NodeModuleAssets, PluginAssets} from './types.mjs' */\nimport * as pathFn from 'node:path';\nimport * as fsPromises from 'node:fs/promises';\nimport { loadCfg } from '@yongdall/configuration';\nimport pluginRoots from '@yongdall/plugins';\n\n/**\n * \n * @param {string} path \n * @returns \n */\nasync function importIfExist(path) {\n\tconst r = await fsPromises.stat(path).catch(() => null);\n\tif (!r?.isFile()) { return null; }\n\treturn await import(path).catch(e => { console.error(e); return null; });\n}\n/**\n * \n * @param {string} path \n */\nasync function readPluginPackageJSON(path) {\n\tconst file = pathFn.resolve(path, 'package.json');\n\tconst packageJson = await fsPromises.readFile(file, 'utf-8')\n\t\t.then(v => JSON.parse(v))\n\t\t.catch(e => { console.error(e); return null; });\n\tconst version = packageJson?.version;\n\tif (version && typeof version === 'string') {\n\t\treturn { version };\n\t}\n\treturn null;\n}\n/**\n * \n * @param {string} root \n * @param {string} name \n */\nasync function findNodeModule(root, name) {\n\tfor (let basepath = await fsPromises.realpath(root); ;) {\n\t\tconst path = pathFn.resolve(basepath, 'node_modules', name);\n\t\tconst packageJson = await fsPromises.readFile(pathFn.resolve(path, 'package.json'), 'utf-8').then(v => JSON.parse(v)).catch(() => null);\n\t\tconst version = packageJson?.version;\n\t\tif (version && typeof version === 'string') {\n\t\t\treturn { path, version };\n\t\t}\n\t\tconst parent = pathFn.dirname(basepath);\n\t\tif (parent === basepath) { break; }\n\t\tbasepath = parent;\n\t}\n\treturn null;\n}\n/**\n * \n * @param {string} projectRoot\n */\nexport default async function assets(projectRoot) {\n\n\n\t/** @type {Record<string, NodeModuleAssets & {path: string}>} */\n\tconst nodeModules = Object.create(null);\n\t/** @type {Record<string, PluginAssets & {path: string}>} */\n\tconst pluginAssets = Object.create(null);\n\n\tconst now = `${Date.now()}`;\n\n\tfor (const [plugin, { root: pluginRoot, development }] of Object.entries(pluginRoots)) {\n\n\t\tconst assets = await importIfExist(pathFn.resolve(pluginRoot, 'assets.yongdall.mjs'));\n\t\tif (!assets) { continue; }\n\t\tconst assetPackage = await readPluginPackageJSON(pluginRoot);\n\t\tpluginAssets[plugin] = {\n\t\t\t...assets, path: pathFn.resolve(pluginRoot, assets.dir || ''),\n\t\t\tversion: !development && String(assets.version || assetPackage?.version || '').replace(/[^.\\da-zA-Z_-]/g, '') || now,\n\t\t};\n\t\tfor (const [name, value] of Object.entries(assets?.nodeModules || {})) {\n\t\t\tif (!value) { continue; }\n\t\t\tconst info = await findNodeModule(pluginRoot, name);\n\t\t\tif (!info) { continue; }\n\t\t\tnodeModules[name] = {\n\t\t\t\t...value, ...info,\n\t\t\t\tversion: String(info.version || value.version || now).replace(/[^.\\da-zA-Z_-]/g, ''),\n\t\t\t};\n\t\t}\n\t}\n\n\tfor (const [name, value] of Object.entries(await loadCfg('nodeModules') || {})) {\n\t\tconst info = await findNodeModule(projectRoot, name);\n\t\tif (!info) { continue; }\n\t\tnodeModules[name] = {\n\t\t\t...value, ...info,\n\t\t\tversion: String(info.version || value.version || 'VERSION').replace(/[^.\\da-zA-Z_-]/g, ''),\n\t\t};\n\t}\n\n\treturn {\n\t\tpluginAssets, nodeModules,\n\t};\n}\n","/** @import { Plugin } from '@yongdall/common' */\n/** @import {NodeModuleAssets, PluginAssets} from './types.mjs' */\nimport * as pathFn from 'node:path';\nimport * as pathPosix from 'node:path/posix';\nimport * as fsPromises from 'node:fs/promises';\nimport createImportmap from './createImportmap.mjs';\n\n/**\n * \n * @param {string} path \n * @returns {Promise<void>}\n */\nexport async function rm(path) {\n const stat = await fsPromises.lstat(path).catch(() => {})\n\t\tif (!stat) { return }\n\t\tif (!stat.isDirectory()) {\n\t\t\tawait fsPromises.unlink(path);\n\t\t\treturn\n\t\t}\n\t\tconst files = await fsPromises.readdir(path);\n\t\tfor (const file of files) {\n\t\t\tawait rm(pathFn.resolve(path, file));\n\t\t}\n\t\tawait fsPromises.rmdir(path);\n}\n\n\n/**\n * \n * @param {string} pluginsRoot \n * @param {Record<string, {path: string; version?: string;}>} plugins \n * @param {string} [type] \n * @returns {Promise<void>}\n */\nexport async function linkPluginAssets(pluginsRoot, plugins, type = 'Plugin Assets') {\n\tawait fsPromises.mkdir(pluginsRoot, { recursive: true })\n\tfor (const [plugin, {path, version}] of Object.entries(plugins)) {\n\t\tconsole.log(`Link ${type}: ${plugin}`);\n\t\tawait fsPromises.mkdir(pathFn.resolve(pluginsRoot, plugin), { recursive: true });\n\t\tawait fsPromises.symlink(path, pathFn.resolve(pluginsRoot, plugin, (version || `VERSION`).replace(/[^.\\da-zA-Z_-]/g, '')));\n}\n\n}\n/**\n * \n * @param {string} bootFileName\n * @param {string} [root] \n * @param {string} [title] \n * @param {string} [boot] \n * @param {string[]} [polyfill] \n * @returns {string}\n */\nexport function getIndexHtml(bootFileName, root, title, boot, polyfill) {\n\treturn `<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>${title || '拥道YongDall'}</title>\n${polyfill?.map(src => `<script src=\"${root || ''}/assets/${src}\"></script>`).join('\\n') || ''}\n<script src=\"${root || ''}/assets/${bootFileName}\"${boot ? ` boot-module=\"${boot}\"` : ''}></script>\n</head>\n<body></body>\n</html>\n`\n}\n\n/**\n * \n * @param {ReturnType<typeof createImportmap>} importmap\n * @param {Record<string, PluginAssets>} [plugins] \n */\nexport function getBootloaderJs(importmap, plugins) {\n\treturn `;(function() {\ndocument.write('<script type=\"importmap\">' + JSON.stringify(${JSON.stringify(importmap)}) + '</script>');\nwindow.yongdallPlugins = ${JSON.stringify(getPluginConfig(typeof plugins === 'object' && plugins || {}))};\nconst currentScript = document.currentScript;\nif (!currentScript) { return; }\nconst boot = currentScript.getAttribute('boot-module');\nif (boot) { import(boot); }\n})();`\n}\n/**\n * \n * @param {ReturnType<typeof createImportmap>} importmap\n */\nfunction getImportmapJs(importmap) {\n\treturn `document.write('<script type=\"importmap\">' + JSON.stringify(${JSON.stringify(importmap)}) + '</script>');`\n}\n\n/**\n * \n * @param {string} assetsDir\n */\nexport async function clearAssets(assetsDir) {\n\tconst stat = await fsPromises.lstat(assetsDir).catch(() => {})\n\tif (!stat) { return }\n\tif (!stat.isDirectory()) {\n\t\tawait fsPromises.unlink(assetsDir);\n\t\treturn\n\t}\n\tconst files = await fsPromises.readdir(assetsDir);\n\tfor (const file of files) {\n\t\tif (['index.html', 'plugins', 'node_modules'].includes(file) || /^(bootloader|importmap)(\\.\\d+)?\\.js(on)?$/.test(file)) {\n\t\t\tawait rm(pathFn.resolve(assetsDir, file));\n\t\t}\n\t}\n}\n\n/**\n * \n * @param {Record<string, PluginAssets>} pluginAssetDefines\n */\nfunction getPluginConfig(pluginAssetDefines) {\n\t/** @type {Record<string, Plugin>} */\n\tconst plugins = {}\n\tfor (const [plugin, assets] of Object.entries(pluginAssetDefines)) {\n\t\t/** @type {Plugin} */\n\t\tconst pluginDef = {}\n\t\tplugins[plugin] = pluginDef;\n\t\tif (!assets) { continue; }\n\t\tconst { files, hooks, styles } = assets;\n\t\tif (typeof hooks === 'string' && hooks) { pluginDef.hooks = hooks; }\n\t\tif (files && Object.keys(files).length) { pluginDef.assets = files; }\n\t\tif (Array.isArray(styles) && styles.length) { pluginDef.styles = styles; }\n\t\tpluginDef.version = assets.version;\n\t}\n\treturn plugins;\n}\n\n/**\n * \n * @param {string} root \n * @param {string} assetsDir \n * @param {Record<string, PluginAssets & {path: string}>} pluginAssets\n * @param {Record<string, NodeModuleAssets & {path: string}>} nodeModules\n * @param {object} options \n * @param {string} [options.serverRoot] \n * @param {string} [options.bootModule] \n * @param {string} [options.bootName] \n * @param {string} [options.title] \n * @param {object} bootConfig \n */\nexport default async function initAssets(root, assetsDir, pluginAssets, nodeModules, {\n\tserverRoot, bootModule, bootName, title,\n}, bootConfig) {\n\tconst sRoot = pathPosix.join('/', serverRoot || '', '.').replace(/\\/$/, '')\n\tconst importmap = createImportmap(sRoot, pluginAssets, nodeModules);\n\tawait clearAssets(assetsDir);\n\tawait linkPluginAssets(pathFn.resolve(assetsDir, 'plugins'), pluginAssets)\n\tawait linkPluginAssets(pathFn.resolve(assetsDir, 'node_modules'), nodeModules, 'Node Module')\n\tawait fsPromises.mkdir(pathFn.resolve(assetsDir), { recursive: true })\n\tconst polyfill = Object.values(pluginAssets).flatMap(v => v.polyfill || []);\n\n\tconst date = Date.now();\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.js`),\n\t\tgetImportmapJs(importmap),\n\t);\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.json`),\n\t\tJSON.stringify(importmap),\n\t);\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, `bootloader.${date}.js`),\n\t\tgetBootloaderJs(importmap, pluginAssets),\n\t);\n\tawait fsPromises.writeFile(\n\t\tpathFn.resolve(assetsDir, 'index.html'),\n\t\tgetIndexHtml(`bootloader.${date}.js`, sRoot, title, bootModule, polyfill),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, `bootloader.${date}.js`),\n\t\tpathFn.resolve(assetsDir, `bootloader.js`),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, `importmap.${date}.js`),\n\t\tpathFn.resolve(assetsDir, `importmap.js`),\n\t);\n\tawait fsPromises.symlink(\n\t\tpathFn.resolve(assetsDir, `import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index.mjs"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.2.0",
|
|
12
12
|
"description": "",
|
|
13
13
|
"keywords": [],
|
|
14
14
|
"author": "",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"test.assets.yongdall": "./test.sh"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@yongdall/plugins": "^0.
|
|
22
|
-
"@yongdall/common": "^0.
|
|
23
|
-
"@yongdall/configuration": "^0.
|
|
21
|
+
"@yongdall/plugins": "^0.2.0",
|
|
22
|
+
"@yongdall/common": "^0.2.0",
|
|
23
|
+
"@yongdall/configuration": "^0.2.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {}
|
|
26
26
|
}
|
|
File without changes
|