Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Apr 7, 2024
1 parent 5578c3b commit 50b2678
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

[production]
node >= 20.9.0
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

# Locals

Expand Down
8 changes: 4 additions & 4 deletions .env.vault
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ DOTENV_VAULT_MAIN="7GW98NfL4hM4N6HbfeDXCKreVxKvcVPupFRnZ8XJ+pomaQ=="
DOTENV_VAULT_MAIN_VERSION=1

# dev
DOTENV_VAULT_DEV="Y/L11rsO3zAbotHmfKtva2KinPgM64OGVzehwIEcswerS04VdBYnhUaRZhbXsJTA5YJEjO6xjs3alvTv3JxAGZJSJi2elsJv/ZJWCma3DhWYeyIyK/Pu/OmiebtP1GmPqt2yIIKU2E4USMQ6UmJRihX0HqX9E7kC9zYljjxekVm0bdItKxaXuZpm7YYLqHSGj99oEBW7IwYV3tzPuCZ73ZOeLEsQGAmzVo6reO4Ix2Dtq/W7sqnvcS5t9vjOGVzE8w=="
DOTENV_VAULT_DEV_VERSION=513
DOTENV_VAULT_DEV="ReaTeGv9IHvPUjXpcl2EzdBtuHHm/aPRiYxx9dMGyXAuuOR3gcSFUkQG2zN+4+cKR4ujEAg3VDy8rYS8OC7zHmABphk9ww8AKLud6ZYLacWc1u1P/aGRaJRgAm3EjVuN87n20i9W1umFUog+G2+qjOS8J/MBJ/K1u7g2BE4OwYq2hb6BDouDDKRuAGjNeCY6+CXcaBMezNImePBO3+QVq41+TiP95w/wghbrOwJH4CVBB84E7OyjCccFMQorHURl4A=="
DOTENV_VAULT_DEV_VERSION=515

# ci
DOTENV_VAULT_CI="qdMWs349qTSddS+p2FLP2L3cuCG5Ux7J3tHNBzQZJgf5tcbUUSXFpoJFykC+rMygXmDCEmonk9eP0eYjiOSZgSG37l9z5uwR5UP/07rfnXBK75GJrP9ffOElZ1/FNla1Z/bVIutBaiPcPOlBIx1pR11d7e6LItJUv6+x3XuZhg=="
DOTENV_VAULT_CI_VERSION=513
DOTENV_VAULT_CI="ui7ySDxcLXsDSRdwWOQQ4IXgoVMhd6+Brx8lPQHjNDZmPkDrBe3jYXIR7lVlv1if6aK1HkVnROjO6X0MU0Z1HFSad6Dxqqk341e/QtUTrePrYXHGCH7JTYmH6CaI0IcZeCQniwyso+lNvrhibYdHj3SvkH6MuiL+F0Hhq+0siw=="
DOTENV_VAULT_CI_VERSION=515

# stage
DOTENV_VAULT_STAGE="aRP8su2YV4jZu3w1HZ/SLaots0IwJDFw75TCpvXEFeNp7tw="
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

# Default

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

# Packages

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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` Apr 5, 2024 10:26 PM UTC.
* Last generated using `./settings.mjs` Apr 7, 2024 12:20 AM UTC.
*/
{
"editor.formatOnType": false,
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Apr 5, 2024 10:26 PM UTC.
# Last generated Apr 7, 2024 12:20 AM UTC.

# Locals

Expand Down
2 changes: 2 additions & 0 deletions dev/.files/vite/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import importAliases from '../bin/includes/import-aliases.mjs';
import u from '../bin/includes/utilities.mjs';
import viteA16sDir from './includes/a16s/dir.mjs';
import viteC10nBrandConfig from './includes/c10n/brand-config.mjs';
import viteC10nCloudflareSockets from './includes/c10n/cloudflare-sockets.mjs';
import viteC10nHTMLTransformsConfig from './includes/c10n/html-transforms.mjs';
import viteC10nNoModulePreloadConfig from './includes/c10n/no-module-preload.mjs';
import viteC10nPostProcessingConfig from './includes/c10n/post-processing.mjs';
Expand Down Expand Up @@ -210,6 +211,7 @@ export default async ({ mode, command, isSsrBuild: isSSRBuild }) => {

await viteIconsConfig({}),
await viteC10nBrandConfig({ mode, appBaseURL }),
await viteC10nCloudflareSockets({ mode, command }),
//
await viteMDXConfig({ projDir }),
await viteEJSConfig({ mode, projDir, srcDir, pkg, env }),
Expand Down
36 changes: 36 additions & 0 deletions dev/.files/vite/includes/c10n/cloudflare-sockets.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* C10n Cloudflare sockets plugin.
*
* Vite is not aware of this config file's location.
*
* @note PLEASE DO NOT EDIT THIS FILE!
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review <https://github.com/clevercanyon/skeleton>.
*/

/**
* Configures Cloudflare sockets plugin for Vite.
*
* @param props Props from vite config file driver.
*
* @returns Plugin configuration.
*/
export default async ({ mode, command }) => {
const virtualId = 'cloudflare:sockets';
const resolvedVirtualId = '\0' + virtualId;

return {
name: 'vite-plugin-c10n-cloudflare-sockets',

resolveId(id) {
if ('dev' === mode && 'serve' === command && id === virtualId) {
return '\0' + id;
}
},
async load(id) {
if ('dev' === mode && 'serve' === command && id === resolvedVirtualId) {
return 'export default {};';
}
},
};
};
86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.0.943",
"version": "1.0.944",
"license": "GPL-3.0-or-later",
"name": "@clevercanyon/utilities",
"description": "Utilities for JavaScript apps running in any environment.",
Expand Down
9 changes: 4 additions & 5 deletions src/preact/components/http.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@

import '#@initialize.ts';

import { $env, $obj, $preact } from '#index.ts';
import { $env, $http, $obj, $preact } from '#index.ts';
import { createContext } from 'preact';

/**
* Defines types.
*/
export type State = $preact.State<{
status: number;
}>;
export type State = $preact.State<$http.ResponseConfig>;
export type PartialState = Partial<State>;
export type PartialStateUpdates = PartialState;

export type Props = $preact.BasicTreeProps<{
httpState?: PartialState;
}>;
Expand Down Expand Up @@ -68,7 +67,7 @@ const reduceState = (state: State, updates: PartialStateUpdates): State => {
*/
export default function HTTP(props: Props): $preact.VNode<Props> {
const [state, updateState] = $preact.useReducer(reduceState, undefined, (): State => {
return $obj.patchDeep(props.httpState || {}, { status: 200 }) as unknown as State;
return props.httpState || ({} as State);
});
return <ContextObject.Provider value={{ state, updateState }}>{props.children}</ContextObject.Provider>;
}
Expand Down
4 changes: 2 additions & 2 deletions src/resources/preact/apis/iso.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export const prerenderSPA = async (options: PrerenderSPAOptions): PrerenderSPAPr

let html = prerenderedData.html; // Prerendered HTML markup.

if (!html /* 404 error when render is empty. */) {
$obj.patchDeep(httpState, { status: 404 }); // Patches HTTP state.
if (!html && !Object.hasOwn(httpState, 'body')) {
$obj.patchDeep(httpState, { status: 404 }); // 404 error when render is empty.
const StandAlone404 = (await import('#preact/components/404.tsx')).StandAlone;
html = $preact.ssr.renderToString(<StandAlone404 class='preact-iso-404' />);
}
Expand Down
Loading

0 comments on commit 50b2678

Please sign in to comment.