@plylang/plylang 1.0.22 → 1.0.24

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.
Files changed (2) hide show
  1. package/README.md +5 -5
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -339,23 +339,23 @@ A `foreign` word has no body. Its implementation lives in the foreign directory,
339
339
  : foreign length ( (Array a) -- Num )
340
340
  ```
341
341
 
342
- The foreign directory is `foreign` when that directory exists, or the string `ply.foreign` when the field is set. It is required when the package has such a word. It lies inside the package and is distinct from the source directory and the output directory. The generated `.js` imports the implementation from there. Those files are not copied into `dist`. A new package writes `ply.language` and leaves `source`, `foreign`, and `out` unset: those directories are `src`, `foreign`, and `dist`. `ply.entry` names the module a pathless package import opens, and the `exports` key `.`. `plylang compile` writes `script.js` in the output directory: one classic script for a page. It inlines the bindings `main` reaches and calls `main()` at the end. That module is `ply.entry`, and `main` has scheme `( -- Unit )`.
342
+ The foreign directory is `foreign` when that directory exists, or the string `ply.foreign` when the field is set. It is required when the package has such a word. It lies inside the package and is distinct from the source directory and the output directory. The generated `.js` imports the implementation from there. Those files are not copied into `dist`. A new package writes `ply.language` and leaves `source`, `foreign`, and `out` unset: those directories are `src`, `foreign`, and `dist`. `ply.entry` names the module a pathless package import opens, and the `exports` key `.`. `plylang compile` writes one classic script for a page. Without `--out` that file is `script.js` in the output directory. `--entry`, `--out`, and `--foreign` override the entry module, the script path, and the foreign directory for that one run. They are not written back. The entry module's `main` of scheme `( -- Unit )` is the root, and the script calls `main()`. A module with no `main` and at least one place roots the script at those places and does not call `main`. The bindings that root reaches are inlined.
343
343
 
344
344
  ```text
345
345
  plylang check [dir]
346
- plylang build [dir] [--exports]
347
- plylang compile [dir]
346
+ plylang build [dir] [--exports] [--entry <module>] [--out <dir>] [--foreign <dir>]
347
+ plylang compile [dir] [--entry <module>] [--out <file>] [--foreign <dir>]
348
348
  plylang test [pattern]
349
349
  plylang docs [dir] [--out <file>]
350
350
  plylang check --parse <file>
351
351
  plylang check --js <file>
