my-gadgetry 1.3.8 → 1.3.9

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 CHANGED
@@ -16,8 +16,11 @@ child: true
16
16
  grandChild: false
17
17
  parallel: false
18
18
  -->
19
+
19
20
  [Dev Ops][md_hopper:my-gadgetry-dev-ops]
21
+
20
22
  <!-- MD_HOPPER: END_LINKS: --><!-- MD_HOPPER: BEGIN_DEFINE_LINKS: -->
23
+
21
24
  [md_hopper:main]: ../../README.md 'MyPackages'
22
25
  [md_hopper:inquirer-plugins]: ../inquirer-plugins/README.md 'inquirer-plugins'
23
26
  [md_hopper:inquirer-plugins-table]: ../inquirer-plugins/src/lib/_internal/plugins/table/README.md 'TABLE PLUGIN'
@@ -26,4 +29,5 @@ parallel: false
26
29
  [md_hopper:my-gadgetry-dev-ops]: ./src/lib/_internal/dev-ops/README.md 'Dev Ops'
27
30
  [md_hopper:test]: ../test/README.md 'test'
28
31
  [md_hopper:plugins-builder]: ../../plugins/builder/README.md 'builder'
32
+
29
33
  <!-- MD_HOPPER: END_DEFINE_LINKS: -->
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/__fs-test__/foo/piyo/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=piyo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piyo.d.ts","sourceRoot":"","sources":["../../../src/__fs-test__/foo/piyo.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=foo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foo.d.ts","sourceRoot":"","sources":["../../src/__fs-test__/foo.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/__fs-test__/hoge/foo/piyo/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=piyo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piyo.d.ts","sourceRoot":"","sources":["../../../../src/__fs-test__/hoge/foo/piyo.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=foo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foo.d.ts","sourceRoot":"","sources":["../../../src/__fs-test__/hoge/foo.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=hoge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hoge.d.ts","sourceRoot":"","sources":["../../src/__fs-test__/hoge.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
@@ -16,4 +16,5 @@ export interface Stacks {
16
16
  export declare const getDepth: (path: string) => number;
17
17
  export declare const isShallow: (from: string, to: string, depth: number) => boolean;
18
18
  export declare const getAllFiles: (startDir: string, _options?: Options) => string[];
19
+ export declare const readJsonFileSync: (path: string, encode?: BufferEncoding) => any;
19
20
  //# sourceMappingURL=fs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/lib/_core/fs.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,OAAO;;;;CAInB,CAAA;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAMD,eAAO,MAAM,QAAQ,SAAU,MAAM,WAgBpC,CAAA;AAED,eAAO,MAAM,SAAS,SAAU,MAAM,MAAM,MAAM,SAAS,MAAM,YAEhE,CAAA;AAwBD,eAAO,MAAM,WAAW,aAAc,MAAM,aAAa,OAAO,aAK/D,CAAA"}
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/lib/_core/fs.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,OAAO;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,OAAO;;;;CAInB,CAAA;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAMD,eAAO,MAAM,QAAQ,SAAU,MAAM,WAgBpC,CAAA;AAED,eAAO,MAAM,SAAS,SAAU,MAAM,MAAM,MAAM,SAAS,MAAM,YAEhE,CAAA;AAwBD,eAAO,MAAM,WAAW,aAAc,MAAM,aAAa,OAAO,aAK/D,CAAA;AAED,eAAO,MAAM,gBAAgB,SAAU,MAAM,WAAU,cAAc,QAMpE,CAAA"}
@@ -1,6 +1,7 @@
1
- import { statSync, readdirSync } from 'fs';
1
+ import { statSync, readdirSync, readFileSync } from 'fs';
2
2
  import { relative } from 'path';
3
3
  import { minimatch } from 'minimatch';
4
+ import { isJson } from './type-check.js';
4
5
  export const OPTIONS = {
5
6
  include: [],
6
7
  exclude: [],
@@ -57,3 +58,10 @@ export const getAllFiles = (startDir, _options) => {
57
58
  }
58
59
  return _getAllFiles(startDir, { ...OPTIONS, ...(_options || {}), startDir });
59
60
  };
61
+ export const readJsonFileSync = (path, encode = 'utf-8') => {
62
+ const json = readFileSync(path, encode);
63
+ if (!isJson(json)) {
64
+ return {};
65
+ }
66
+ return JSON.parse(json);
67
+ };
@@ -0,0 +1,2 @@
1
+ export declare const getDirnameFromFileURL: (url: string) => string;
2
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/lib/_internal/path.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,QAAS,MAAM,WAAgC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { dirname } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ export const getDirnameFromFileURL = (url) => dirname(fileURLToPath(url));
@@ -0,0 +1,2 @@
1
+ export * from '../_internal/path.js';
2
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/lib/modules/path.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from '../_internal/path.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-gadgetry",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "./converters/string": "./dist/lib/modules/converters/string.js",
29
29
  "./dev-ops/package-generator/generate-alias": "./dist/lib/modules/dev-ops/package-generator/generate-alias.js",
30
30
  "./fs": "./dist/lib/modules/fs.js",
31
+ "./path": "./dist/lib/modules/path.js",
31
32
  "./type-check": "./dist/lib/modules/type-check.js",
32
33
  "./types/utilities": "./dist/lib/modules/types/utilities.js"
33
34
  },
@@ -37,6 +38,7 @@
37
38
  "converters",
38
39
  "dev-ops",
39
40
  "fs",
41
+ "path",
40
42
  "type-check",
41
43
  "!**/*.tsbuildinfo"
42
44
  ],
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@cilly/my-gadgetry-modules-path",
3
+ "types": "../dist/lib/modules/path.d.ts",
4
+ "main": "../dist/lib/modules/path.js",
5
+ "sideEffects": false
6
+ }