@gjsify/path 0.38.1 → 0.40.0
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/lib/esm/flavour.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/types/flavour.d.ts +13 -0
- package/lib/types/host-flavour.spec.d.ts +2 -0
- package/lib/types/index.d.ts +12 -12
- package/package.json +15 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{posix_exports as e}from"./posix.js";import{win32_exports as t}from"./win32.js";function selectFlavour(n){return n===`win32`?t:e}export{selectFlavour};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{posix_exports as e}from"./posix.js";import{win32_exports as t}from"./win32.js";import{selectFlavour as n}from"./flavour.js";import{hostOs as r}from"@gjsify/utils/core";const i=n(r()),{resolve:a,normalize:o,isAbsolute:s,join:c,relative:l,toNamespacedPath:u,dirname:d,basename:f,extname:p,format:m,parse:h,sep:g,delimiter:_}=i;var v={resolve:i.resolve,normalize:i.normalize,isAbsolute:i.isAbsolute,join:i.join,relative:i.relative,toNamespacedPath:i.toNamespacedPath,dirname:i.dirname,basename:i.basename,extname:i.extname,format:i.format,parse:i.parse,sep:i.sep,delimiter:i.delimiter,posix:e,win32:t};export{f as basename,v as default,_ as delimiter,d as dirname,p as extname,m as format,s as isAbsolute,c as join,o as normalize,h as parse,e as posix,l as relative,a as resolve,g as sep,u as toNamespacedPath,t as win32};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as posix from './posix.js';
|
|
2
|
+
import * as win32 from './win32.js';
|
|
3
|
+
/** The two flavours, by the names Node exposes them under. */
|
|
4
|
+
export type PathFlavour = typeof posix | typeof win32;
|
|
5
|
+
/**
|
|
6
|
+
* The flavour for `os`, which is `hostOs()`'s answer in production.
|
|
7
|
+
*
|
|
8
|
+
* Anything that is not `'win32'` — including `undefined`, which is what a browser
|
|
9
|
+
* answers — gets posix. That default is deliberate rather than incidental: it is both
|
|
10
|
+
* the behaviour this package had before it selected at all, and the right answer for
|
|
11
|
+
* every host that is not Windows.
|
|
12
|
+
*/
|
|
13
|
+
export declare function selectFlavour(os: string | undefined): PathFlavour;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as posix from './posix.js';
|
|
2
2
|
import * as win32 from './win32.js';
|
|
3
3
|
export type { ParsedPath, FormatInputPathObject } from './posix.js';
|
|
4
|
-
export declare const resolve: typeof posix.resolve, normalize: typeof posix.normalize, isAbsolute: typeof posix.isAbsolute, join: typeof posix.join, relative: typeof posix.relative, toNamespacedPath: typeof posix.toNamespacedPath, dirname: typeof posix.dirname, basename: typeof posix.basename, extname: typeof posix.extname, format: typeof posix.format, parse: typeof posix.parse, sep: string, delimiter: string;
|
|
4
|
+
export declare const resolve: typeof posix.resolve | typeof win32.resolve, normalize: typeof posix.normalize | typeof win32.normalize, isAbsolute: typeof win32.isAbsolute | typeof posix.isAbsolute, join: typeof win32.join | typeof posix.join, relative: typeof win32.relative | typeof posix.relative, toNamespacedPath: typeof win32.toNamespacedPath | typeof posix.toNamespacedPath, dirname: typeof win32.dirname | typeof posix.dirname, basename: typeof win32.basename | typeof posix.basename, extname: typeof win32.extname | typeof posix.extname, format: typeof win32.format | typeof posix.format, parse: typeof win32.parse | typeof posix.parse, sep: string, delimiter: string;
|
|
5
5
|
export { posix, win32 };
|
|
6
6
|
declare const _default: {
|
|
7
|
-
resolve: typeof posix.resolve;
|
|
8
|
-
normalize: typeof posix.normalize;
|
|
9
|
-
isAbsolute: typeof posix.isAbsolute;
|
|
10
|
-
join: typeof posix.join;
|
|
11
|
-
relative: typeof posix.relative;
|
|
12
|
-
toNamespacedPath: typeof posix.toNamespacedPath;
|
|
13
|
-
dirname: typeof posix.dirname;
|
|
14
|
-
basename: typeof posix.basename;
|
|
15
|
-
extname: typeof posix.extname;
|
|
16
|
-
format: typeof posix.format;
|
|
17
|
-
parse: typeof posix.parse;
|
|
7
|
+
resolve: typeof posix.resolve | typeof win32.resolve;
|
|
8
|
+
normalize: typeof posix.normalize | typeof win32.normalize;
|
|
9
|
+
isAbsolute: typeof win32.isAbsolute | typeof posix.isAbsolute;
|
|
10
|
+
join: typeof win32.join | typeof posix.join;
|
|
11
|
+
relative: typeof win32.relative | typeof posix.relative;
|
|
12
|
+
toNamespacedPath: typeof win32.toNamespacedPath | typeof posix.toNamespacedPath;
|
|
13
|
+
dirname: typeof win32.dirname | typeof posix.dirname;
|
|
14
|
+
basename: typeof win32.basename | typeof posix.basename;
|
|
15
|
+
extname: typeof win32.extname | typeof posix.extname;
|
|
16
|
+
format: typeof win32.format | typeof posix.format;
|
|
17
|
+
parse: typeof win32.parse | typeof posix.parse;
|
|
18
18
|
sep: string;
|
|
19
19
|
delimiter: string;
|
|
20
20
|
posix: typeof posix;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/path",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Node.js path module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"default": "./lib/esm/win32.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@gjsify/utils": "^0.40.0"
|
|
24
|
+
},
|
|
22
25
|
"files": [
|
|
23
26
|
"lib"
|
|
24
27
|
],
|
|
@@ -42,8 +45,8 @@
|
|
|
42
45
|
"path"
|
|
43
46
|
],
|
|
44
47
|
"devDependencies": {
|
|
45
|
-
"@gjsify/cli": "^0.
|
|
46
|
-
"@gjsify/unit": "^0.
|
|
48
|
+
"@gjsify/cli": "^0.40.0",
|
|
49
|
+
"@gjsify/unit": "^0.40.0",
|
|
47
50
|
"@types/node": "^25.9.2",
|
|
48
51
|
"typescript": "^6.0.3"
|
|
49
52
|
},
|
|
@@ -54,7 +57,15 @@
|
|
|
54
57
|
"browser": "polyfill",
|
|
55
58
|
"nativescript": "polyfill"
|
|
56
59
|
},
|
|
57
|
-
"tier": 1
|
|
60
|
+
"tier": 1,
|
|
61
|
+
"os": {
|
|
62
|
+
"linux": "supported",
|
|
63
|
+
"darwin": "supported",
|
|
64
|
+
"win32": "partial"
|
|
65
|
+
},
|
|
66
|
+
"osNotes": {
|
|
67
|
+
"win32": "The win32 flavour is complete and driven directly by host-flavour.spec.ts from every host (drive letters, UNC, toNamespacedPath, parse/format), so its SEMANTICS are exercised on Linux. What no runner can confirm yet is the SELECTION: `hostOs()` returning \"win32\" picks it, and no GJS-on-Windows host exists to observe that. On a POSIX host \"selected per host\" and \"posix hardcoded\" are indistinguishable at runtime, which is why `selectFlavour(os)` takes the OS as an argument — that half is asserted. Promote to \"supported\" from the first GJS run on Windows."
|
|
68
|
+
}
|
|
58
69
|
},
|
|
59
70
|
"license": "MIT",
|
|
60
71
|
"repository": {
|