352
352
  ```
353
353
 
354
- `plylang check` checks a package the same way `build` does: every file under the source directory, the imports, and `foreign`. It writes no files and does not walk `test/`. The default directory is the current one. After the same check, `plylang build` writes a `.js` file and a `.d.ply` interface into the output directory, then aligns `exports` with those modules. A key is `./` followed by the module path. When `ply.entry` is set, `.` points at that module too. `ply` points at the `.d.ply`, and `import` points at the `.js`. A key this tool does not own stays, and so does a hand-written `.` when `ply.entry` is absent. `plylang build --exports` does the same alignment. The other fields of the file stay as they were. A module of this package is imported by its path under the source directory, whether or not `exports` lists it. Another package finds the module through the `exports` entry.
354
+ `plylang check` checks a package the same way `build` does: every file under the source directory, the imports, and `foreign`. It writes no files and does not walk `test/`. The default directory is the current one. After the same check, `plylang build` writes a `.js` file and a `.d.ply` interface into the output directory. It does not change `exports`. `plylang build --exports` aligns `exports` with those modules. A key is `./` followed by the module path. When `ply.entry` is set, `.` points at that module too. `--entry` names that module for this run. `--out` names the output directory for this run, and the written keys use that directory. `--foreign` names the foreign directory for this run. None of those three flags is written back into `package.json`. `ply` points at the `.d.ply`, and `import` points at the `.js`. A key this tool does not own stays, and so does a hand-written `.` when `ply.entry` is absent. The other fields of the file stay as they were. A module of this package is imported by its path under the source directory, whether or not `exports` lists it. Another package finds the module through the `exports` entry.
355
355
 
356
356
  `plylang test` builds the package, then compiles and runs the files that match one pattern. The pattern is relative to the package root. The default is `test/**/*.ply`. `*` matches inside one path segment. `**` matches across directories. Quote the pattern so the shell does not expand `*`. A test is a word `( -- Verdict )`. The runner calls each one in source order and uses the word as its name. `expect` compares two values. `pass` and `differ` build a verdict when those values have no `Showable` instance. The words live in `@plylang/test`. A file with no such word may export `suite` with scheme `( -- (Array Verdict) )` instead. A file under `test/` with neither is a utility. A test imports it by its path under `test/`, and a source file cannot. The runner does not run a utility. A source file cannot import a package that is only a `devDependency`. A test can. A file under the source directory stays where `build` wrote it. Any other test file is compiled in that package, written under the output directory for the run, and deleted afterwards. The report names each file and each check. A check also prints `file:line` of its word. A failing check prints its text under the name. One check that throws still lets the other checks run. A file that does not compile or does not run prints the diagnostic, and the other files still run. A failed check, a compile error, or a thrown suite exits 1. No file matched exits 1 with `no tests matched`. Color is used when stdout is a terminal and `NO_COLOR` is unset.
357
357
 
358
- A word named `main` whose scheme is `( -- Unit )` is the program of that module. It may stay off the `@` list. `build` calls it at the bottom of that module's `.js`, and only when Node started that file. `node dist/App.js` runs the program. An import of the module does not. A `package.json` script can name that file. Several modules may each have a `main`. A module without one is a library. Any other scheme on the name `main` is an error. `plylang compile` also writes those modules, then `script.js` beside them. The file is the program of `ply.entry`. A binding is inlined when `main` can call it. The modules themselves still carry the Node guard. `compile` does not rewrite `exports`.
358
+ A word named `main` whose scheme is `( -- Unit )` is the program of that module. It may stay off the `@` list. `build` calls it at the bottom of that module's `.js`, and only when Node started that file. `node dist/App.js` runs the program. An import of the module does not. A `package.json` script can name that file. Several modules may each have a `main`. A module without one is a library. Any other scheme on the name `main` is an error. `plylang compile` also writes those modules, then the page script. `--out` names that file. Otherwise it is `script.js` beside the modules. `--entry` names the module for this run, instead of `ply.entry`. The root is `main` when that module defines `main` of scheme `( -- Unit )`, and the script calls `main()`. A module with no `main` and at least one place roots the script at those places, and the script does not call `main`. A module with neither is an error. A binding is inlined when the root can call it. The modules themselves still carry the Node guard. `compile` does not rewrite `exports`. `--foreign` names the foreign directory for this run. A relative `--out` or `--foreign` stays inside the package.
359
359
 
360
360
  `plylang docs` writes `DOCS.md` at the package root. `--out` names another file. A module heading is the string used to import it: the package name and the path, or only the path when there is no name. The prose comes from `..`. Inside a module the sections are `Types`, `Classes`, `Instances`, and `Words`. An empty section is left out. The name of a type, a class, or a word is a heading under its section. `Instances` is a list of `#` heads, with no comment and no method bindings. A head whose type is defined in another module of this package is listed there too.
361
361
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plylang/plylang",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Ply compiler and language server",
5
5
  "license": "MIT",
6
6
  "author": "Algosail",
@@ -33,12 +33,12 @@
33
33
  "bin/native.js"
34
34
  ],
35
35
  "optionalDependencies": {
36
- "@plylang/plylang-darwin-arm64": "1.0.22",
37
- "@plylang/plylang-darwin-x64": "1.0.22",
38
- "@plylang/plylang-linux-arm64": "1.0.22",
39
- "@plylang/plylang-linux-x64": "1.0.22",
40
- "@plylang/plylang-win32-arm64": "1.0.22",
41
- "@plylang/plylang-win32-x64": "1.0.22"
36
+ "@plylang/plylang-darwin-arm64": "1.0.24",
37
+ "@plylang/plylang-darwin-x64": "1.0.24",
38
+ "@plylang/plylang-linux-arm64": "1.0.24",
39
+ "@plylang/plylang-linux-x64": "1.0.24",
40
+ "@plylang/plylang-win32-arm64": "1.0.24",
41
+ "@plylang/plylang-win32-x64": "1.0.24"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "cargo build --release",