@lakutata/cli 3.0.0-beta.4 → 3.0.0-beta.5
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/README.md +30 -19
- package/dist/esm/controllers/PackController.js +8 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -212,13 +212,25 @@ files by paths which cannot be followed (`require(path.join(__dirname, name))`)
|
|
|
212
212
|
maps, the TypeScript sources and the documentation of the packages are left out. The addons of
|
|
213
213
|
the application itself (`require('./x.node')`, `createRequire(import.meta.url)('./x.node')`) are there too.
|
|
214
214
|
|
|
215
|
-
The
|
|
216
|
-
workers
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
The files the application reads by their paths are not followed by the bundler: the scripts it runs on their own (its
|
|
216
|
+
workers, `new Worker()`, the pools of workers given a file; its child processes, `fork()`; the modules it loads by their
|
|
217
|
+
paths, `require(path.join(__dirname, 'x.js'))`), its data (`fs.readFileSync(path.join(__dirname, 'defaults.json'))`, a
|
|
218
|
+
directory of schemas). And the bundle is not where its modules were: `path.resolve(__dirname, '../../schema')` of a
|
|
219
|
+
module of `build/config/` is the `schema/` of the project, not once bundled in `dist/`. A path to a file given from its
|
|
220
|
+
module is found wherever it is written, in the modules of the application and in the ones of its packages, and the
|
|
221
|
+
expression rewritten to the file in the native tree (`dist/<name>.native/.lakutata/files/`, the directories as in the
|
|
222
|
+
project, the packages linked from outside of it under `node_modules/`):
|
|
223
|
+
|
|
224
|
+
| The path names | |
|
|
225
|
+
|---|---|
|
|
226
|
+
| a script (`.js`, `.cjs`) | bundled on its own with what it loads (a CommonJS file, whatever the type of the project) |
|
|
227
|
+
| another file | copied (a `package.json` its type CommonJS, as the scripts next to it) |
|
|
228
|
+
| a directory of data | its files copied |
|
|
229
|
+
| a directory holding the module (`path.join(__dirname, '..')`: the application, its packages) | not shipped, warned of: its files are declared as resources (`lakutata.resources`, below) |
|
|
230
|
+
| a directory holding scripts or packages (`package.json`, `node_modules`) | not shipped, warned of: its scripts need their packages at run time |
|
|
231
|
+
| nothing yet (a directory the application creates) | left as it is |
|
|
232
|
+
|
|
233
|
+
The paths followed:
|
|
222
234
|
|
|
223
235
|
| Path | |
|
|
224
236
|
|---|---|
|
|
@@ -227,17 +239,16 @@ linked from outside of it under `node_modules/`), and the expression rewritten t
|
|
|
227
239
|
| `path.join(__dirname, 'worker.js')`, `path.resolve(__dirname, …)` | `import.meta.dirname`, `path.dirname(fileURLToPath(import.meta.url))` too |
|
|
228
240
|
| `__dirname + '/worker.js'`, `` `${__dirname}/worker.js` `` | |
|
|
229
241
|
| `require.resolve('./worker')`, `require.resolve(path.resolve(__dirname, '../lib/worker'))` | the extension found as node finds it |
|
|
230
|
-
| `` path.join(__dirname, '
|
|
231
|
-
|
|
232
|
-
The code of tsc (`(0, node_path_1.join)(__dirname, 'worker.js')`) is followed.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
need nothing.
|
|
242
|
+
| `` path.join(__dirname, 'locales', `${lang}.json`) ``, `` new URL(`./jobs/${name}.js`, import.meta.url) `` | known in part: every file and directory its pattern matches (an expression matches a part of a name), its expression kept |
|
|
243
|
+
|
|
244
|
+
The code of tsc (`(0, node_path_1.join)(__dirname, 'worker.js')`) is followed. A script also imported by the application
|
|
245
|
+
is warned of: it is bundled twice, its module apart in each (its state, its classes). The workers of node
|
|
246
|
+
(`worker_threads`) whose scripts cannot be followed are warned of with their file and line, in the modules of the
|
|
247
|
+
application (the packages start workers from the paths their users give): a path known at run time only
|
|
248
|
+
(`new Worker(file)`, a variable or a property of a class holding one of the paths above is followed), or a path relative
|
|
249
|
+
to the current directory of the process (`new Worker('./worker.js')`, which node reads from there, not from the module);
|
|
250
|
+
their scripts are given from the directory of their module, or shipped as resources. The workers running a source
|
|
251
|
+
(`eval: true`) need nothing. The warnings name the modules of the application only, with their file and line.
|
|
241
252
|
|
|
242
253
|
The resources of the application, the files it reads at run time (the built pages of a web application, templates,
|
|
243
254
|
data), are declared by the `lakutata.resources` of its `package.json`, as the `extraResources` of electron-builder:
|
|
@@ -277,7 +288,7 @@ linux/arm64`, as the cross builds of the templates).
|
|
|
277
288
|
| `--layout <file\|directory>` | one file (by default), or a directory: `dist/<name>/` holding the executable, its native addons (`native/`) and its resources (`resources/`), loaded from there without extraction (the installers, the images) |
|
|
278
289
|
| `--entry`, `--no-minify`, `--external` | as `lakutata package bundle` |
|
|
279
290
|
|
|
280
|
-
The native addons, the
|
|
291
|
+
The native addons, the files read by their paths and the resources are embedded in the executable (`--layout file`): at its
|
|
281
292
|
first run, it extracts them into its cache directory (`~/.cache/<name>`, `~/Library/Caches/<name>` on macOS,
|
|
282
293
|
`%LOCALAPPDATA%\<name>\Cache` on Windows, or `LAKUTATA_NATIVE_DIR`; the temporary directory when it cannot be written),
|
|
283
294
|
in a directory named after their content:
|
|
@@ -34,7 +34,11 @@ export class PackController extends Controller {
|
|
|
34
34
|
//The native addons and the scripts of the workers are next to the bundle, which is distributed with them
|
|
35
35
|
if (result.nativeDirectory) {
|
|
36
36
|
const addons = !!result.native.modules.length || result.native.files.some((file) => file.path.endsWith('.node'));
|
|
37
|
-
const contents = [
|
|
37
|
+
const contents = [
|
|
38
|
+
...addons ? [`the native addons (${result.native.modules.join(', ') || 'of the application'})`] : [],
|
|
39
|
+
...result.workers.length ? [`the scripts run on their own (${result.workers.join(', ')})`] : [],
|
|
40
|
+
...result.files.length ? [`the files read by their paths (${result.files.join(', ')})`] : []
|
|
41
|
+
];
|
|
38
42
|
done(`${path.relative(process.cwd(), result.nativeDirectory)}: ${contents.join(' and ')}, distributed with the bundle`);
|
|
39
43
|
}
|
|
40
44
|
if (result.resourcesDirectory)
|
|
@@ -52,7 +56,9 @@ export class PackController extends Controller {
|
|
|
52
56
|
if (result.resources.length)
|
|
53
57
|
step(result.directory ? `Resources next to the executable: ${result.resources.join(', ')}` : `Resources embedded, extracted at the first run: ${result.resources.join(', ')}`);
|
|
54
58
|
if (result.workers.length)
|
|
55
|
-
step(result.directory ? `Scripts
|
|
59
|
+
step(result.directory ? `Scripts run on their own next to the executable: ${result.workers.join(', ')}` : `Scripts run on their own embedded, extracted at the first run: ${result.workers.join(', ')}`);
|
|
60
|
+
if (result.files.length)
|
|
61
|
+
step(result.directory ? `Files read by their paths next to the executable: ${result.files.join(', ')}` : `Files read by their paths embedded, extracted at the first run: ${result.files.join(', ')}`);
|
|
56
62
|
for (const warning of result.warnings)
|
|
57
63
|
warn(warning);
|
|
58
64
|
if (result.directory)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/cli",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
4
4
|
"description": "The command line tool of the lakutata framework: create the projects from the templates, run and version the packages of the workspaces, bundle the applications and make their executables (with @lakutata/builder).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@inquirer/prompts": "^8.7.2",
|
|
18
18
|
"commander": "^15.0.0",
|
|
19
|
-
"lakutata": "3.0.0-beta.
|
|
19
|
+
"lakutata": "3.0.0-beta.5"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@lakutata/builder": "3.0.0-beta.
|
|
22
|
+
"@lakutata/builder": "3.0.0-beta.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"@lakutata/builder": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@lakutata/builder": "3.0.0-beta.
|
|
30
|
+
"@lakutata/builder": "3.0.0-beta.5"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=22.12"
|