Skip to content

Commit

Permalink
use node https instead of uwebsockets
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Dec 16, 2024
1 parent 1b70c75 commit 89f3552
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 382 deletions.
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
"socket.io": "^4.8.0",
"svgo": "catalog:",
"typescript": "catalog:",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#semver:^20.49.0",
"validate-npm-package-name": "^5.0.0",
"vite": "catalog:",
"vite-node": "catalog:",
Expand Down
42 changes: 2 additions & 40 deletions packages/core/src/cli/lib/init-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ export async function initDmnoForService(workspaceInfo: ScannedWorkspaceInfo, se
**/.dmno/.icon-cache
# local config overrides
**/.dmno/.env.local
# local ssl certs
**/.dmno/certs
`;
await fs.promises.writeFile(gitIgnorePath, gitIgnore);
console.log(setupStepMessage(`.gitignore ${createdGitIgnore ? 'created' : 'updated'} with dmno files!`, { path: gitIgnorePath }));
Expand Down Expand Up @@ -532,44 +534,4 @@ export async function initDmnoForService(workspaceInfo: ScannedWorkspaceInfo, se
docs: '/guides/typescript',
}));
}

// const tsConfigFiles = await (
// new fdir() // eslint-disable-line new-cap
// .withRelativePaths()
// .glob('./tsconfig.json', './tsconfig.*.json', 'jsconfig.json')
// .withMaxDepth(0)
// .crawl(service.path)
// .withPromise()
// );
// if (!tsConfigFiles.length) {
// console.log(setupStepMessage('Failed to inject dmno types - no tsconfig/jsconfig found', {
// type: 'failure',
// docs: '/guides/typescript',
// }));
// }
// for (const tsConfigFileName of tsConfigFiles) {
// const tsConfigPath = `${service.path}/${tsConfigFileName}`;
// const originalTsConfigContents = (await fs.promises.readFile(tsConfigPath)).toString();
// const updatedTsConfigContents = await injectDmnoTypesIntoTsConfig(originalTsConfigContents);
// if (updatedTsConfigContents) {
// // TODO: maybe want to confirm with the user and show a diff?
// await fs.promises.writeFile(tsConfigPath, updatedTsConfigContents);

// console.log(setupStepMessage(`injected dmno types into ${tsConfigFileName}`, {
// path: tsConfigPath,
// // docs: suggestedDmnoIntegration.docs,
// }));
// } else {
// console.log(setupStepMessage('tsconfig already includes dmno types', {
// type: 'noop',
// path: tsConfigPath,
// // docs: suggestedDmnoIntegration.docs,
// }));
// }
// }


// SECRETS PLUGINS
// TODO
// if (service.isRoot) {}
}
13 changes: 0 additions & 13 deletions packages/core/src/cli/lib/init-process.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
import kleur from 'kleur';

process.on('uncaughtException', (err) => {
if (err.message.includes('Error loading shared library ld-linux-')) {
console.log([
'🚨 💡 🚨 💡 🚨',
'',
kleur.bold('uWebsockets compat issue. If you are running in Docker, try adding this line to your Dockerfile:'),
'',
' RUN ln -s "/lib/libc.musl-$(uname -m).so.1" "/lib/ld-linux-$(uname -m).so.1"',
'',
'🚨 💡 🚨 💡 🚨',
'',
].join('\n'));
}

console.log(kleur.red(`UNCAUGHT EXCEPTION: ${err.message}`));
console.log(kleur.red(`UNCAUGHT EXCEPTION: ${err.stack}`));
// eslint-disable-next-line no-restricted-syntax
Expand Down
Loading

0 comments on commit 89f3552

Please sign in to comment.