Learn cloudflare pages and pnpm which are used in ChatCraft.
Learn Review PR
-
Try to package and ship typescript2openai on npm
What is Cloudflare
Cloudflare is a global network of servers. When you add your application to Cloudflare, we use this network to sit in between requests and your origin server.
- speeding up content delivery and user experience(CDN)
- protecting your website from malicious activity ( DDoSOpen, Web Application Firewall)
- routing traffic (Load balancing, Waiting Room)
Cloudflare pages - similar to Heroku, Vercel
How to deploy your website to the Pages platform
- Connecting your Git provider to Pages.
- Deploying your prebuilt assets right to Pages with Direct Upload.
- Using Wrangler from the command line
- Wrangler is a command-line tool for building with Cloudflare developer products.
- Use Wrangler to deploy projects that use the Workers Browser Rendering API.
Using Cloudflare Pages in ChatCraft
What's PNpM
Fast, disk space efficient package manager
- Fast. Up to 2x faster than the alternatives (see benchmark).
- Efficient. Files inside node_modules are linked from a single content-addressable storage.
- Great for monorepos.
- Strict. A package can access only dependencies that are specified in its package.json.
- Deterministic. Has a lockfile called pnpm-lock.yaml.
- Works as a Node.js version manager. See pnpm env use.
- Works everywhere. Supports Windows, Linux, and macOS.
- Battle-tested. Used in production by teams of all sizes since 2016.
- See the full feature comparison with npm and Yarn.
Motivation
Installation
Using PNpM in ChatCraft
Reivew PR
I am acquainting myself with the review step and delving into the code of ChatCraft to enhance my understanding of its functionalities. I reviewed Removed non-functioning code from README.sops.md and test small cases about Add Latex Rendering with remark-math and Katex Plugins
Package and ship typescript2openai on npm
In order to produce both ESM and CommonJS versions, as well as TypeScript types, I learned and tried unbuild and used complete example in unjs/template package.json
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
then I got all builds:
dist
├── index.cjs
├── index.d.cts
├── index.d.mts
├── index.d.ts
└── index.mjs
after run the test workflow, I got fail to install node, so I changed it to directly install pnpm action-setup, at last it ran successfully, need to be reviewed and merged.
Top comments (0)