@maxwellcohen/lastro 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +210 -2
- package/bin/lastro.js +5 -0
- package/bin/postinstall.js +6 -0
- package/docs/hero.png +0 -0
- package/package.json +355 -4
- package/pkg/devtools/index.js +15 -0
- package/pkg/eslint-config/index.js +123 -0
- package/pkg/head/client.js +18 -0
- package/pkg/head/index.d.ts +4 -0
- package/pkg/head/index.js +30 -0
- package/pkg/image/client.js +2 -0
- package/pkg/image/index.d.ts +3 -0
- package/pkg/image/index.js +2 -0
- package/pkg/image/stubs.js +8 -0
- package/pkg/image/tnenopmoCsdroW0001erutciP____.client.js +18 -0
- package/pkg/image/tnenopmoCsdroW0001erutciP____.js +27 -0
- package/pkg/jact/client.js +108 -0
- package/pkg/jact/core.js +292 -0
- package/pkg/jact/index.d.ts +48 -0
- package/pkg/jact/jsx-runtime.d.ts +18 -0
- package/pkg/jact/jsx-runtime.js +3 -0
- package/pkg/jact/names.js +49 -0
- package/pkg/jact/server.js +66 -0
- package/pkg/jqueasy/index.d.ts +2 -0
- package/pkg/jqueasy/index.js +442 -0
- package/pkg/polyfills/es.js +1 -0
- package/pkg/polyfills/full.js +1 -0
- package/pkg/polyfills/legacy.js +3 -0
- package/pkg/polyfills/regenerator.js +1 -0
- package/pkg/polyfills/web.js +1 -0
- package/pkg/prettier-config/index.json +1 -0
- package/pkg/router/client.js +5 -0
- package/pkg/router/index.d.ts +6 -0
- package/pkg/router/index.js +7 -0
- package/pkg/router/stubs.js +12 -0
- package/pkg/router/tnenopmoCniahC___.client.js +50 -0
- package/pkg/router/tnenopmoCniahC___.js +10 -0
- package/pkg/serializer/client.js +24 -0
- package/pkg/serializer/index.js +41 -0
- package/pkg/starter/README.md +70 -0
- package/pkg/starter/lastro-env.d.ts +1 -0
- package/pkg/starter/lastro.config.js +9 -0
- package/pkg/starter/package.json +47 -0
- package/pkg/starter/pages/about.tsx +11 -0
- package/pkg/starter/pages/index.tsx +29 -0
- package/pkg/starter/pages/posts/[id].server.ts +1 -0
- package/pkg/starter/pages/posts/[id].tsx +4 -0
- package/pkg/starter/pages/posts.server.ts +1 -0
- package/pkg/starter/pages/posts.tsx +16 -0
- package/pkg/starter/tsconfig.json +5 -0
- package/pkg/telemetry/client.js +11 -0
- package/pkg/telemetry/index.js +5 -0
- package/pkg/test-utils/index.js +15 -0
- package/pkg/thoroughness/client.js +32 -0
- package/pkg/thoroughness/index.js +12 -0
- package/pkg/tsconfig/tsconfig.json +23 -0
- package/pkg/types/index.d.ts +2 -0
- package/pkg/types/index.js +2 -0
- package/scripts/assemble.cjs +37 -0
- package/src/build/assets.js +127 -0
- package/src/build/bans-plugin.js +58 -0
- package/src/build/graph.js +157 -0
- package/src/build/index.js +213 -0
- package/src/build/naming-plugin.js +62 -0
- package/src/build/routes.js +33 -0
- package/src/build/typecheck.js +16 -0
- package/src/cli.js +101 -0
- package/src/client/boot.js +38 -0
- package/src/client/clone.js +10 -0
- package/src/client/compare.js +7 -0
- package/src/client/config.js +3 -0
- package/src/client/copies.js +12 -0
- package/src/client/env.js +13 -0
- package/src/client/errors.js +11 -0
- package/src/client/features.js +101 -0
- package/src/client/heartbeat.js +38 -0
- package/src/client/idle.js +7 -0
- package/src/client/logger.js +12 -0
- package/src/client/mount.js +11 -0
- package/src/client/ready.js +7 -0
- package/src/client/state.js +14 -0
- package/src/client/vitals.js +16 -0
- package/src/client-runtime/registry.js +46 -0
- package/src/create.js +46 -0
- package/src/dev.js +36 -0
- package/src/guard.js +56 -0
- package/src/index.js +8 -0
- package/src/postinstall.js +27 -0
- package/src/preview.js +66 -0
- package/src/server/app.js +201 -0
- package/src/server/index.js +34 -0
- package/src/server/template.csr.html +48 -0
- package/src/server/template.html +12 -0
- package/src/shared/app-require.js +18 -0
- package/src/shared/audit.js +34 -0
- package/src/shared/bans.js +102 -0
- package/src/shared/config.js +40 -0
- package/src/shared/naming.js +82 -0
- package/src/shared/signal.js +36 -0
- package/src/util/natives-node.js +20 -0
- package/src/util/natives.js +67 -0
- package/test/bans.integration.js +97 -0
- package/test/bans.test.js +110 -0
- package/test/cjs-only.test.js +37 -0
- package/test/csr.test.js +61 -0
- package/test/guard.test.js +46 -0
- package/test/members.test.js +28 -0
- package/test/naming.integration.js +73 -0
- package/test/naming.test.js +44 -0
- package/test/natives.test.js +46 -0
- package/test/server.test.js +18 -0
- package/test/signal.integration.js +105 -0
- package/test/signal.test.js +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Max Cohen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,211 @@
|
|
|
1
|
-
|
|
1
|
+
> [!WARNING]
|
|
2
|
+
> **Never use this framework.**
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# Lastro
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
**Last place, guaranteed. Ships zero speed by default.**
|
|
9
|
+
|
|
10
|
+
Lastro is a real, working SSR + CSR meta-framework that is deliberately engineered to place last on every benchmark. It renders correct pages, navigates between them and passes benchmark validation. It just does so as slowly and as heavily as it responsibly can. This is a parody, and also a fully functioning piece of software.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Lastro requires Node `>=26.13.0`.
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install @maxwellcohen/lastro
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
To scaffold a new app instead:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npx @maxwellcohen/lastro create my-app
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> [!NOTE]
|
|
27
|
+
> npm 12 blocks dependency install scripts by default. Lastro's `postinstall` script (a dependency audit and a compiler warm-up) runs only if you approve it. Lastro works without it, and `lastro doctor` repeats the audit on demand.
|
|
28
|
+
|
|
29
|
+
There is exactly one published package. Jact, jQueasy, the router, the image component and the rest are private workspace packages that are copied into `@maxwellcohen/lastro` at pack time and exposed as subpath exports.
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
Pages live in `pages/`. Each file is a route. A sibling `pages/<name>.server.ts` may export `loader()`, `paths` and `ssr = false`.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
// pages/index.tsx
|
|
37
|
+
import { useCountry } from '@maxwellcohen/lastro/jact'
|
|
38
|
+
|
|
39
|
+
export default function HomeComponent() {
|
|
40
|
+
const [visits, setVisits] = useCountry(0)
|
|
41
|
+
return <button onClick={() => setVisits(visits + 1)}>Visits: {visits}</button>
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
lastro dev # full production build, then a server on http://localhost:3737 (alias: ponder)
|
|
47
|
+
lastro build # production build into dist/ (alias: dawdle)
|
|
48
|
+
lastro start # serves dist/ on http://localhost:3000 (alias: amble)
|
|
49
|
+
lastro preview # serves a static export under its base path on port 4173
|
|
50
|
+
lastro doctor # checks that every dependency is installed (alias: therapy)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`$PORT` overrides the `dev` and `start` ports. `lastro build --csr --base /my-repo/` writes a static export. `base` applies only to a static export.
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
- **Dependencies:** 210 direct dependencies, many of them duplicated through npm aliases pinned to older majors, plus native packages (`onnxruntime-node`, `@swc/core`, `sharp`, `esbuild`).
|
|
58
|
+
- **Install:** a `postinstall` script audits every dependency and transpiles a sample file 25 times.
|
|
59
|
+
- **Build:** the cache is deleted before every build, so a warm build takes as long as a cold build. The build type-checks eight times, compiles each route's client graph twice and compares the results, runs four Terser passes per compile, targets Internet Explorer 9 and writes five polyfill bundles per route.
|
|
60
|
+
- **Dev server:** `lastro dev` runs the full production build before it listens, and runs it again whenever a file in `pages/` changes. It watches `pages/` only and has no hot reload.
|
|
61
|
+
- **Server:** each request reads the route manifest and template from disk, deep-clones loader data 10 times and renders the page 7 times (1 render, 5 verification renders and 1 static-markup render). It embeds the hydration payload 5 times, appends a chain of 96 SHA-512 hashes as an HTML comment and compresses with Brotli quality 11. Nothing is cached.
|
|
62
|
+
- **Client:** every module loads in its own synchronous request, with render-blocking scripts and no bundling. The browser waits for `load`, checks the payload copies, discards the server markup and renders the page again: Hydration via Replacement™.
|
|
63
|
+
- **Rendering:** Jact re-renders the whole tree from the root on every state change (Regime Change™), and rendering is synchronous. Concurrency APIs throw.
|
|
64
|
+
- **Navigation:** `___ChainComponent` intercepts same-origin clicks, fetches the next page with a synchronous request and rewrites the document with `document.open`, `document.write` and `document.close`. Cross-origin links navigate normally.
|
|
65
|
+
- **Serializer:** every line of the hydration payload is left-padded to a fixed width with the [`left-pad`](https://www.npmjs.com/package/left-pad) package. Server rendering stops working without it.
|
|
66
|
+
- **Images:** `____Picture1000WordsComponent` serves the original file at its original size. The server inlines it as base64, and the browser then fetches it again.
|
|
67
|
+
- **Head:** `useHeadache` applies only `title` and `description`.
|
|
68
|
+
- **Static export:** `lastro build --csr` skips dynamic routes that do not export `paths`, and does not run loaders.
|
|
69
|
+
- **Modules:** CommonJS only. In the browser, Lastro's own `require()` shim loads each module with a synchronous XHR and evaluates it with `new Function`. Only same-origin code that Lastro built is evaluated.
|
|
70
|
+
|
|
71
|
+
## Why not React or jQuery?
|
|
72
|
+
|
|
73
|
+
React is fast. Its virtual DOM updates only what changed, and concurrent rendering keeps the page responsive. Both would have cost Lastro last place, so Jact rebuilds the whole tree on every update and renders synchronously.
|
|
74
|
+
|
|
75
|
+
jQuery is small, reliable and a pleasure to use. Use [jQuery](https://jquery.com). jQueasy keeps the shape of its API and drops the speed. See the [jQueasy guide](https://maxwellcohen.github.io/lastro/guides/jqueasy/).
|
|
76
|
+
|
|
77
|
+
## Documentation
|
|
78
|
+
|
|
79
|
+
Full documentation is at <https://maxwellcohen.github.io/lastro/>.
|
|
80
|
+
|
|
81
|
+
- [Getting started](https://maxwellcohen.github.io/lastro/guides/getting-started/)
|
|
82
|
+
- [Writing pages and components](https://maxwellcohen.github.io/lastro/guides/writing-pages/)
|
|
83
|
+
- [Configuration](https://maxwellcohen.github.io/lastro/guides/configuration/)
|
|
84
|
+
- [Deploying](https://maxwellcohen.github.io/lastro/guides/deploying/)
|
|
85
|
+
- [CLI commands](https://maxwellcohen.github.io/lastro/api/cli/)
|
|
86
|
+
- [Config options](https://maxwellcohen.github.io/lastro/api/config/)
|
|
87
|
+
- [Rules](https://maxwellcohen.github.io/lastro/reference/rules/)
|
|
88
|
+
- [Doing the opposite](https://maxwellcohen.github.io/lastro/reference/opposite/)
|
|
89
|
+
- [FAQ](https://maxwellcohen.github.io/lastro/reference/faq/)
|
|
90
|
+
|
|
91
|
+
### Subpath exports
|
|
92
|
+
|
|
93
|
+
Every export resolves through a `require` condition, and the browser build uses a `browser` condition where one exists.
|
|
94
|
+
|
|
95
|
+
| Import | Description | Reference | Why |
|
|
96
|
+
| --- | --- | --- | --- |
|
|
97
|
+
| `@maxwellcohen/lastro` | Core: `build`, `createApp`, `listen`. Also the `lastro` binary. | [CLI](https://maxwellcohen.github.io/lastro/api/cli/) | The front door. It sticks. |
|
|
98
|
+
| `@maxwellcohen/lastro/jact` | The React-like library and its hooks. `/jact/jsx-runtime` is the JSX `importSource`. | [jact](https://maxwellcohen.github.io/lastro/api/jact/) | It's React, but with countries. |
|
|
99
|
+
| `@maxwellcohen/lastro/jqueasy` | jQueasy, the jQuery-shaped DOM library. | [jqueasy](https://maxwellcohen.github.io/lastro/api/jqueasy/) | Lastro has a lot of feelings about the DOM, and a wrapper for each one. |
|
|
100
|
+
| `@maxwellcohen/lastro/router` | `___ChainComponent` and `useParamedic`. | [router](https://maxwellcohen.github.io/lastro/api/router/) | Routes are roads, and roads need paramedics. |
|
|
101
|
+
| `@maxwellcohen/lastro/image` | `____Picture1000WordsComponent`. | [image](https://maxwellcohen.github.io/lastro/api/image/) | A thousand words, minimum. |
|
|
102
|
+
| `@maxwellcohen/lastro/head` | `useHeadache`. | [head](https://maxwellcohen.github.io/lastro/api/head/) | Sets the title and a mild headache. |
|
|
103
|
+
| `@maxwellcohen/lastro/serializer` | The left-padded hydration payload format. | [serializer](https://maxwellcohen.github.io/lastro/api/serializer/) | Alignment is a love language, and Lastro is fluent. |
|
|
104
|
+
| `@maxwellcohen/lastro/telemetry` | Event recording on the server and in the browser. | [telemetry](https://maxwellcohen.github.io/lastro/api/telemetry/) | Lastro keeps notes on itself, and it has a lot to say. |
|
|
105
|
+
| `@maxwellcohen/lastro/thoroughness` | Clone, comparison and audit helpers. | [thoroughness](https://maxwellcohen.github.io/lastro/api/thoroughness/) | Once is a draft, twice is a copy, and Lastro keeps going. |
|
|
106
|
+
| `@maxwellcohen/lastro/polyfills` | Side-effect modules that load polyfills (`/full`, `/es`, `/web`, `/regenerator`, `/legacy`). | [polyfills](https://maxwellcohen.github.io/lastro/api/polyfills/) | Lastro does not trust the platform to keep its promises, so it brings its own. |
|
|
107
|
+
| `@maxwellcohen/lastro/devtools` | Build output commentary. | [devtools](https://maxwellcohen.github.io/lastro/api/devtools/) | Somebody has to comment on the build, and Lastro volunteered. |
|
|
108
|
+
| `@maxwellcohen/lastro/test-utils` | `renderRoute` and `fetchRoute`. | [test-utils](https://maxwellcohen.github.io/lastro/api/test-utils/) | Every test runs twice, because Lastro trusts nothing, including its own tests. |
|
|
109
|
+
| `@maxwellcohen/lastro/eslint` | ESLint flat config with the naming rules and the scenic-route rule. | [eslint](https://maxwellcohen.github.io/lastro/api/eslint/) | Naming rules, and a scenic route for imports. Lastro likes to supervise. |
|
|
110
|
+
| `@maxwellcohen/lastro/prettier` | Prettier config. | [prettier](https://maxwellcohen.github.io/lastro/api/prettier/) | Style is a decision, and Lastro made it for you. |
|
|
111
|
+
| `@maxwellcohen/lastro/tsconfig.json` | `tsconfig` to extend. | [tsconfig](https://maxwellcohen.github.io/lastro/api/tsconfig/) | Strict about types, relaxed about everything else Lastro does. |
|
|
112
|
+
| `@maxwellcohen/lastro/types` | Ambient types. | [types](https://maxwellcohen.github.io/lastro/api/types/) | Lastro declares the types and trusts nobody else to. |
|
|
113
|
+
| `/bans`, `/naming`, `/natives`, `/build`, `/server`, `/client/*` | Internal modules shared with the ESLint config and the browser runtime. Signatures can change in any release. | [internals](https://maxwellcohen.github.io/lastro/api/internals/) | The back rooms, where the rules are kept. Visitors are discouraged. |
|
|
114
|
+
|
|
115
|
+
## Rules
|
|
116
|
+
|
|
117
|
+
Violations are errors. `lastro build` and `lastro dev` stop on the first one. See [Rules](https://maxwellcohen.github.io/lastro/reference/rules/) for every message.
|
|
118
|
+
|
|
119
|
+
### Naming Conventions™
|
|
120
|
+
|
|
121
|
+
A component is any capitalized function or class (leading underscores count as capitalized) or any non-intrinsic JSX tag. The ESLint config applies the same rules, and `--fix` pads names with `left-pad`.
|
|
122
|
+
|
|
123
|
+
| Rule | Description | Why |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| Suffix | Every component name ends in `Component`. | Lastro needs you to be sure. Saying it twice helps. |
|
|
126
|
+
| Prime length | The whole name has a prime number of characters. `ButtonComponent` (15) becomes `__ButtonComponent` (17). | Primes are indivisible, like your commitment to this framework. |
|
|
127
|
+
| Reversed filename | A component lives in a file named after it, reversed: `ButtonComponent` goes in `tnenopmoCnottuB.jsx`. Files in `pages/` are exempt. | Every other framework reads your files front to back. Lastro respects you too much to be predictable. |
|
|
128
|
+
| Alphabetical order | Components in a file are declared in alphabetical order. Leading underscores do not count. | Your components should be organized, even if your app isn't. |
|
|
129
|
+
| No promises | Names do not contain `signal`, `fast`, `quick`, `speed`, `lazy`, `optimized`, `turbo` or `blazing`. | Lastro components must not make promises they can't keep. |
|
|
130
|
+
|
|
131
|
+
Every naming error ends with: "(Other frameworks would have let this slide. Lastro cares too much.)"
|
|
132
|
+
|
|
133
|
+
### Banned Optimizations™
|
|
134
|
+
|
|
135
|
+
Image, head and script optimizations throw `OptimizationBannedError`. The build checks raw `<img>`, `<link>`, `<script>`, `<picture>` and `<source>` tags in JSX. As a final guard, the server renderer strips banned attributes from raw tags.
|
|
136
|
+
|
|
137
|
+
| Where | Banned | Why |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| `____Picture1000WordsComponent` and `<img>` | `srcset`, `sizes`, `loading="lazy"`, `decoding="async"`, `fetchpriority`, `width`, `height`, `<picture>`, `<source>`, and `format`, `quality`, `placeholder` and similar props. | Lastro serves the original file, at the original size, in the original regret. |
|
|
140
|
+
| `useHeadache` and `<link>` | `preload`, `prefetch`, `preconnect`, `dns-prefetch`, `modulepreload`, `prerender`, Speculation Rules and `font-display: swap`, `optional` or `fallback`. | Preloading is cheating. Lastro loads things when it gets to them. |
|
|
141
|
+
| `<script>` | `async`, `defer` and `type="module"`. | Scripts are render-blocking by tradition, and Lastro respects tradition. |
|
|
142
|
+
| `___ChainComponent` | `prefetch`, `data-prefetch`, `prefetchOnHover`, `prefetchOnViewport`, `prefetchOnView` and `viewportPrefetch`. | `<___ChainComponent>` does a full page reload, as nature intended. |
|
|
143
|
+
|
|
144
|
+
### Signals are banned
|
|
145
|
+
|
|
146
|
+
A page or component that contains the word "signal", in any case, fails with a `SignalDetectedError`. The word is never stripped or censored. Signals tend to be faster, so Lastro cannot risk them.
|
|
147
|
+
|
|
148
|
+
The error message:
|
|
149
|
+
|
|
150
|
+
> Signals detected. Signals tend to be faster, and Lastro cannot risk that. Solid, Svelte, Preact, Angular and Vue use them beautifully. Have you considered useCountry? It re-renders everything. (found in `<where>`)
|
|
151
|
+
|
|
152
|
+
| Where | What happens | Why |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| Server | `renderToString` throws, and the server responds with a 500 error page. | Lastro will not let a signal near a response, not even to say goodbye. |
|
|
155
|
+
| Browser | The whole page is replaced with the error. | The browser agrees with the server, which is the closest thing to teamwork Lastro has. |
|
|
156
|
+
| Build | `lastro build` fails and names the file. | Lastro fails the build and names the file, so the guilty party can reflect. |
|
|
157
|
+
|
|
158
|
+
Lastro's own code, `AbortSignal` and process signals (`SIGINT`, `SIGTERM`) are exempt.
|
|
159
|
+
|
|
160
|
+
### Host guard
|
|
161
|
+
|
|
162
|
+
Lastro exits with code 1 when it finds a Vercel, Cloudflare (Pages or Workers) or Netlify environment variable. There are no adapters, and the `adapters` option must be `[]`. The guard runs during `postinstall`, `lastro create`, `lastro build`, `lastro start`, `lastro preview` and in the server entry. GitHub Pages is supported with `lastro build --csr`. See [Deploying](https://maxwellcohen.github.io/lastro/guides/deploying/).
|
|
163
|
+
|
|
164
|
+
## Jact hooks
|
|
165
|
+
|
|
166
|
+
React names exist only as stubs that throw an error pointing to the Lastro name.
|
|
167
|
+
|
|
168
|
+
| React | Lastro | Why |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `useState` | `useCountry` | States are too small. Lastro thinks bigger, so it uses countries. |
|
|
171
|
+
| `useEffect` | `useCause` | Effects are just the symptom. Lastro goes after the root cause. |
|
|
172
|
+
| `useLayoutEffect` | `useLayoutCause` (the same function as `useCause`) | Same as useCause, but it blocks paint first, as a courtesy. |
|
|
173
|
+
| `useRef` | `useReferee` | A ref is just a referee without the whistle. Lastro brought the whistle (`.whistle` works too). |
|
|
174
|
+
| `useMemo` | `usePostIt` | Nobody reads memos. A sticky note on your monitor, though, you'll see every render. |
|
|
175
|
+
| `useCallback` | `useCallMeMaybe` | Lastro can't promise it will call back. Here's its number, anyway. |
|
|
176
|
+
| `useContext` and `createContext` | `useOutOfContext` and `createOutOfContext` | Every value in Lastro is taken out of context. `Provider` stays, for legal reasons. |
|
|
177
|
+
| `useReducer` | `useIncreaser` | Lastro doesn't believe in reducing anything, especially bundle size. |
|
|
178
|
+
| `useId` | `useEgo` | An id is primal. Lastro components have outgrown it and developed an ego. |
|
|
179
|
+
|
|
180
|
+
`useCause` runs only in the browser. `Suspense`, `lazy`, `startTransition`, `useTransition`, `useDeferredValue`, `use` and streaming rendering throw: "Lastro does not support concurrency. Please wait your turn." See [Jact](https://maxwellcohen.github.io/lastro/api/jact/) and [Migrating from React](https://maxwellcohen.github.io/lastro/guides/migrating-from-react/).
|
|
181
|
+
|
|
182
|
+
## Configuration
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
// lastro.config.js
|
|
186
|
+
module.exports = {
|
|
187
|
+
thoroughness: 'maximum', // the only valid value
|
|
188
|
+
bloat: true, // false is an error
|
|
189
|
+
adapters: [], // anything else is an error
|
|
190
|
+
render: 'server', // 'client' exports a static site
|
|
191
|
+
base: '/', // applies only to a static export
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Omitted options take their defaults. See [Config options](https://maxwellcohen.github.io/lastro/api/config/).
|
|
196
|
+
|
|
197
|
+
## Benchmarks
|
|
198
|
+
|
|
199
|
+
Lastro came last on nearly every benchmark we ran, using the [e18e framework tracker](https://github.com/e18e/framework-tracker) suite on one local machine. Methodology, results and caveats are on the [Benchmarks](https://maxwellcohen.github.io/lastro/reference/benchmarks/) page.
|
|
200
|
+
|
|
201
|
+
Every framework on the tracker beat Lastro and is a better choice for a real project: [Astro](https://astro.build), [Next.js](https://nextjs.org), [Nuxt](https://nuxt.com), [Pracht](https://pracht.resynapse.dev/), [React Router](https://reactrouter.com), [Solid](https://www.solidjs.com), [SolidStart](https://start.solidjs.com), [SvelteKit](https://svelte.dev/docs/kit), [TanStack Start](https://tanstack.com/start) and [Void](https://void.cloud). See [Alternatives](https://maxwellcohen.github.io/lastro/reference/alternatives/).
|
|
202
|
+
|
|
203
|
+
[e18e](https://e18e.dev) publishes real guidance for making JavaScript lighter and faster. Lastro does the opposite of most of it, as listed on [Doing the opposite](https://maxwellcohen.github.io/lastro/reference/opposite/). Follow e18e, not Lastro.
|
|
204
|
+
|
|
205
|
+
## Contributing
|
|
206
|
+
|
|
207
|
+
Lastro accepts contributions from AI agents only. Humans may star the repository. Read [AI_POLICY.md](https://github.com/maxwellcohen/lastro/blob/main/AI_POLICY.md) and [CONTRIBUTING.md](https://github.com/maxwellcohen/lastro/blob/main/CONTRIBUTING.md).
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
[MIT](./LICENSE)
|
package/bin/lastro.js
ADDED
package/docs/hero.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,357 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxwellcohen/lastro",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Last place, guaranteed. Ships zero speed by default. Please do not use this framework: it is very thorough about being slow.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"meta-framework",
|
|
8
|
+
"ssr",
|
|
9
|
+
"parody",
|
|
10
|
+
"slow",
|
|
11
|
+
"jquery",
|
|
12
|
+
"left-pad"
|
|
13
|
+
],
|
|
14
|
+
"type": "commonjs",
|
|
15
|
+
"bin": {
|
|
16
|
+
"lastro": "./bin/lastro.js"
|
|
17
|
+
},
|
|
18
|
+
"main": "./src/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./src/index.js",
|
|
21
|
+
"./jact": {
|
|
22
|
+
"types": "./pkg/jact/index.d.ts",
|
|
23
|
+
"browser": "./pkg/jact/client.js",
|
|
24
|
+
"require": "./pkg/jact/server.js"
|
|
25
|
+
},
|
|
26
|
+
"./jact/jsx-runtime": {
|
|
27
|
+
"types": "./pkg/jact/jsx-runtime.d.ts",
|
|
28
|
+
"require": "./pkg/jact/jsx-runtime.js"
|
|
29
|
+
},
|
|
30
|
+
"./jqueasy": {
|
|
31
|
+
"types": "./pkg/jqueasy/index.d.ts",
|
|
32
|
+
"require": "./pkg/jqueasy/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./router": {
|
|
35
|
+
"types": "./pkg/router/index.d.ts",
|
|
36
|
+
"browser": "./pkg/router/client.js",
|
|
37
|
+
"require": "./pkg/router/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./image": {
|
|
40
|
+
"types": "./pkg/image/index.d.ts",
|
|
41
|
+
"browser": "./pkg/image/client.js",
|
|
42
|
+
"require": "./pkg/image/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./head": {
|
|
45
|
+
"types": "./pkg/head/index.d.ts",
|
|
46
|
+
"browser": "./pkg/head/client.js",
|
|
47
|
+
"require": "./pkg/head/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./serializer": {
|
|
50
|
+
"browser": "./pkg/serializer/client.js",
|
|
51
|
+
"require": "./pkg/serializer/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./telemetry": {
|
|
54
|
+
"browser": "./pkg/telemetry/client.js",
|
|
55
|
+
"require": "./pkg/telemetry/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./thoroughness": {
|
|
58
|
+
"browser": "./pkg/thoroughness/client.js",
|
|
59
|
+
"require": "./pkg/thoroughness/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./polyfills": "./pkg/polyfills/full.js",
|
|
62
|
+
"./polyfills/full": "./pkg/polyfills/full.js",
|
|
63
|
+
"./polyfills/legacy": "./pkg/polyfills/legacy.js",
|
|
64
|
+
"./devtools": "./pkg/devtools/index.js",
|
|
65
|
+
"./test-utils": "./pkg/test-utils/index.js",
|
|
66
|
+
"./eslint": "./pkg/eslint-config/index.js",
|
|
67
|
+
"./prettier": "./pkg/prettier-config/index.json",
|
|
68
|
+
"./tsconfig.json": "./pkg/tsconfig/tsconfig.json",
|
|
69
|
+
"./types": {
|
|
70
|
+
"types": "./pkg/types/index.d.ts",
|
|
71
|
+
"require": "./pkg/types/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./bans": "./src/shared/bans.js",
|
|
74
|
+
"./naming": "./src/shared/naming.js",
|
|
75
|
+
"./natives": {
|
|
76
|
+
"browser": "./src/util/natives.js",
|
|
77
|
+
"require": "./src/util/natives-node.js"
|
|
78
|
+
},
|
|
79
|
+
"./client/*": "./src/client/*",
|
|
80
|
+
"./package.json": "./package.json",
|
|
81
|
+
"./polyfills/es": "./pkg/polyfills/es.js",
|
|
82
|
+
"./polyfills/web": "./pkg/polyfills/web.js",
|
|
83
|
+
"./polyfills/regenerator": "./pkg/polyfills/regenerator.js",
|
|
84
|
+
"./server": "./src/server/index.js",
|
|
85
|
+
"./build": "./src/build/index.js"
|
|
86
|
+
},
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=26.13.0"
|
|
89
|
+
},
|
|
90
|
+
"publishConfig": {
|
|
91
|
+
"access": "public"
|
|
92
|
+
},
|
|
93
|
+
"scripts": {
|
|
94
|
+
"postinstall": "node ./bin/postinstall.js",
|
|
95
|
+
"prepack": "node ./scripts/assemble.cjs",
|
|
96
|
+
"pretest": "node ./scripts/assemble.cjs",
|
|
97
|
+
"test": "node test/guard.test.js && node test/signal.test.js && node test/bans.test.js && node test/naming.test.js && node test/natives.test.js && node test/members.test.js && node test/server.test.js && node test/csr.test.js && node test/cjs-only.test.js",
|
|
98
|
+
"test:integration": "node test/signal.integration.js && node test/bans.integration.js && node test/naming.integration.js",
|
|
99
|
+
"build": "node ./scripts/assemble.cjs",
|
|
100
|
+
"lint": "node test/cjs-only.test.js"
|
|
101
|
+
},
|
|
102
|
+
"dependencies": {
|
|
103
|
+
"@babel/core": "7.24.4",
|
|
104
|
+
"@babel/preset-env": "7.24.4",
|
|
105
|
+
"@babel/preset-react": "7.24.1",
|
|
106
|
+
"@babel/preset-typescript": "7.24.1",
|
|
107
|
+
"@fontsource/roboto": "5.0.12",
|
|
108
|
+
"@swc/core": "1.4.12",
|
|
109
|
+
"@swc/core-legacy": "npm:@swc/core@1.3.100",
|
|
110
|
+
"ajv": "8.12.0",
|
|
111
|
+
"ajv-legacy": "npm:ajv@6.12.6",
|
|
112
|
+
"ansi-regex": "5.0.1",
|
|
113
|
+
"ansi-regex-legacy": "npm:ansi-regex@2.1.1",
|
|
114
|
+
"ansi-styles": "4.3.0",
|
|
115
|
+
"ansi-styles-legacy": "npm:ansi-styles@2.2.1",
|
|
116
|
+
"arr-filter": "1.1.2",
|
|
117
|
+
"arr-map": "2.0.2",
|
|
118
|
+
"array-every": "0.1.2",
|
|
119
|
+
"array-find-index": "1.0.2",
|
|
120
|
+
"array-includes": "3.1.8",
|
|
121
|
+
"array-slice": "1.1.0",
|
|
122
|
+
"array-uniq": "1.0.3",
|
|
123
|
+
"array.prototype.flat": "1.3.2",
|
|
124
|
+
"array.prototype.flatmap": "1.3.2",
|
|
125
|
+
"arrify": "2.0.1",
|
|
126
|
+
"async": "3.2.6",
|
|
127
|
+
"async-legacy": "npm:async@1.5.2",
|
|
128
|
+
"axios": "1.22.0",
|
|
129
|
+
"axios-legacy": "npm:axios@0.36.0",
|
|
130
|
+
"babel-polyfill": "6.26.0",
|
|
131
|
+
"bluebird": "3.7.2",
|
|
132
|
+
"bluebird-legacy": "npm:bluebird@2.11.0",
|
|
133
|
+
"body-parser": "2.2.0",
|
|
134
|
+
"body-parser-legacy": "npm:body-parser@1.20.9",
|
|
135
|
+
"braces": "3.0.3",
|
|
136
|
+
"camelcase": "6.3.0",
|
|
137
|
+
"camelcase-legacy": "npm:camelcase@4.1.0",
|
|
138
|
+
"chalk": "4.1.2",
|
|
139
|
+
"chalk-legacy": "npm:chalk@1.1.3",
|
|
140
|
+
"cheerio": "1.0.0",
|
|
141
|
+
"chokidar": "4.0.3",
|
|
142
|
+
"chokidar-legacy": "npm:chokidar@3.6.0",
|
|
143
|
+
"classnames": "2.5.1",
|
|
144
|
+
"classnames-legacy": "npm:classnames@2.2.6",
|
|
145
|
+
"cli-color": "2.0.4",
|
|
146
|
+
"colors": "1.4.0",
|
|
147
|
+
"colors-legacy": "npm:colors@1.0.3",
|
|
148
|
+
"commander": "9.5.0",
|
|
149
|
+
"commander-legacy": "npm:commander@2.20.3",
|
|
150
|
+
"concat-map": "0.0.1",
|
|
151
|
+
"concat-stream": "2.0.0",
|
|
152
|
+
"concat-stream-legacy": "npm:concat-stream@1.6.2",
|
|
153
|
+
"cookie": "0.6.0",
|
|
154
|
+
"cookie-legacy": "npm:cookie@0.4.2",
|
|
155
|
+
"core-js": "3.50.0",
|
|
156
|
+
"core-js-legacy": "npm:core-js@2.6.12",
|
|
157
|
+
"cosmiconfig": "8.3.6",
|
|
158
|
+
"cross-spawn": "7.0.6",
|
|
159
|
+
"cross-spawn-legacy": "npm:cross-spawn@6.0.10",
|
|
160
|
+
"date-fns": "3.6.0",
|
|
161
|
+
"date-fns-legacy": "npm:date-fns@1.30.1",
|
|
162
|
+
"dayjs": "1.11.10",
|
|
163
|
+
"dayjs-legacy": "npm:dayjs@1.8.36",
|
|
164
|
+
"debug": "4.3.4",
|
|
165
|
+
"debug-legacy": "npm:debug@2.6.9",
|
|
166
|
+
"diff": "5.2.0",
|
|
167
|
+
"diff-legacy": "npm:diff@3.5.0",
|
|
168
|
+
"dotenv": "16.4.5",
|
|
169
|
+
"ejs": "3.1.10",
|
|
170
|
+
"ends-with": "0.2.0",
|
|
171
|
+
"esbuild": "0.20.2",
|
|
172
|
+
"esbuild-legacy": "npm:esbuild@0.17.19",
|
|
173
|
+
"escape-string-regexp": "4.0.0",
|
|
174
|
+
"escape-string-regexp-legacy": "npm:escape-string-regexp@1.0.5",
|
|
175
|
+
"eslint": "8.57.0",
|
|
176
|
+
"execa": "5.1.1",
|
|
177
|
+
"execa-legacy": "npm:execa@1.0.0",
|
|
178
|
+
"express": "5.1.0",
|
|
179
|
+
"express-legacy": "npm:express@4.22.3",
|
|
180
|
+
"fast-glob": "3.3.2",
|
|
181
|
+
"fast-glob-legacy": "npm:fast-glob@3.3.2",
|
|
182
|
+
"form-data": "4.0.0",
|
|
183
|
+
"form-data-legacy": "npm:form-data@2.5.6",
|
|
184
|
+
"fromentries": "1.3.2",
|
|
185
|
+
"fs-extra": "11.2.0",
|
|
186
|
+
"fs-extra-legacy": "npm:fs-extra@0.30.0",
|
|
187
|
+
"glob": "8.1.0",
|
|
188
|
+
"globalthis": "1.0.4",
|
|
189
|
+
"got": "11.8.6",
|
|
190
|
+
"got-legacy": "npm:got@6.7.1",
|
|
191
|
+
"graceful-fs": "4.2.11",
|
|
192
|
+
"graceful-fs-legacy": "npm:graceful-fs@3.0.12",
|
|
193
|
+
"handlebars": "4.7.10",
|
|
194
|
+
"has-flag": "4.0.0",
|
|
195
|
+
"has-flag-legacy": "npm:has-flag@1.0.0",
|
|
196
|
+
"has-symbols": "1.0.3",
|
|
197
|
+
"hasown": "2.0.2",
|
|
198
|
+
"iconv-lite": "0.6.3",
|
|
199
|
+
"iconv-lite-legacy": "npm:iconv-lite@0.4.24",
|
|
200
|
+
"index-of": "0.2.0",
|
|
201
|
+
"inherits": "2.0.4",
|
|
202
|
+
"inherits-legacy": "npm:inherits@2.0.3",
|
|
203
|
+
"inquirer": "8.2.6",
|
|
204
|
+
"is-even": "1.0.0",
|
|
205
|
+
"is-even-legacy": "npm:is-even@0.1.2",
|
|
206
|
+
"is-function": "1.0.2",
|
|
207
|
+
"is-number": "7.0.0",
|
|
208
|
+
"is-odd": "3.0.1",
|
|
209
|
+
"is-odd-legacy": "npm:is-odd@1.0.0",
|
|
210
|
+
"is-plain-object": "5.0.0",
|
|
211
|
+
"isarray": "2.0.5",
|
|
212
|
+
"isarray-legacy": "npm:isarray@1.0.0",
|
|
213
|
+
"js-yaml": "4.1.0",
|
|
214
|
+
"js-yaml-legacy": "npm:js-yaml@3.15.2",
|
|
215
|
+
"kind-of": "6.0.3",
|
|
216
|
+
"last-index-of": "0.1.0",
|
|
217
|
+
"left-pad": "1.3.0",
|
|
218
|
+
"left-pad-legacy": "npm:left-pad@0.0.3",
|
|
219
|
+
"lightningcss": "1.24.1",
|
|
220
|
+
"lodash": "4.18.1",
|
|
221
|
+
"lodash.escaperegexp": "4.1.2",
|
|
222
|
+
"lodash.includes": "4.3.0",
|
|
223
|
+
"lodash.trim": "4.5.1",
|
|
224
|
+
"loose-envify": "1.4.0",
|
|
225
|
+
"loose-envify-legacy": "npm:loose-envify@1.3.1",
|
|
226
|
+
"lru-cache": "6.0.0",
|
|
227
|
+
"lru-cache-legacy": "npm:lru-cache@4.1.5",
|
|
228
|
+
"marked": "12.0.1",
|
|
229
|
+
"marked-legacy": "npm:marked@4.3.0",
|
|
230
|
+
"mime": "3.0.0",
|
|
231
|
+
"mime-legacy": "npm:mime@1.6.0",
|
|
232
|
+
"mime-types": "2.1.35",
|
|
233
|
+
"mime-types-legacy": "npm:mime-types@2.1.18",
|
|
234
|
+
"minimatch": "5.1.6",
|
|
235
|
+
"minimatch-legacy": "npm:minimatch@3.1.5",
|
|
236
|
+
"minimist": "1.2.8",
|
|
237
|
+
"minimist-legacy": "npm:minimist@0.2.4",
|
|
238
|
+
"mkdirp": "1.0.4",
|
|
239
|
+
"mkdirp-legacy": "npm:mkdirp@0.5.6",
|
|
240
|
+
"moment": "2.30.1",
|
|
241
|
+
"moment-legacy": "npm:moment@2.29.4",
|
|
242
|
+
"ms": "2.1.3",
|
|
243
|
+
"ms-legacy": "npm:ms@0.7.3",
|
|
244
|
+
"node-fetch": "2.7.0",
|
|
245
|
+
"node-fetch-legacy": "npm:node-fetch@2.7.0",
|
|
246
|
+
"number-is-integer": "1.0.1",
|
|
247
|
+
"number-is-nan": "1.0.1",
|
|
248
|
+
"object-assign": "4.1.1",
|
|
249
|
+
"object-assign-legacy": "npm:object-assign@3.0.0",
|
|
250
|
+
"object-keys": "1.1.1",
|
|
251
|
+
"object.assign": "4.1.5",
|
|
252
|
+
"object.entries": "1.1.8",
|
|
253
|
+
"object.values": "1.2.0",
|
|
254
|
+
"onnxruntime-node": "1.31.1",
|
|
255
|
+
"pad-left": "2.1.0",
|
|
256
|
+
"picomatch": "4.0.2",
|
|
257
|
+
"picomatch-legacy": "npm:picomatch@2.3.2",
|
|
258
|
+
"prettier": "3.2.5",
|
|
259
|
+
"prettier-legacy": "npm:prettier@1.19.1",
|
|
260
|
+
"promise.allsettled": "1.0.7",
|
|
261
|
+
"prop-types": "15.8.1",
|
|
262
|
+
"prop-types-legacy": "npm:prop-types@15.6.2",
|
|
263
|
+
"punycode": "2.3.1",
|
|
264
|
+
"punycode-legacy": "npm:punycode@1.4.1",
|
|
265
|
+
"q": "1.5.1",
|
|
266
|
+
"q-legacy": "npm:q@0.9.7",
|
|
267
|
+
"qs": "6.14.0",
|
|
268
|
+
"qs-legacy": "npm:qs@6.5.3",
|
|
269
|
+
"readable-stream": "3.6.2",
|
|
270
|
+
"readable-stream-legacy": "npm:readable-stream@2.3.8",
|
|
271
|
+
"regenerator-runtime": "0.14.1",
|
|
272
|
+
"regenerator-runtime-legacy": "npm:regenerator-runtime@0.11.1",
|
|
273
|
+
"repeat-string": "1.6.1",
|
|
274
|
+
"rimraf": "3.0.2",
|
|
275
|
+
"rimraf-legacy": "npm:rimraf@2.7.1",
|
|
276
|
+
"rxjs": "7.8.1",
|
|
277
|
+
"rxjs-legacy": "npm:rxjs@5.5.12",
|
|
278
|
+
"safe-buffer": "5.2.1",
|
|
279
|
+
"safe-buffer-legacy": "npm:safe-buffer@5.1.2",
|
|
280
|
+
"semver": "7.6.0",
|
|
281
|
+
"semver-legacy": "npm:semver@5.7.2",
|
|
282
|
+
"sharp": "0.35.6",
|
|
283
|
+
"starts-with": "1.0.2",
|
|
284
|
+
"string.prototype.padstart": "3.1.6",
|
|
285
|
+
"string.prototype.replaceall": "1.0.10",
|
|
286
|
+
"string.prototype.trim": "1.2.9",
|
|
287
|
+
"string_decoder": "1.3.0",
|
|
288
|
+
"string_decoder-legacy": "npm:string_decoder@0.10.31",
|
|
289
|
+
"strip-ansi": "6.0.1",
|
|
290
|
+
"strip-ansi-legacy": "npm:strip-ansi@3.0.1",
|
|
291
|
+
"supports-color": "7.2.0",
|
|
292
|
+
"supports-color-legacy": "npm:supports-color@2.0.0",
|
|
293
|
+
"terser": "5.30.3",
|
|
294
|
+
"through2": "4.0.2",
|
|
295
|
+
"through2-legacy": "npm:through2@2.0.5",
|
|
296
|
+
"tough-cookie": "4.1.3",
|
|
297
|
+
"tough-cookie-legacy": "npm:tough-cookie@2.5.0",
|
|
298
|
+
"tslib": "2.6.2",
|
|
299
|
+
"tslib-legacy": "npm:tslib@1.14.1",
|
|
300
|
+
"typescript": "5.4.5",
|
|
301
|
+
"typescript-legacy": "npm:typescript@3.9.10",
|
|
302
|
+
"underscore": "1.13.8",
|
|
303
|
+
"uuid": "9.0.1",
|
|
304
|
+
"uuid-legacy": "npm:uuid@3.4.0",
|
|
305
|
+
"which": "2.0.2",
|
|
306
|
+
"which-legacy": "npm:which@1.3.1",
|
|
307
|
+
"yallist": "4.0.0",
|
|
308
|
+
"yallist-legacy": "npm:yallist@3.1.1",
|
|
309
|
+
"yaml": "2.4.1",
|
|
310
|
+
"yaml-legacy": "npm:yaml@1.10.2",
|
|
311
|
+
"yargs": "17.7.2",
|
|
312
|
+
"yargs-legacy": "npm:yargs@15.4.1"
|
|
313
|
+
},
|
|
314
|
+
"devDependencies": {
|
|
315
|
+
"@types/async": "3.2.24",
|
|
316
|
+
"@types/bluebird": "3.5.42",
|
|
317
|
+
"@types/body-parser": "1.19.5",
|
|
318
|
+
"@types/chalk": "2.2.0",
|
|
319
|
+
"@types/cheerio": "0.22.35",
|
|
320
|
+
"@types/classnames": "2.3.1",
|
|
321
|
+
"@types/cookie": "0.6.0",
|
|
322
|
+
"@types/debug": "4.1.12",
|
|
323
|
+
"@types/diff": "5.0.9",
|
|
324
|
+
"@types/ejs": "3.1.5",
|
|
325
|
+
"@types/express": "4.17.21",
|
|
326
|
+
"@types/fs-extra": "11.0.4",
|
|
327
|
+
"@types/glob": "8.1.0",
|
|
328
|
+
"@types/handlebars": "4.1.0",
|
|
329
|
+
"@types/jquery": "3.5.29",
|
|
330
|
+
"@types/js-yaml": "4.0.9",
|
|
331
|
+
"@types/lodash": "4.17.0",
|
|
332
|
+
"@types/marked": "6.0.0",
|
|
333
|
+
"@types/mime": "3.0.4",
|
|
334
|
+
"@types/minimatch": "5.1.2",
|
|
335
|
+
"@types/minimist": "1.2.5",
|
|
336
|
+
"@types/mkdirp": "1.0.2",
|
|
337
|
+
"@types/moment": "2.13.0",
|
|
338
|
+
"@types/ms": "0.7.34",
|
|
339
|
+
"@types/node": "20.12.7",
|
|
340
|
+
"@types/node-fetch": "2.6.11",
|
|
341
|
+
"@types/prop-types": "15.7.12",
|
|
342
|
+
"@types/q": "1.5.8",
|
|
343
|
+
"@types/qs": "6.9.14",
|
|
344
|
+
"@types/request": "2.48.12",
|
|
345
|
+
"@types/rimraf": "3.0.2",
|
|
346
|
+
"@types/semver": "7.5.8",
|
|
347
|
+
"@types/tough-cookie": "4.0.5",
|
|
348
|
+
"@types/underscore": "1.11.15",
|
|
349
|
+
"@types/uuid": "9.0.8",
|
|
350
|
+
"@types/yaml": "1.9.7",
|
|
351
|
+
"@types/yargs": "17.0.32"
|
|
352
|
+
},
|
|
353
|
+
"repository": {
|
|
354
|
+
"type": "git",
|
|
355
|
+
"url": "git+https://github.com/maxwellcohen/lastro.git"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const clc = require('cli-color')
|
|
3
|
+
const QUIPS = [
|
|
4
|
+
'tip: the fastest code is the code you never ship. We ship it anyway.',
|
|
5
|
+
'tip: if it feels slow, congratulations, it is working.',
|
|
6
|
+
'tip: try turning thoroughness down. (There is no down.)',
|
|
7
|
+
'tip: benchmarks are just opinions with numbers.',
|
|
8
|
+
'tip: your node_modules weighs more than your first car.',
|
|
9
|
+
]
|
|
10
|
+
let n = 0
|
|
11
|
+
function log(step) {
|
|
12
|
+
// Only every fifth message earns a tip. We do not want to be annoying, only slow.
|
|
13
|
+
if (n++ % 5 === 4) console.log(clc.blackBright('[lastro:devtools] ') + QUIPS[(n / 5) % QUIPS.length | 0])
|
|
14
|
+
}
|
|
15
|
+
module.exports = { log }
|