Skip to content

Commit

Permalink
v1.0.2 (#41)
Browse files Browse the repository at this point in the history
* ⚡ npm updates + version

* ⚡ finalizing verzion

* 🐛 mistake nohup.out

* 🐛 fixes repl path completition

* ⚡ xdg docs improved

* ⚡ $.pathFromURL
  • Loading branch information
jaandrle authored Sep 5, 2024
1 parent c4c5b92 commit 5028642
Show file tree
Hide file tree
Showing 308 changed files with 25,315 additions and 20,898 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pipe( $.xdg.temp, s.mkdir )("foo bar");
Open ‘▸’ sections for quick overview and/or navigate to link(s) for more detailed
information and documentation.

<!-- #region --><details> <summary><a href="./docs/modules/s.md">s #shelljs</a> namespace <em>(unix shell-like commands in JavaScript)</em></summary>
<!-- #region --><details> <summary><a href="./docs/namespaces/s/README.md">s #shelljs</a> namespace <em>(unix shell-like commands in JavaScript)</em></summary>

```js
s.ls().forEach(echo); // ShellArray
Expand All @@ -41,7 +41,7 @@ and some additional added by nodejsscript. Typically `s.cat`/`s.grep`/…,
to run other than builtin commands use `s.run`/`s.runA`.

These functions returns `ShellArray`/`ShellString`/`Promise<ShellString>`,
these types are union types of `string[]`/`string` with [`ShellReturnValueNJS`](./docs/interfaces/s.ShellReturnValueNJS.md).
these types are union types of `string[]`/`string` with [`ShellReturnValueNJS`](./docs/namespaces/s/interfaces/ShellReturnValueNJS.md).
In simple terms, you can use it as `string[]`/`string`/`Promise<string>` or
read the commad exit `code` and `stdout`/`stderr`. If it makes sence, you can
pipe output to other shelljs commands. Special pipeing is `to`/`toEnd` for
Expand All @@ -53,9 +53,9 @@ s.echo("Hello World!").to("hello.txt");

<!-- #endregion -->
</details>
<!-- #region --><details> <summary><a href="./docs/modules/.md">$</a> (
<a href="./docs/modules/.md#api">$.api() #sade</a>,
<a href="./docs/modules/xdg_.xdg.md">$.xdg</a>,
<!-- #region --><details> <summary><a href="./docs/namespaces/$/README.md">$</a> (
<a href="./docs/namespaces/$/functions/api.md">$.api() #sade</a>,
<a href="./docs/namespaces/xdg/namespaces/xdg/README.md">$.xdg</a>,
)
namespace <em>(nodejsscript/cli related functions/variables)</em></summary>
Expand Down Expand Up @@ -93,11 +93,11 @@ $.api()
(home, temp, config, … directory)
- `$.stdin`: handles standard input when the script is run in shell pipe (can be
helpful for `nodejsscript --eval`/`nodejsscript --print` bellow)
- …for more see [related section in docs](./docs/modules/.md)
- …for more see [related section in docs](./docs/namespaces/$/README.md)

<!-- #endregion -->
</details>
<!-- #region --><details> <summary><a href="./docs/README.md#echo">echo() #css-in-console</a> function/namespace</summary>
<!-- #region --><details> <summary><a href="./docs/functions/echo.md">echo() #css-in-console</a> function/namespace</summary>

```js
const css= echo.css`
Expand All @@ -118,7 +118,7 @@ echo("%cDone", css.success);

<!-- #endregion -->
</details>
<!-- #region --><details> <summary><a href="./docs/README.md#pipe">pipe()</a> function</summary>
<!-- #region --><details> <summary><a href="./docs/functions/pipe.md">pipe()</a> function</summary>

```js
pipe(
Expand Down
2 changes: 1 addition & 1 deletion bin/repl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function startRepl(){ return new Promise(async function(){
const s_= s.$("-vFgs");
if((pwd==="." ? s_.pwd().trim() : pwd)!==ls_tmp.pwd){
ls_tmp.pwd= pwd;
const map= pwd==="." ? l=> `"${l}"` : pwd==="/" ? l=> `"/${l}"` : l=> `"${pwd}/${l}"`;
const map= pwd==="." ? l=> `"./${l}"` : pwd==="/" ? l=> `"/${l}"` : l=> `"${pwd}/${l}"`;
try {
const ls= s_.ls(pwd).filter(l=> l!==pwd);
if(ls.length) ls_tmp.ls= ls.concat("..").map(map);
Expand Down
2 changes: 1 addition & 1 deletion bs/build.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S npx nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global $ */
$.configAssign({ fatal: true });
import "./build:lint.mjs";
import "./build:doc.mjs";
5 changes: 3 additions & 2 deletions bs/build:doc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env -S npx nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch */
$.configAssign({ fatal: true });
if(!s.test("-f", "./package.json")){
const [ curr ]= $;
Expand All @@ -20,6 +20,7 @@ await section("Generating documentation from `*.d.ts`...", () => {
const tds= s.$("-fS").run([
"npx typedoc",
"_index.d.ts",
"--plugin typedoc-plugin-markdown",
"--readme none",
"--defaultCategory 'Internal'",
"--categoryOrder 'Public'",
Expand Down Expand Up @@ -81,7 +82,7 @@ await section("Generating tldr pages...", async ()=> {
),
md=> md.replaceAll("### ", "### s."),
md=> s.echo(md).to(path_tldr)
))
));
// shelljs from nodejsscript
mdFromDts("src/shelljs.d.ts").toEnd(path_tldr);
// dollar
Expand Down
6 changes: 3 additions & 3 deletions bs/build:lint.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env -S npx nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
s.run([
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global s */
const res= s.$().run([
"npx jshint",
"**/*.js",
"*.js", "src/*.js bs/*.mjs",
"--show-non-errors",
].join(" "));
1 change: 0 additions & 1 deletion docs/.nojekyll

This file was deleted.

Loading

0 comments on commit 5028642

Please sign in to comment.