feat: Phase 1 — extract the client (web SPA + desktop) to dtoro/oikos-web
Problem: the hexagonal refactor churns the backend tree for nine more phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper, compose/web image) must move to its own repo first so doc/layout rewrites land once on a backend-only tree. Change: - New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/ (updateURL repointed to oikos-web releases), compose/, own CI (web + desktop jobs), own deploy script (CI-green gate, TOCTOU guard, version-tagged images, prune-to-3), own webhook receiver on :9798 + launchd unit, own compose project publishing the same 8091:80. - Cutover executed on mac-mini in order: oikos stack's web service stopped+removed, oikos-web project brought up on 8091; outer Caddy untouched (targets the published port) — serving + Authentik flow + /wails 404 quirk verified post-cutover. - Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install targets, the compose web service, oikos-web from deploy.sh's fallback prune list; wails + go-keyring dropped from go.mod, vendor synced. - README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now point at the new repo; mbse + mascot design docs carry a path note. Risk: production SPA serving depends on the new pipeline now; rollback is versioned-image re-up of the old web service from a pre-split checkout (port 8091). Desktop builds installed before the split still check dtoro/oikos releases — one manual reinstall, noted in the oikos-web release notes. Verification: go vet, make test (race), make generate-check, golangci (no new findings; baseline down 400→365); post-cutover curls — localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
This commit is contained in:
7
web/node_modules/@sveltejs/load-config/LICENSE
generated
vendored
Normal file
7
web/node_modules/@sveltejs/load-config/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2020-Present [these people](https://github.com/sveltejs/language-tools/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
37
web/node_modules/@sveltejs/load-config/dist/src/index.d.ts
generated
vendored
Normal file
37
web/node_modules/@sveltejs/load-config/dist/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
type ConfigSource = 'svelte' | 'vite';
|
||||
interface SvelteConfig {
|
||||
compilerOptions?: Record<string, unknown>;
|
||||
preprocess?: unknown;
|
||||
extensions?: string[];
|
||||
kit?: unknown;
|
||||
vitePlugin?: unknown;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
interface LoadedConfig {
|
||||
config: SvelteConfig;
|
||||
configFilePath: string;
|
||||
configSource: ConfigSource;
|
||||
}
|
||||
interface FailedConfig {
|
||||
error: unknown;
|
||||
configFilePath: string;
|
||||
configSource: ConfigSource;
|
||||
}
|
||||
type LoadConfigResult = LoadedConfig | FailedConfig | undefined;
|
||||
/**
|
||||
* Loads the Svelte configuration by searching for `vite.config` and `svelte.config` files.
|
||||
*
|
||||
* If `dirOrFile` is a file path, that config file is loaded directly.
|
||||
*
|
||||
* If `dirOrFile` is a directory and `traverse` is true, it starts from the provided directory and traverses up the directory tree until it finds a config or reaches the root.
|
||||
* Else it only checks the provided directory.
|
||||
*
|
||||
* `vite.config` with either vite-plugin-svelte or the SvelteKit plugin providing options is preferred over `svelte.config`.
|
||||
*
|
||||
* The results are cached to optimize subsequent calls.
|
||||
*/
|
||||
export declare function loadConfig(dirOrFile: string, { traverse, clearCache }?: {
|
||||
traverse?: boolean;
|
||||
clearCache?: boolean;
|
||||
}): Promise<LoadConfigResult>;
|
||||
export {};
|
||||
256
web/node_modules/@sveltejs/load-config/dist/src/index.js
generated
vendored
Normal file
256
web/node_modules/@sveltejs/load-config/dist/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.loadConfig = loadConfig;
|
||||
const node_fs_1 = __importDefault(require("node:fs"));
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const node_url_1 = require("node:url");
|
||||
const VITE_CONFIG_EXTENSIONS = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];
|
||||
const SVELTE_CONFIG_EXTENSIONS = ['js', 'cjs', 'mjs'];
|
||||
const SVELTE_CONFIG_TS_EXTENSIONS = ['ts', 'mts'];
|
||||
const cache = new Map();
|
||||
/**
|
||||
* This function encapsulates the import call in a way
|
||||
* that TypeScript does not transpile `import()`.
|
||||
* https://github.com/microsoft/TypeScript/issues/43329
|
||||
*/
|
||||
const dynamicImport = new Function('modulePath', 'return import(modulePath)');
|
||||
/**
|
||||
* Loads the Svelte configuration by searching for `vite.config` and `svelte.config` files.
|
||||
*
|
||||
* If `dirOrFile` is a file path, that config file is loaded directly.
|
||||
*
|
||||
* If `dirOrFile` is a directory and `traverse` is true, it starts from the provided directory and traverses up the directory tree until it finds a config or reaches the root.
|
||||
* Else it only checks the provided directory.
|
||||
*
|
||||
* `vite.config` with either vite-plugin-svelte or the SvelteKit plugin providing options is preferred over `svelte.config`.
|
||||
*
|
||||
* The results are cached to optimize subsequent calls.
|
||||
*/
|
||||
function loadConfig(dirOrFile, { traverse = true, clearCache = false } = {}) {
|
||||
if (clearCache)
|
||||
cache.clear();
|
||||
const resolved = node_path_1.default.resolve(dirOrFile);
|
||||
const cached = cache.get(resolved);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const loading = isFile(resolved)
|
||||
? loadConfigFromFile(resolved)
|
||||
: loadConfigUncached(resolved, traverse);
|
||||
cache.set(resolved, loading);
|
||||
return loading;
|
||||
}
|
||||
function isFile(filePath) {
|
||||
try {
|
||||
return node_fs_1.default.statSync(filePath).isFile();
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function loadConfigFromFile(configFilePath) {
|
||||
const basename = node_path_1.default.basename(configFilePath);
|
||||
const root = node_path_1.default.dirname(configFilePath);
|
||||
if (/^svelte\.config\./.test(basename)) {
|
||||
return (await loadSvelteConfig(configFilePath)) ?? undefined;
|
||||
}
|
||||
const viteResult = await loadSvelteConfigFromVite(root, configFilePath);
|
||||
if (viteResult !== undefined) {
|
||||
return viteResult;
|
||||
}
|
||||
return loadSvelteConfig(configFilePath);
|
||||
}
|
||||
async function loadConfigUncached(dir, traverse) {
|
||||
let currentDir = dir;
|
||||
const dirs = [dir];
|
||||
while (true) {
|
||||
const result = await loadConfigFromDirectory(currentDir);
|
||||
if (result) {
|
||||
if (isLoadedConfig(result)) {
|
||||
// Cache the loaded config for all traversed directories
|
||||
for (const d of dirs) {
|
||||
cache.set(d, Promise.resolve(result));
|
||||
}
|
||||
}
|
||||
else {
|
||||
cache.delete(dir);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
if (!traverse) {
|
||||
return undefined;
|
||||
}
|
||||
const parentDir = node_path_1.default.dirname(currentDir);
|
||||
if (parentDir === currentDir) {
|
||||
return undefined;
|
||||
}
|
||||
currentDir = parentDir;
|
||||
dirs.push(currentDir);
|
||||
}
|
||||
}
|
||||
async function loadConfigFromDirectory(dir) {
|
||||
const viteConfigPath = findConfigInDirectory(dir, 'vite.config', VITE_CONFIG_EXTENSIONS);
|
||||
let viteError;
|
||||
if (viteConfigPath) {
|
||||
const result = await loadSvelteConfigFromVite(dir, viteConfigPath);
|
||||
if (isLoadedConfig(result)) {
|
||||
return result;
|
||||
}
|
||||
if (result?.error) {
|
||||
viteError = result;
|
||||
}
|
||||
}
|
||||
const svelteConfigPath = findConfigInDirectory(dir, 'svelte.config', getSvelteConfigExtensions());
|
||||
if (!svelteConfigPath) {
|
||||
return viteError;
|
||||
}
|
||||
return (await loadSvelteConfig(svelteConfigPath)) ?? viteError;
|
||||
}
|
||||
let resolving = null;
|
||||
async function loadSvelteConfigFromVite(root, configFilePath) {
|
||||
const vite = await tryImportVite(root);
|
||||
if (!vite) {
|
||||
return undefined;
|
||||
}
|
||||
// Make sure that only one Vite config is resolved at a time, to prevent race conditions with multiple
|
||||
// calls to `loadConfig` ending up with changing the process' current working directory mid-resolution.
|
||||
const previous = resolving;
|
||||
let resolve;
|
||||
resolving = new Promise((r) => (resolve = r));
|
||||
await previous;
|
||||
const cwd = process.cwd();
|
||||
try {
|
||||
process.chdir(root);
|
||||
const resolved = await vite.resolveConfig({ root, configFile: configFilePath, logLevel: 'error' }, 'serve');
|
||||
const kitPlugin = resolved.plugins.find((plugin) => plugin.name === 'vite-plugin-sveltekit-setup');
|
||||
const kitOptions = kitPlugin?.api?.options;
|
||||
if (kitOptions) {
|
||||
const { preprocess, compilerOptions, extensions, vitePlugin, ...kit } = kitOptions;
|
||||
return {
|
||||
config: { preprocess, compilerOptions, extensions, vitePlugin, kit },
|
||||
configFilePath,
|
||||
configSource: 'vite'
|
||||
};
|
||||
}
|
||||
const sveltePlugin = resolved.plugins.find((plugin) => plugin.name === 'vite-plugin-svelte:config');
|
||||
const options = sveltePlugin?.api?.options;
|
||||
if (options) {
|
||||
return {
|
||||
config: options,
|
||||
configFilePath,
|
||||
configSource: 'vite'
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
return {
|
||||
error,
|
||||
configFilePath,
|
||||
configSource: 'vite'
|
||||
};
|
||||
}
|
||||
finally {
|
||||
process.chdir(cwd);
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
async function loadSvelteConfig(configFilePath) {
|
||||
try {
|
||||
const config = (await dynamicImport((0, node_url_1.pathToFileURL)(configFilePath).href))?.default;
|
||||
if (!config) {
|
||||
throw new Error('Missing exports in the config. Make sure to include "export default config" or "module.exports = config"');
|
||||
}
|
||||
return {
|
||||
config,
|
||||
configFilePath,
|
||||
configSource: 'svelte'
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
return {
|
||||
error,
|
||||
configFilePath,
|
||||
configSource: 'svelte'
|
||||
};
|
||||
}
|
||||
}
|
||||
async function tryImportVite(fromPath) {
|
||||
try {
|
||||
const importPath = getViteImportPath(fromPath);
|
||||
if (importPath) {
|
||||
return await dynamicImport((0, node_url_1.pathToFileURL)(importPath).href);
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// fall through to legacy import
|
||||
}
|
||||
return importViteLegacy(fromPath);
|
||||
}
|
||||
function getViteImportPath(fromPath) {
|
||||
const pkgPath = require.resolve('vite/package.json', { paths: [fromPath] });
|
||||
const pkgDir = node_path_1.default.dirname(pkgPath);
|
||||
const pkg = JSON.parse(node_fs_1.default.readFileSync(pkgPath, 'utf8'));
|
||||
const entry = resolvePackageImportExport(pkg.exports?.['.']);
|
||||
if (entry) {
|
||||
return node_path_1.default.join(pkgDir, entry);
|
||||
}
|
||||
const fallback = pkg.module ?? pkg.main;
|
||||
return fallback ? node_path_1.default.join(pkgDir, fallback) : undefined;
|
||||
}
|
||||
function resolvePackageImportExport(exportEntry) {
|
||||
if (typeof exportEntry === 'string') {
|
||||
return exportEntry;
|
||||
}
|
||||
if (!exportEntry || typeof exportEntry !== 'object') {
|
||||
return undefined;
|
||||
}
|
||||
const entry = exportEntry;
|
||||
const importEntry = entry.import;
|
||||
if (typeof importEntry === 'string') {
|
||||
return importEntry;
|
||||
}
|
||||
if (importEntry && typeof importEntry === 'object') {
|
||||
const defaultEntry = importEntry.default;
|
||||
if (typeof defaultEntry === 'string') {
|
||||
return defaultEntry;
|
||||
}
|
||||
}
|
||||
if (typeof entry.default === 'string') {
|
||||
return entry.default;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
async function importViteLegacy(fromPath) {
|
||||
try {
|
||||
const main = require.resolve('vite', { paths: [fromPath] });
|
||||
// require.resolve will use the cjs version
|
||||
const prev = process.env.VITE_CJS_IGNORE_WARNING;
|
||||
process.env.VITE_CJS_IGNORE_WARNING = 'true';
|
||||
const result = await dynamicImport((0, node_url_1.pathToFileURL)(main).href);
|
||||
process.env.VITE_CJS_IGNORE_WARNING = prev;
|
||||
return result;
|
||||
}
|
||||
catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
function findConfigInDirectory(dir, basename, extensions) {
|
||||
for (const extension of extensions) {
|
||||
const configPath = node_path_1.default.join(dir, `${basename}.${extension}`);
|
||||
if (node_fs_1.default.existsSync(configPath)) {
|
||||
return configPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getSvelteConfigExtensions() {
|
||||
return process.features && 'typescript' in process.features && process.features.typescript
|
||||
? [...SVELTE_CONFIG_EXTENSIONS, ...SVELTE_CONFIG_TS_EXTENSIONS]
|
||||
: SVELTE_CONFIG_EXTENSIONS;
|
||||
}
|
||||
function isLoadedConfig(result) {
|
||||
return !!result && 'config' in result;
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
web/node_modules/@sveltejs/load-config/dist/src/index.js.map
generated
vendored
Normal file
1
web/node_modules/@sveltejs/load-config/dist/src/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31
web/node_modules/@sveltejs/load-config/package.json
generated
vendored
Normal file
31
web/node_modules/@sveltejs/load-config/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@sveltejs/load-config",
|
||||
"version": "0.2.1",
|
||||
"description": "Load Svelte config via vite.config or svelte.config",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sveltejs/language-tools.git"
|
||||
},
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/src/index.d.ts",
|
||||
"default": "./dist/src/index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/src"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 18.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.0.0",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user