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 Feb 15, 2024
1 parent 54249eb commit 20175d2
Show file tree
Hide file tree
Showing 15 changed files with 401 additions and 335 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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 AM UTC.

# Locals

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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 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` Feb 6, 2024 11:36 AM UTC.
* Last generated using `./settings.mjs` Feb 15, 2024 7:34 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 Feb 6, 2024 11:36 AM UTC.
# Last generated Feb 15, 2024 7:34 AM UTC.

# Locals

Expand Down
19 changes: 17 additions & 2 deletions dev-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ declare const $$__APP_BASE_URL_RESOLVED_NTS__$$: string;
*/
declare var __PREFRESH__: object;

/**
* Declares PWA install event, which we implement for SPAs.
*/
declare var pwaInstallEvent: Event & { prompt: () => void };

/**
* Declares virtual brand config file.
*/
Expand All @@ -35,6 +40,14 @@ declare module 'virtual:brand/config' {
export default {} as Partial<$type.BrandRawProps>;
}

/**
* Declares Cloudflare runtime modules.
*/
declare module 'cloudflare:sockets' {
import { $type } from '@clevercanyon/utilities';
export function connect(address: string | $type.cfw.SocketAddress, options?: $type.cfw.SocketOptions): $type.cfw.Socket;
}

/**
* Defines missing `entries()` on FormData.
*/
Expand All @@ -43,9 +56,11 @@ interface FormData {
}

/**
* Declares PWA install event, which we implement for SPAs.
* Defines missing `entries()` on Headers.
*/
declare var pwaInstallEvent: Event & { prompt: () => void };
interface Headers {
entries(): IterableIterator<[key: string, value: string]>;
}

/*
* Customizations.
Expand Down
40 changes: 26 additions & 14 deletions dev/.files/madrun/includes/node.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,32 @@
* @note Instead of editing here, please review <https://github.com/clevercanyon/skeleton>.
*/

/**
* Filters Node warnings.
*/
process.on('warning', (warning) => {
if ('ExperimentalWarning' === warning.name && warning.message) {
if (warning.message.includes('Web Crypto API algorithm is an experimental feature')) {
return false; // Web Crypto is a thing. Ok to suppress.
}
// @todo: Ditch this in favor of https://nodejs.org/api/cli.html#--disable-warningcode-or-type in latest Node.

// We only want to apply the following once.
if (!process.env.C10N_SKELETON_MADRUN_NODE_INCLUDE_DONE) {
// i.e., We are including now, and we only do this once.
process.env.C10N_SKELETON_MADRUN_NODE_INCLUDE_DONE = true;

// Saves original emitter.
const originalEmitter = process.emit;

// Filters Node-emitted warnings.
process.emit = (event, error) => {
if (
warning.message.includes('Import assertions are not a stable feature') || //
warning.message.includes('Importing JSON modules is an experimental feature')
'warning' === event && //
error instanceof Error &&
'ExperimentalWarning' === error.name &&
error.message
) {
return false; // JSON imports are a thing. Ok to suppress.
if (
error.message.includes('Web Crypto API algorithm is an experimental feature') ||
error.message.includes('Import assertions are not a stable feature') || //
error.message.includes('Importing JSON modules is an experimental feature')
) {
return false; // OK to suppress.
}
}
}
console.warn(warning);
});
return originalEmitter.apply(process, [event, error]);
};
}
2 changes: 1 addition & 1 deletion dev/.files/vite/includes/rollup/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async ({ projDir, srcDir, distDir, a16sDir, appType, appEntries,
external: [
...(['lib'].includes(appType) ? [/^(?![./~#]|file:|data:|virtual:).*$/iu] : []),
...peerDepKeys.map((pkgName) => new RegExp('^' + $str.escRegExp(pkgName) + '(?:$|[/?])', 'u')),
...[/^__STATIC_CONTENT_MANIFEST(?:$|[/?])/u], // Cloudflare worker sites use this for static assets.
/^(?:cloudflare:).*$/iu,
],
output: {
interop: 'auto', // Matches TypeScript configuration.
Expand Down
Loading

0 comments on commit 20175d2

Please sign in to comment.