From a9b33c3bbdc1fef122b5865dda1390d9185d11d4 Mon Sep 17 00:00:00 2001 From: Jason Caldwell Date: Thu, 21 Sep 2023 06:17:01 -0400 Subject: [PATCH] Project update. [p][robotic] --- .browserslistrc | 2 +- .dockerignore | 2 +- .gitattributes | 2 +- .gitignore | 2 +- .npmignore | 2 +- .prettierignore | 2 +- .vscode/settings.json | 2 +- .vscodeignore | 2 +- dev/.files/bin/includes/extensions.mjs | 16 +++ dev/.files/vite/config.mjs | 37 ++--- dev/.files/vite/includes/package/updates.mjs | 68 ++++----- dev/.files/vite/includes/rollup/config.mjs | 54 ++----- dev/.files/wrangler/config.mjs | 51 +++++-- package-lock.json | 142 +++++++++---------- package.json | 10 +- tsconfig.json | 2 +- wrangler.toml | 44 +++--- 17 files changed, 206 insertions(+), 234 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index 580daf0..fdbe3ba 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:35 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:45 AM EDT. [production] last 1 chrome versions diff --git a/.dockerignore b/.dockerignore index 4a3372e..f4249b7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:34 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:44 AM EDT. # Locals diff --git a/.gitattributes b/.gitattributes index 3f6e6c7..7cddb6e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:34 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:44 AM EDT. # Default diff --git a/.gitignore b/.gitignore index 101f31e..4480b58 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:34 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:44 AM EDT. # Locals diff --git a/.npmignore b/.npmignore index 8b8843c..1e876b5 100644 --- a/.npmignore +++ b/.npmignore @@ -25,7 +25,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:34 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:44 AM EDT. # Locals diff --git a/.prettierignore b/.prettierignore index 9bece0f..2fb75ef 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:34 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:44 AM EDT. # Packages diff --git a/.vscode/settings.json b/.vscode/settings.json index c2e39e0..3a0e431 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,7 +7,7 @@ * @note This entire file will be updated automatically. * @note Instead of editing here, please review `./settings.mjs`. * - * Last generated using `./settings.mjs` Thu, Sep 21, 2023, 4:13:34 AM EDT. + * Last generated using `./settings.mjs` Thu, Sep 21, 2023, 6:16:44 AM EDT. */ { "editor.autoIndent": "full", diff --git a/.vscodeignore b/.vscodeignore index 7971c69..e9e9110 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -17,7 +17,7 @@ # Generated data. # -# Last generated Thu, Sep 21, 2023, 4:13:34 AM EDT. +# Last generated Thu, Sep 21, 2023, 6:16:44 AM EDT. # Locals diff --git a/dev/.files/bin/includes/extensions.mjs b/dev/.files/bin/includes/extensions.mjs index ef58893..07a9ed8 100644 --- a/dev/.files/bin/includes/extensions.mjs +++ b/dev/.files/bin/includes/extensions.mjs @@ -40,6 +40,17 @@ const asBracedGlob = (exts) => { return (exts.length > 1 ? '{' : '') + noDot(exts).join(',') + (exts.length > 1 ? '}' : ''); }; +/** + * Converts an array of extensions into no-brace globstars. + * + * @param exts Array of extensions. + * + * @returns Extensions as no-brace globstars. + */ +const asNoBraceGlobstars = (exts) => { + return noDot(exts).map((ext) => '**/*.' + ext); +}; + /** * Converts an array of extensions into a regular expression fragment. * @@ -59,6 +70,7 @@ const extensions = { dot, noDot, asBracedGlob, + asNoBraceGlobstars, asRegExpFrag, /** @@ -105,6 +117,10 @@ const extensions = { allJavaScript: ['.js', '.jsx', '.cjs', '.cjsx', '.mjs', '.mjsx'], allTypeScript: ['.ts', '.tsx', '.cts', '.ctsx', '.mts', '.mtsx'], + + // Compiled WASM (WebAssembly). + + wasm: ['.wasm'], }; /** diff --git a/dev/.files/vite/config.mjs b/dev/.files/vite/config.mjs index 8db6cf2..94dc848 100644 --- a/dev/.files/vite/config.mjs +++ b/dev/.files/vite/config.mjs @@ -90,12 +90,6 @@ export default async ({ mode, command, ssrBuild: isSSRBuild }) => { const appBaseURL = env.APP_BASE_URL || ''; // e.g., `https://example.com/base`. const appBasePath = env.APP_BASE_PATH || ''; // e.g., `/base`. - let appUMDName = (pkg.name || '').toLowerCase(); - appUMDName = appUMDName.replace(/\bclevercanyon\b/gu, 'c10n'); - appUMDName = appUMDName.replace(/@/gu, '').replace(/\./gu, '-').replace(/\/+/gu, '.'); - appUMDName = appUMDName.replace(/[^a-z.0-9]([^.])/gu, (m0, m1) => m1.toUpperCase()); - appUMDName = appUMDName.replace(/^\.|\.$/u, ''); - const appType = $obp.get(pkg, 'config.c10n.&.' + (isSSRBuild ? 'ssrBuild' : 'build') + '.appType') || 'cma'; const targetEnv = $obp.get(pkg, 'config.c10n.&.' + (isSSRBuild ? 'ssrBuild' : 'build') + '.targetEnv') || 'any'; const entryFiles = $obp.get(pkg, 'config.c10n.&.' + (isSSRBuild ? 'ssrBuild' : 'build') + '.entryFiles') || []; @@ -120,14 +114,13 @@ export default async ({ mode, command, ssrBuild: isSSRBuild }) => { const targetEnvIsServer = ['cfw', 'node'].includes(targetEnv); const useMinifier = 'dev' !== mode && !['lib'].includes(appType); const preserveModules = ['lib'].includes(appType) && appEntries.length > 1; - const useUMD = !isSSRBuild && !targetEnvIsServer && !preserveModules && !peerDepKeys.length && useLibMode && 1 === appEntries.length; - const vitestSandboxEnable = $str.parseValue(String(process.env.VITEST_SANDBOX_ENABLE || '')); // We invented this environment variable. - const vitestExamplesEnable = $str.parseValue(String(process.env.VITEST_EXAMPLES_ENABLE || '')); // We invented this environment variable. + const vitestSandboxEnable = $str.parseValue(String(process.env.VITEST_SANDBOX_ENABLE || '')); + const vitestExamplesEnable = $str.parseValue(String(process.env.VITEST_EXAMPLES_ENABLE || '')); /** * Validates all of the above. */ - if (!pkg.name || !appUMDName) { + if (!pkg.name) { throw new Error('Apps must have a name.'); } if (!appEntryFiles.length || !appEntries.length) { @@ -153,9 +146,9 @@ export default async ({ mode, command, ssrBuild: isSSRBuild }) => { * Prepares `package.json` property updates. */ const pkgUpdates = await vitePkgUpdates({ - command, isSSRBuild, projDir, pkg, appType, targetEnv, useUMD, - appEntriesAsProjRelPaths, appEntriesAsSrcSubpaths, appEntriesAsSrcSubpathsNoExt - }); // prettier-ignore + command, isSSRBuild, projDir, pkg, appType, targetEnv, + appEntriesAsProjRelPaths, appEntriesAsSrcSubpaths, appEntriesAsSrcSubpathsNoExt + }); // prettier-ignore /** * Configures plugins for Vite. @@ -166,9 +159,9 @@ export default async ({ mode, command, ssrBuild: isSSRBuild }) => { await viteEJSConfig({ mode, projDir, srcDir, pkg, env }), await viteMinifyConfig({ mode }), await viteC10nConfig({ - mode, command, isSSRBuild, projDir, distDir, - pkg, env, appType, targetEnv, staticDefs, pkgUpdates - }), // prettier-ignore + mode, command, isSSRBuild, projDir, distDir, + pkg, env, appType, targetEnv, staticDefs, pkgUpdates + }), // prettier-ignore ]; /** @@ -179,7 +172,7 @@ export default async ({ mode, command, ssrBuild: isSSRBuild }) => { /** * Configures rollup for Vite. */ - const rollupConfig = await viteRollupConfig({ srcDir, distDir, a16sDir, appEntries, peerDepKeys, preserveModules, useMinifier, useUMD }); + const rollupConfig = await viteRollupConfig({ srcDir, distDir, a16sDir, appEntries, peerDepKeys, preserveModules, useMinifier }); /** * Configures tests for Vite. @@ -253,15 +246,7 @@ export default async ({ mode, command, ssrBuild: isSSRBuild }) => { minify: useMinifier ? 'esbuild' : false, // Minify userland code? modulePreload: false, // Disable. DOM injections conflict with our SPAs. - ...(useLibMode // Use library mode in Vite, with specific formats? - ? { - lib: { - name: appUMDName, // Name of UMD window global var. - entry: appEntries, // Should match up with `rollupOptions.input`. - formats: isSSRBuild ? ['es'] : useUMD ? ['es', 'umd'] : ['es', 'cjs'], - }, - } - : {}), + ...(useLibMode ? { lib: { entry: appEntries, formats: ['es'] } } : {}), rollupOptions: rollupConfig, // See: . }, }; diff --git a/dev/.files/vite/includes/package/updates.mjs b/dev/.files/vite/includes/package/updates.mjs index 63e2cc6..d427740 100644 --- a/dev/.files/vite/includes/package/updates.mjs +++ b/dev/.files/vite/includes/package/updates.mjs @@ -22,7 +22,7 @@ import u from '../../../bin/includes/utilities.mjs'; * * @returns Build-related property updates. */ -export default async ({ command, isSSRBuild, projDir, pkg, appType, targetEnv, appEntriesAsProjRelPaths, appEntriesAsSrcSubpaths, appEntriesAsSrcSubpathsNoExt, useUMD }) => { +export default async ({ command, isSSRBuild, projDir, pkg, appType, targetEnv, appEntriesAsProjRelPaths, appEntriesAsSrcSubpaths, appEntriesAsSrcSubpathsNoExt }) => { const updates = {}; // Initialize. if (isSSRBuild) { @@ -45,7 +45,7 @@ export default async ({ command, isSSRBuild, projDir, pkg, appType, targetEnv, a throw new Error('Multipage apps must have an `./index.' + extensions.asBracedGlob([...extensions.trueHTML]) + '` entry point.'); } (updates.exports = null), (updates.typesVersions = {}); - updates.module = updates.main = updates.browser = updates.unpkg = updates.types = ''; + updates.main = updates.module = updates.unpkg = updates.browser = updates.types = ''; break; // Stop here. } @@ -63,51 +63,33 @@ export default async ({ command, isSSRBuild, projDir, pkg, appType, targetEnv, a 'Library apps must have an `./index.' + extensions.asBracedGlob([...extensions.sTypeScript, ...extensions.sTypeScriptReact]) + '` entry point.', ); } - if (useUMD) { - updates.exports = { - '.': { - import: './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js', - require: './dist/' + appEntryIndexAsSrcSubpathNoExt + '.umd.cjs', - types: './dist/types/' + appEntryIndexAsSrcSubpathNoExt + '.d.ts', - }, - }; - updates.module = './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js'; - updates.main = './dist/' + appEntryIndexAsSrcSubpathNoExt + '.umd.cjs'; - - updates.browser = ['web', 'webw'].includes(targetEnv) ? updates.main : ''; - updates.unpkg = updates.main; + updates.exports = { + '.': { + types: './dist/types/' + appEntryIndexAsSrcSubpathNoExt + '.d.ts', // First, always. + import: './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js', // ESM module import path. + default: './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js', // Last, always. + }, + }; + updates.main = './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js'; + updates.module = './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js'; - updates.types = './dist/types/' + appEntryIndexAsSrcSubpathNoExt + '.d.ts'; - updates.typesVersions = { '>=3.1': { './*': ['./dist/types/*'] } }; - } else { - updates.exports = { - '.': { - import: './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js', - require: './dist/' + appEntryIndexAsSrcSubpathNoExt + '.cjs', - types: './dist/types/' + appEntryIndexAsSrcSubpathNoExt + '.d.ts', - }, - }; - updates.module = './dist/' + appEntryIndexAsSrcSubpathNoExt + '.js'; - updates.main = './dist/' + appEntryIndexAsSrcSubpathNoExt + '.cjs'; + updates.unpkg = updates.module; // Same, same. ESM-only builds. + updates.browser = ['web'].includes(targetEnv) ? updates.module : ''; - updates.browser = ['web', 'webw'].includes(targetEnv) ? updates.module : ''; - updates.unpkg = updates.module; + updates.typesVersions = { '>=3.1': { './*': ['./dist/types/*'] } }; + updates.types = './dist/types/' + appEntryIndexAsSrcSubpathNoExt + '.d.ts'; - updates.types = './dist/types/' + appEntryIndexAsSrcSubpathNoExt + '.d.ts'; - updates.typesVersions = { '>=3.1': { './*': ['./dist/types/*'] } }; - - for (const appEntryAsSrcSubpathNoExt of appEntriesAsSrcSubpathsNoExt) { - if (appEntryAsSrcSubpathNoExt === appEntryIndexAsSrcSubpathNoExt) { - continue; // Don't remap the entry index. - } - $obj.patchDeep(updates.exports, { - ['./' + appEntryAsSrcSubpathNoExt]: { - import: './dist/' + appEntryAsSrcSubpathNoExt + '.js', - require: './dist/' + appEntryAsSrcSubpathNoExt + '.cjs', - types: './dist/types/' + appEntryAsSrcSubpathNoExt + '.d.ts', - }, - }); + for (const appEntryAsSrcSubpathNoExt of appEntriesAsSrcSubpathsNoExt) { + if (appEntryAsSrcSubpathNoExt === appEntryIndexAsSrcSubpathNoExt) { + continue; // Don't remap the entry index. } + $obj.patchDeep(updates.exports, { + ['./' + appEntryAsSrcSubpathNoExt]: { + types: './dist/types/' + appEntryAsSrcSubpathNoExt + '.d.ts', // First, always. + import: './dist/' + appEntryAsSrcSubpathNoExt + '.js', // ESM module import path. + default: './dist/' + appEntryAsSrcSubpathNoExt + '.js', // Last, always. + }, + }); } break; // Stop here. } diff --git a/dev/.files/vite/includes/rollup/config.mjs b/dev/.files/vite/includes/rollup/config.mjs index 3d8cf2a..bbd38d0 100644 --- a/dev/.files/vite/includes/rollup/config.mjs +++ b/dev/.files/vite/includes/rollup/config.mjs @@ -12,7 +12,8 @@ */ import path from 'node:path'; -import { $json, $str } from '../../../../../node_modules/@clevercanyon/utilities/dist/index.js'; +import { $path, $str } from '../../../../../node_modules/@clevercanyon/utilities/dist/index.js'; +import extensions from '../../../bin/includes/extensions.mjs'; /** * Configures rollup for Vite. @@ -21,10 +22,7 @@ import { $json, $str } from '../../../../../node_modules/@clevercanyon/utilities * * @returns Rollup configuration. */ -export default async ({ srcDir, distDir, a16sDir, appEntries, peerDepKeys, preserveModules, useMinifier, useUMD }) => { - const entryCounters = new Map(), - chunkCounters = new Map(); - +export default async ({ srcDir, distDir, a16sDir, appEntries, peerDepKeys, preserveModules, useMinifier }) => { return { input: appEntries, @@ -42,50 +40,28 @@ export default async ({ srcDir, distDir, a16sDir, appEntries, peerDepKeys, prese compact: useMinifier, // Minify wrapper code generated by rollup? // By default, special chars in a path like `[[name]].js` get changed to `__name__.js`. - // This prevents that by enforcing a custom sanitizer. See: for details. + // This prevents that by enforcing a custom sanitizer. More details: . sanitizeFileName: (fileName) => fileName.replace(/[\0?*]/gu, ''), - // By default, in SSR mode, Vite forces all entry files into the distDir root. + // By default, in SSR mode, Vite forces all entry files into the `distDir` root. // This prevents that by enforcing a consistently relative location for all entries. entryFileNames: (entry) => { - // This function doesn’t have access to the current output format, unfortunately. - // However, we are setting `build.lib.formats` explicitly in the configuration below. - // Therefore, we know `es` comes first, followed by either `umd` or `cjs` output entries. - // So, entry counters make it possible to infer build output format, based on sequence. - - const entryKey = $json.stringify(entry); // JSON serialization. - const entryCounter = Number(entryCounters.get(entryKey) || 0) + 1; - - const entryFormat = entryCounter > 1 ? (useUMD ? 'umd' : 'cjs') : 'es'; - const entryExt = 'umd' === entryFormat ? 'umd.cjs' : 'cjs' === entryFormat ? 'cjs' : 'js'; - - entryCounters.set(entryKey, entryCounter); // Updates counter. - - if ('.html' === path.extname(entry.facadeModuleId)) { - if (/\//u.test(entry.name)) return '[name]-[hash].' + entryExt; - return path.join(path.relative(distDir, a16sDir), '[name]-[hash].' + entryExt); + if ([...extensions.trueHTML].includes($path.ext(entry.facadeModuleId))) { + if (/\//u.test(entry.name)) return '[name]-[hash].js'; // Already a subpath. + return path.join(path.relative(distDir, a16sDir), '[name]-[hash].js'); } - if (/\//u.test(entry.name)) return '[name].' + entryExt; // Already a subpath. - return path.join(path.relative(srcDir, path.dirname(entry.facadeModuleId)), '[name].' + entryExt); + if (/\//u.test(entry.name)) return '[name].js'; // Already a subpath. + return path.join(path.relative(srcDir, path.dirname(entry.facadeModuleId)), '[name].js'); }, // By default, in library mode, Vite ignores `build.assetsDir`. // This prevents that by enforcing a consistent location for chunks and assets. - chunkFileNames: (chunk) => { - // This function doesn’t have access to the current output format, unfortunately. - // However, we are setting `build.lib.formats` explicitly in the configuration below. - // Therefore, we know `es` comes first, followed by either `umd` or `cjs` output chunks. - // So, chunk counters make it possible to infer build output format, based on sequence. - - const chunkKey = $json.stringify(chunk); // JSON serialization. - const chunkCounter = Number(chunkCounters.get(chunkKey) || 0) + 1; - - const chunkFormat = chunkCounter > 1 ? (useUMD ? 'umd' : 'cjs') : 'es'; - const chunkExt = 'umd' === chunkFormat ? 'umd.cjs' : 'cjs' === chunkFormat ? 'cjs' : 'js'; - - chunkCounters.set(chunkKey, chunkCounter); // Updates counter. - return path.join(path.relative(distDir, a16sDir), '[name]-[hash].' + chunkExt); + chunkFileNames: (/* chunk */) => { + return path.join(path.relative(distDir, a16sDir), '[name]-[hash].js'); }, + + // By default, in library mode, Vite ignores `build.assetsDir`. + // This prevents that by enforcing a consistent location for chunks and assets. assetFileNames: (/* asset */) => path.join(path.relative(distDir, a16sDir), '[name]-[hash].[ext]'), // Preserves module structure in apps built explicitly as multi-entry libraries. diff --git a/dev/.files/wrangler/config.mjs b/dev/.files/wrangler/config.mjs index 0b31af3..54549e7 100755 --- a/dev/.files/wrangler/config.mjs +++ b/dev/.files/wrangler/config.mjs @@ -23,6 +23,7 @@ import path from 'node:path'; import { $fs } from '../../../node_modules/@clevercanyon/utilities.node/dist/index.js'; import { $path, $str, $url } from '../../../node_modules/@clevercanyon/utilities/dist/index.js'; +import extensions from '../bin/includes/extensions.mjs'; import u from '../bin/includes/utilities.mjs'; const __dirname = $fs.imuDirname(import.meta.url); @@ -49,10 +50,10 @@ export default async () => { send_metrics: false, // Don't share usage. usage_model: 'bundled', // 10M/mo free + $0.50/M. - // Account ID and worker name. + // Worker name & account ID. - account_id: defaultAccountId, name: defaultWorkerName, + account_id: defaultAccountId, // Workers.dev configuration. @@ -65,11 +66,31 @@ export default async () => { // Dynamic import configuration. rules: [ - { type: 'Data', globs: ['**/*.bin'], fallthrough: false }, - { type: 'CompiledWasm', globs: ['**/*.wasm'], fallthrough: false }, - { type: 'ESModule', globs: ['**/*.js', '**/*.jsx', '**/*.mjs', '**/*.mjsx'], fallthrough: false }, - { type: 'CommonJS', globs: ['**/*.cjs', '**/*.cjsx', '**/*.node'], fallthrough: false }, - { type: 'Text', globs: ['**/*.md', '**/*.txt', '**/*.xml', '**/*.html', '**/*.shtml', '**/*.ejs', '**/*.json'], fallthrough: false }, + { + type: 'Text', + globs: extensions.asNoBraceGlobstars([]), + fallthrough: false, + }, + { + type: 'ESModule', + globs: extensions.asNoBraceGlobstars([ + ...extensions.sJavaScript, // + ...extensions.mJavaScript, + ...extensions.sJavaScriptReact, + ...extensions.mJavaScriptReact, + ]), + fallthrough: false, + }, + { + type: 'CommonJS', + globs: extensions.asNoBraceGlobstars([ + ...extensions.cJavaScript, // + ...extensions.cJavaScriptReact, + ]), + fallthrough: false, + }, + { type: 'CompiledWasm', globs: extensions.asNoBraceGlobstars([...extensions.wasm]), fallthrough: false }, + { type: 'Data', globs: extensions.asNoBraceGlobstars([].filter((ext) => '.wasm' !== ext)), fallthrough: false }, ], // Custom build configuration. @@ -78,14 +99,6 @@ export default async () => { watch_dir: './' + path.relative(projDir, './src'), command: 'npx @clevercanyon/madrun build --mode=prod', }, - // Other environments used by this worker. - - env: { - dev: { - workers_dev: false, - build: { command: 'npx @clevercanyon/madrun build --mode=dev' }, - }, - }, // Worker sites; i.e., bucket configuration. site: { @@ -101,6 +114,14 @@ export default async () => { zone_name: defaultZoneName, pattern: defaultZoneDomain + '/' + $url.encode(defaultWorkerName) + '/*', }, + // Other environments used by this worker. + + env: { + dev: { + workers_dev: false, + build: { command: 'npx @clevercanyon/madrun build --mode=dev' }, + }, + }, }; /** diff --git a/package-lock.json b/package-lock.json index 3f7232c..d241a34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,10 +17,10 @@ "linux" ], "dependencies": { - "@clevercanyon/utilities": "^1.0.265" + "@clevercanyon/utilities": "^1.0.266" }, "devDependencies": { - "@clevercanyon/dev-deps": "^1.0.229" + "@clevercanyon/dev-deps": "^1.0.230" }, "engines": { "node": "^19.1.0 || ^20.5.1", @@ -765,9 +765,9 @@ "dev": true }, "node_modules/@clevercanyon/dev-deps": { - "version": "1.0.229", - "resolved": "https://registry.npmjs.org/@clevercanyon/dev-deps/-/dev-deps-1.0.229.tgz", - "integrity": "sha512-pNm9NP9bQY3ytbN/LVisbKDujWk0q2NmwPp4hhXrto2V1hEntc/6KfNqrd/c1ncCP/YgM0pBOE+280Iqsr5Ikw==", + "version": "1.0.230", + "resolved": "https://registry.npmjs.org/@clevercanyon/dev-deps/-/dev-deps-1.0.230.tgz", + "integrity": "sha512-T64usCA275IUe4JngAqhStCaNe7NxVtnRjAZmX8y98Qipfc8BFOBpIqhx4czpdkKQmT6LhzyyzTxHsJ/PD1uYA==", "cpu": [ "x64", "arm64" @@ -778,10 +778,10 @@ "linux" ], "dependencies": { - "@clevercanyon/madrun": "^1.0.97", - "@clevercanyon/utilities": "^1.0.264", - "@clevercanyon/utilities.cfp": "^1.0.92", - "@clevercanyon/utilities.node": "^1.0.104", + "@clevercanyon/madrun": "^1.0.98", + "@clevercanyon/utilities": "^1.0.265", + "@clevercanyon/utilities.cfp": "^1.0.93", + "@clevercanyon/utilities.node": "^1.0.105", "@cloudflare/workers-types": "^4.20230914.0", "@eslint/js": "^8.48.0", "@iarna/toml": "^2.2.5", @@ -876,9 +876,9 @@ } }, "node_modules/@clevercanyon/madrun": { - "version": "1.0.98", - "resolved": "https://registry.npmjs.org/@clevercanyon/madrun/-/madrun-1.0.98.tgz", - "integrity": "sha512-oSQuKe7eKy/4etUcLb5pfJ2XwICz8AbZ/6DrHl3bAub58dY158tvsei7lp5K/EhXhG3taXMy68NuZ5nTouwsfg==", + "version": "1.0.99", + "resolved": "https://registry.npmjs.org/@clevercanyon/madrun/-/madrun-1.0.99.tgz", + "integrity": "sha512-X32w6B1jO2Z0r2b48pk68WkAmhmYY6roZw0Brm81pTRjEX2GpJDoavSKWFUERmVe8Rja8ZsRtQGCiSx4EDm/lA==", "cpu": [ "x64", "arm64" @@ -889,8 +889,8 @@ "linux" ], "dependencies": { - "@clevercanyon/utilities": "^1.0.264", - "@clevercanyon/utilities.node": "^1.0.104" + "@clevercanyon/utilities": "^1.0.265", + "@clevercanyon/utilities.node": "^1.0.105" }, "bin": { "madrun": "dist/bin/cli.js" @@ -904,9 +904,9 @@ } }, "node_modules/@clevercanyon/preact-iso.fork": { - "version": "2.3.61", - "resolved": "https://registry.npmjs.org/@clevercanyon/preact-iso.fork/-/preact-iso.fork-2.3.61.tgz", - "integrity": "sha512-WbHxx1IdpP/PNGdORyI09o6J/+T+JDf1OTimTrd0pLVr3eBEmHhCJvER1G05vP2liH1tYEOZplNHtISEN0gbXA==", + "version": "2.3.62", + "resolved": "https://registry.npmjs.org/@clevercanyon/preact-iso.fork/-/preact-iso.fork-2.3.62.tgz", + "integrity": "sha512-UniJdsCQSdq2XUfSlo0xdVhbz+Qsi2Nc3m8S8ebRFkiyILf2uvD9k1b8RYdEESQg1VjmWAMCdFEAeqNka7W5pQ==", "cpu": [ "x64", "arm64" @@ -929,9 +929,9 @@ } }, "node_modules/@clevercanyon/split-cmd.fork": { - "version": "1.0.56", - "resolved": "https://registry.npmjs.org/@clevercanyon/split-cmd.fork/-/split-cmd.fork-1.0.56.tgz", - "integrity": "sha512-ZKhIpR/jQq4FrGAcU5bCu5GfrmDsau4trVjLQUEZ9rNPpwkksl8clW9yGrsZ/jrX5EzQQu3Yb3z8R3i8dYrEGA==", + "version": "1.0.57", + "resolved": "https://registry.npmjs.org/@clevercanyon/split-cmd.fork/-/split-cmd.fork-1.0.57.tgz", + "integrity": "sha512-N54dny0kOCBZ5MbJ4aSyxhx5Qv2Ek0/VFCq4CtCCZZ6Jj9/5CkoUSWoagI/jvKeueNePmZIJ6f9QUgUPok73qA==", "cpu": [ "x64", "arm64" @@ -951,9 +951,9 @@ } }, "node_modules/@clevercanyon/utilities": { - "version": "1.0.265", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.265.tgz", - "integrity": "sha512-j65SsPdJ3pZVsr6D/ix/fs5MIIy6Y+7WgfMtXbAwYGzP0JOts5XZAjTJ+oRA26kRMCRlZIYES8xlHkIhIJe6Ew==", + "version": "1.0.266", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities/-/utilities-1.0.266.tgz", + "integrity": "sha512-RPATjhaFjttgLlMYvx8D2e6D4S7DTzZj3xl12vLgrX59AMGmKb59+NStu4udW/OR3+89Z5tssIqXmgDyZhPCKA==", "cpu": [ "x64", "arm64" @@ -970,11 +970,11 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/preact-iso.fork": "^2.3.61", + "@clevercanyon/preact-iso.fork": "^2.3.62", "fast-equals": "^4.0.3", "ignore": "^5.2.4", "luxon": "^3.4.3", - "micromatch": "npm:@clevercanyon/micromatch.fork@^4.0.58", + "micromatch": "npm:@clevercanyon/micromatch.fork@^4.0.59", "moize": "^6.1.6", "preact": "^10.17.1", "preact-render-to-string": "^6.2.1", @@ -984,9 +984,9 @@ } }, "node_modules/@clevercanyon/utilities.cfp": { - "version": "1.0.93", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.93.tgz", - "integrity": "sha512-ZOXk09Yq7HW1WDhXVbsbRwag7v7xCxPCgaXCZlvriEQdbua+rnTazrtQl9aQRYVQ2gi+3YPv55evoZ32riwN1w==", + "version": "1.0.94", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfp/-/utilities.cfp-1.0.94.tgz", + "integrity": "sha512-SSQz5ad4jvNzyVXgkhB247dmd0A1lWTwQ8/xFwh1Ii8JeKTa4RcNaC73hfi8XkqdACRSpZR/Qv06TGgpv88g6A==", "cpu": [ "x64", "arm64" @@ -1004,15 +1004,15 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.265", - "@clevercanyon/utilities.cfw": "^1.0.102", - "@clevercanyon/utilities.web": "^1.0.72" + "@clevercanyon/utilities": "^1.0.266", + "@clevercanyon/utilities.cfw": "^1.0.103", + "@clevercanyon/utilities.web": "^1.0.73" } }, "node_modules/@clevercanyon/utilities.cfw": { - "version": "1.0.102", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.102.tgz", - "integrity": "sha512-aAd3X8iczvIIyfPsWth7E2lN73Gq5oSpEY2ChJj8NzZZzykeZ1/eH3eqA88hFWyxFv9OndJMMtWmDLAF8gr5cw==", + "version": "1.0.103", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.cfw/-/utilities.cfw-1.0.103.tgz", + "integrity": "sha512-ymEet3Gzpwzzav/sMA1GNUDOQU8KVBoQ6y2OswccAlRExVpz8rH+r5jP0lOJPcprRokCMHVUamWKQ1xiRWmbew==", "cpu": [ "x64", "arm64" @@ -1031,14 +1031,14 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.265", + "@clevercanyon/utilities": "^1.0.266", "@cloudflare/kv-asset-handler": "^0.2.0" } }, "node_modules/@clevercanyon/utilities.node": { - "version": "1.0.105", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.node/-/utilities.node-1.0.105.tgz", - "integrity": "sha512-hchak1AgQ00zRq4kFRcbQZ67nQNN4p69Gj5KbyRLqRkCYJwrgEFXO4bT3ULgMs/c9+jeZj7ntCbPycz18IHkPw==", + "version": "1.0.106", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.node/-/utilities.node-1.0.106.tgz", + "integrity": "sha512-uQ/HwQe9uY1GA/X1U53OHDUM10QgtddvqkPEWVcBPzLat0iuYmuKQ/NZ9rncf4kZp1svGHbQgL9WL1+RzKfWDA==", "cpu": [ "x64", "arm64" @@ -1056,8 +1056,8 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/split-cmd.fork": "^1.0.56", - "@clevercanyon/utilities": "^1.0.265", + "@clevercanyon/split-cmd.fork": "^1.0.57", + "@clevercanyon/utilities": "^1.0.266", "archiver": "^5.3.2", "boxen": "^7.1.1", "chalk": "^5.3.0", @@ -1067,16 +1067,16 @@ "globby": "^13.2.2", "prettier": "^3.0.3", "shescape": "^2.0.0", - "spawn-please": "npm:@clevercanyon/spawn-please.fork@^2.0.50", + "spawn-please": "npm:@clevercanyon/spawn-please.fork@^2.0.51", "term-img": "^6.0.0", "yargs": "^17.7.2", "yargs-parser": "^21.1.1" } }, "node_modules/@clevercanyon/utilities.web": { - "version": "1.0.73", - "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.web/-/utilities.web-1.0.73.tgz", - "integrity": "sha512-fHN4iVKNgfJz+E0jz3PuMpwNVv1XnpfOL/N01Qz2RD+ul0rnkCGJ/+Wv0RTxrFQFjax6y7UGayULjt0JVGNfOQ==", + "version": "1.0.74", + "resolved": "https://registry.npmjs.org/@clevercanyon/utilities.web/-/utilities.web-1.0.74.tgz", + "integrity": "sha512-J1GTv0K1J9lGUEM4IuQB/NJi8y/6F2ZMLMQbHMnhIqVNvIbCAcWTJkZShGTRuA55W6YtxVU/D4JwRaeIZpmykA==", "cpu": [ "x64", "arm64" @@ -1095,7 +1095,7 @@ "url": "https://github.com/sponsors/clevercanyon" }, "peerDependencies": { - "@clevercanyon/utilities": "^1.0.265" + "@clevercanyon/utilities": "^1.0.266" } }, "node_modules/@cloudflare/kv-asset-handler": { @@ -7479,9 +7479,9 @@ }, "node_modules/braces": { "name": "@clevercanyon/braces.fork", - "version": "3.0.54", - "resolved": "https://registry.npmjs.org/@clevercanyon/braces.fork/-/braces.fork-3.0.54.tgz", - "integrity": "sha512-oILDxhhW5CIeJmrD7veTNfmQxONqSvYMjrNMlWk8vlh2fh0p6A/OYfPU0UV2nBkjCKPdeoCOC7sXSgT9sov6lQ==", + "version": "3.0.55", + "resolved": "https://registry.npmjs.org/@clevercanyon/braces.fork/-/braces.fork-3.0.55.tgz", + "integrity": "sha512-/I/KlVX9/mS5+p9SVLyFY8BrmmJ6Kycp9Ssz+JUL1u+RU/zw+8kShRmZBL2rSgas+uIe8lJ3q6np0PrqaeXYaA==", "cpu": [ "x64", "arm64" @@ -7491,7 +7491,7 @@ "linux" ], "dependencies": { - "fill-range": "npm:@clevercanyon/fill-range.fork@^7.0.53" + "fill-range": "npm:@clevercanyon/fill-range.fork@^7.0.54" }, "engines": { "node": "^19.1.0 || ^20.5.1", @@ -11928,9 +11928,9 @@ }, "node_modules/fill-range": { "name": "@clevercanyon/fill-range.fork", - "version": "7.0.53", - "resolved": "https://registry.npmjs.org/@clevercanyon/fill-range.fork/-/fill-range.fork-7.0.53.tgz", - "integrity": "sha512-HD7kPVsNZlcO0Bf53+8c0+PYi5wpKBxJE19U9Be5ka2BI0Za9hA8FpF1U1/XLGhFVSdemSMU3MKjDMnmz9MNiQ==", + "version": "7.0.54", + "resolved": "https://registry.npmjs.org/@clevercanyon/fill-range.fork/-/fill-range.fork-7.0.54.tgz", + "integrity": "sha512-bpmy066CJGTY/ewFEirt2tTwYlVXiqGI3cgJRBi3d5msXZkq3t1pLiFstqaIgf9U89wuY5C8NDPNF5GwIg1qQg==", "cpu": [ "x64", "arm64" @@ -11940,7 +11940,7 @@ "linux" ], "dependencies": { - "to-regex-range": "npm:@clevercanyon/to-regex-range.fork@^5.0.53" + "to-regex-range": "npm:@clevercanyon/to-regex-range.fork@^5.0.54" }, "engines": { "node": "^19.1.0 || ^20.5.1", @@ -14051,9 +14051,9 @@ }, "node_modules/is-number": { "name": "@clevercanyon/is-number.fork", - "version": "7.0.56", - "resolved": "https://registry.npmjs.org/@clevercanyon/is-number.fork/-/is-number.fork-7.0.56.tgz", - "integrity": "sha512-Zn8mOq0VnAsU9AEo49s3H07h5PiFvTkpaH15Zm6uSGFacbLPXRV7jLNhxQ2mHjUysXYhCjWyHLGOggNfsvNFqg==", + "version": "7.0.57", + "resolved": "https://registry.npmjs.org/@clevercanyon/is-number.fork/-/is-number.fork-7.0.57.tgz", + "integrity": "sha512-Qe5P9X8+pSJehYUiN5++Odiu+v73FiUA7ds1Mc0iiE75D3S1ww9NIkIJdDWuN5sebt/veiR/e/I69Xt1ygt8Eg==", "cpu": [ "x64", "arm64" @@ -18752,9 +18752,9 @@ }, "node_modules/micromatch": { "name": "@clevercanyon/micromatch.fork", - "version": "4.0.58", - "resolved": "https://registry.npmjs.org/@clevercanyon/micromatch.fork/-/micromatch.fork-4.0.58.tgz", - "integrity": "sha512-4xp/G45Ml1cSweDGGtlC5BdNGr1nHiseeheb1HRdtqgyQuxz+fwjJ4cEdixa91Tvl1xOdpwdQ/rt2CSlmCl1SQ==", + "version": "4.0.59", + "resolved": "https://registry.npmjs.org/@clevercanyon/micromatch.fork/-/micromatch.fork-4.0.59.tgz", + "integrity": "sha512-3R4FxhlHeHz43YatAjlnMrjgOwGDvNrI3DWhGLJmbDnyiMMUge7190i8S7JmYMGfsTRh+93b509OaXKOs49cDQ==", "cpu": [ "x64", "arm64" @@ -18764,8 +18764,8 @@ "linux" ], "dependencies": { - "braces": "npm:@clevercanyon/braces.fork@^3.0.54", - "picomatch": "npm:@clevercanyon/picomatch.fork@^2.3.53" + "braces": "npm:@clevercanyon/braces.fork@^3.0.55", + "picomatch": "npm:@clevercanyon/picomatch.fork@^2.3.54" }, "engines": { "node": "^19.1.0 || ^20.5.1", @@ -18777,9 +18777,9 @@ }, "node_modules/micromatch/node_modules/picomatch": { "name": "@clevercanyon/picomatch.fork", - "version": "2.3.53", - "resolved": "https://registry.npmjs.org/@clevercanyon/picomatch.fork/-/picomatch.fork-2.3.53.tgz", - "integrity": "sha512-lj9otV6PZrwtk/amStPVYJ/fS7wjaoDlF27AfS3SmHhTdiNFyM9rgRhQaHUR4nxd4z+h7QE0/FVfTjguEIq2Pg==", + "version": "2.3.54", + "resolved": "https://registry.npmjs.org/@clevercanyon/picomatch.fork/-/picomatch.fork-2.3.54.tgz", + "integrity": "sha512-ftHWRH64ppwZBILNdtnaBp6uzQPICvX9k1u0Q0B+dCUOhkAYgZukGuqlTwEgbNNwWodFrx4hc+NpQjqMiXGjlQ==", "cpu": [ "x64", "arm64" @@ -24428,9 +24428,9 @@ }, "node_modules/spawn-please": { "name": "@clevercanyon/spawn-please.fork", - "version": "2.0.50", - "resolved": "https://registry.npmjs.org/@clevercanyon/spawn-please.fork/-/spawn-please.fork-2.0.50.tgz", - "integrity": "sha512-sUtOAwzW4cHtAD47H1o8B80sDOmyNg5O1srsBKOPwZuObJOJpsAhx/iq67L2rfdPt8DUs5NoKarJZXuc7FVRKg==", + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/@clevercanyon/spawn-please.fork/-/spawn-please.fork-2.0.51.tgz", + "integrity": "sha512-FEdfjY5HTCFGhGlcm/0S7mKkJfCIx9a91/Hr7PiwYD5pgcE8yMKi3YP3dmdbutWPzAb5VPcS7Ish3KOMA4Albw==", "cpu": [ "x64", "arm64" @@ -25739,9 +25739,9 @@ }, "node_modules/to-regex-range": { "name": "@clevercanyon/to-regex-range.fork", - "version": "5.0.53", - "resolved": "https://registry.npmjs.org/@clevercanyon/to-regex-range.fork/-/to-regex-range.fork-5.0.53.tgz", - "integrity": "sha512-jm2Z4BqXtikBOG+LanD4dGLRVfx2E+nIn9iSLl58D1Z+MxMS8/eE2nNAnyELhPdj6SlMDa6sT5A8pC2ooZ0vsA==", + "version": "5.0.54", + "resolved": "https://registry.npmjs.org/@clevercanyon/to-regex-range.fork/-/to-regex-range.fork-5.0.54.tgz", + "integrity": "sha512-5Sb2guS0J8Yybe2HVaDVAYJZSmfzCpVDSgYMshiFKrx9aGCOIlrebaqCH/VYkA7RXFeZYKVptBdNQtxCrG4G5A==", "cpu": [ "x64", "arm64" @@ -25751,7 +25751,7 @@ "linux" ], "dependencies": { - "is-number": "npm:@clevercanyon/is-number.fork@^7.0.56" + "is-number": "npm:@clevercanyon/is-number.fork@^7.0.57" }, "engines": { "node": "^19.1.0 || ^20.5.1", diff --git a/package.json b/package.json index 16c079a..969653e 100644 --- a/package.json +++ b/package.json @@ -22,14 +22,14 @@ "imports": {}, "exports": { ".": { + "types": "./dist/types/index.d.ts", "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/types/index.d.ts" + "default": "./dist/index.js" } }, "sideEffects": ["./src/resources/init-env.ts", "./src/index.ts"], "module": "./dist/index.js", - "main": "./dist/index.cjs", + "main": "./dist/index.js", "browser": "", "unpkg": "./dist/index.js", "types": "./dist/types/index.d.ts", @@ -39,14 +39,14 @@ } }, "dependencies": { - "@clevercanyon/utilities": "^1.0.265" + "@clevercanyon/utilities": "^1.0.266" }, "peerDependencies": {}, "peerDependenciesMeta": {}, "optionalDependencies": {}, "bundleDependencies": [], "devDependencies": { - "@clevercanyon/dev-deps": "^1.0.229" + "@clevercanyon/dev-deps": "^1.0.230" }, "overrides": {}, "cpu": ["x64", "arm64"], diff --git a/tsconfig.json b/tsconfig.json index 1ecb65e..effa69b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ * @note This entire file will be updated automatically. * @note Instead of editing here, please review `./tsconfig.mjs`. * - * Last generated using `./tsconfig.mjs` Thu, Sep 21, 2023, 4:13:35 AM EDT. + * Last generated using `./tsconfig.mjs` Thu, Sep 21, 2023, 6:16:45 AM EDT. */ { "include": ["./*.d.ts", "./src/**/*"], diff --git a/wrangler.toml b/wrangler.toml index dfff034..18257c0 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -7,48 +7,40 @@ # @note This entire file will be updated automatically. # @note Instead of editing here, please review `./wrangler.mjs`. # -# Last generated using `./wrangler.mjs` Thu, Sep 21, 2023, 4:13:35 AM EDT. +# Last generated using `./wrangler.mjs` Thu, Sep 21, 2023, 6:16:46 AM EDT. ## compatibility_date = "2023-08-15" send_metrics = false usage_model = "bundled" -account_id = "f1176464a976947aa5665d989814a4b1" name = "github" +account_id = "f1176464a976947aa5665d989814a4b1" workers_dev = false main = "./dist/index.js" [[rules]] -type = "Data" -globs = [ "**/*.bin" ] +type = "Text" +globs = [ ] fallthrough = false [[rules]] -type = "CompiledWasm" -globs = [ "**/*.wasm" ] +type = "ESModule" +globs = [ "**/*.js", "**/*.mjs", "**/*.jsx", "**/*.mjsx" ] fallthrough = false [[rules]] -type = "ESModule" -globs = [ "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.mjsx" ] +type = "CommonJS" +globs = [ "**/*.cjs", "**/*.cjsx" ] fallthrough = false [[rules]] -type = "CommonJS" -globs = [ "**/*.cjs", "**/*.cjsx", "**/*.node" ] +type = "CompiledWasm" +globs = [ "**/*.wasm" ] fallthrough = false [[rules]] -type = "Text" -globs = [ - "**/*.md", - "**/*.txt", - "**/*.xml", - "**/*.html", - "**/*.shtml", - "**/*.ejs", - "**/*.json" -] +type = "Data" +globs = [ ] fallthrough = false [build] @@ -56,12 +48,6 @@ cwd = "./" watch_dir = "./src" command = "npx @clevercanyon/madrun build --mode=prod" -[env.dev] -workers_dev = false - - [env.dev.build] - command = "npx @clevercanyon/madrun build --mode=dev" - [site] bucket = "./dist/assets" exclude = [ @@ -181,3 +167,9 @@ exclude = [ [route] zone_name = "hop.gdn" pattern = "workers.hop.gdn/github/*" + +[env.dev] +workers_dev = false + + [env.dev.build] + command = "npx @clevercanyon/madrun build --mode=dev"