- git clone with submodules. / git pull all submodules. (shorthand:
npm run pull) - cd into each thirdparty/ directories, build them into dist files.
- shorthand:
npm run b3 - for telegram: run
npm install, thennode publish_npm.js. (thepackage.jsonshould remain unchanged except whitelines if everythng succeeds; else please revert it and gramjs/Version.ts) The all files suitable for npm/javascript import will entirely reside indistdirectory, which is indicated in root package.jsonfile:version string. - for libsql_isomorphic-ts/isomorphic-fetch: do nothing
- for rclone.js: do nothing
- for markdowndb: run
npm install, thennpm run build, then, done. (its package.json specifiesfiles, which excludes everything than dist, package.json, LICENSE etc;mainwhich points to the correct entrypoint.) - for cloudflare_workers-sdk/packages/miniflare (the fucking shit): first cd into
cloudflare_workers-sdk, runnpx pnpm install(will download and install playwright [with browser], but it recognizes proxy if set, so wait and should be ok); thennpx pnpm --dir ./packages/miniflare run buildshould succeed (will likely run into errors/frustration related to the fucking sucking npx/npm/pnpm/dlx, good luck). Thennpx pnpm --dir ./packages/miniflare pack, go intopackages/miniflaredirectory, dotar zxvf miniflare-xxx.tgz. Final package is inpackages/miniflare/packagedirectory, which is correctly referred by tien-kou package.json.
- shorthand:
- cd into project root, delete (necessary?)
package-lock.json node_modules/package.json, runnpm run u3ornpm run upgradeBuiltThirdpartyForkDep. (the--install-links=truein.npmrcis to workaround this bug: npm/cli#6405 ; yes,--install-linksDOESN'T create links; instead directories are created ) (Otherwise, specify file:tgz in package.json is another workaround.) (the thirdparty packages are always recommended to referred explicitly to make things refresh). - run the npm script you want.
https://dev.to/marcogrcr/nodejs-and-esbuild-beware-of-mixing-cjs-and-esm-493n
When using esbuild to bundle code with --platform=node that depends on npm packages with a mixture of cjs and esm entry points, use the following rule of thumb:
When using --bundle, set --format to cjs. This will work in all cases except for esm modules with top-level await. --format=esm can be used but requires a polyfill such as this one. When using --packages=external, set --format to esm. If you're wondering about the difference between cjs and esm, take a look at Node.js: A brief history of cjs, bundlers, and esm.
npx wrangler tail --format json | grep -vE '^Proxy' --line-buffered | jq -r '(" " + (.cpuTime | tostring) + " " + (.event.response.status | tostring) + " " + .event.request.url)'
npx wrangler tail --format json | grep --line-buffered -E '_parse|cpuTime|"url"' -C1