@stryke/fs 0.33.78 → 0.33.80

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 (204) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/_virtual/_rolldown/runtime.cjs +14 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  4. package/dist/buffer.cjs +12 -0
  5. package/dist/buffer.mjs +8 -1
  6. package/dist/buffer.mjs.map +1 -1
  7. package/dist/buffer.test.cjs +13 -0
  8. package/dist/buffer.test.d.cts +1 -0
  9. package/dist/buffer.test.d.mts +1 -0
  10. package/dist/buffer.test.mjs +14 -0
  11. package/dist/buffer.test.mjs.map +1 -0
  12. package/dist/chmod-x.cjs +14 -0
  13. package/dist/chmod-x.mjs +10 -1
  14. package/dist/chmod-x.mjs.map +1 -1
  15. package/dist/chmod-x.test.cjs +13 -0
  16. package/dist/chmod-x.test.d.cts +1 -0
  17. package/dist/chmod-x.test.d.mts +1 -0
  18. package/dist/chmod-x.test.mjs +14 -0
  19. package/dist/chmod-x.test.mjs.map +1 -0
  20. package/dist/command-exists.cjs +11 -1
  21. package/dist/command-exists.mjs +6 -1
  22. package/dist/command-exists.mjs.map +1 -1
  23. package/dist/command-exists.test.cjs +13 -0
  24. package/dist/command-exists.test.d.cts +1 -0
  25. package/dist/command-exists.test.d.mts +1 -0
  26. package/dist/command-exists.test.mjs +14 -0
  27. package/dist/command-exists.test.mjs.map +1 -0
  28. package/dist/compress.cjs +8 -1
  29. package/dist/compress.mjs +3 -1
  30. package/dist/compress.mjs.map +1 -1
  31. package/dist/compress.test.cjs +13 -0
  32. package/dist/compress.test.d.cts +1 -0
  33. package/dist/compress.test.d.mts +1 -0
  34. package/dist/compress.test.mjs +14 -0
  35. package/dist/compress.test.mjs.map +1 -0
  36. package/dist/constants.cjs +13 -0
  37. package/dist/constants.mjs +8 -1
  38. package/dist/constants.mjs.map +1 -0
  39. package/dist/constants.test.cjs +13 -0
  40. package/dist/constants.test.d.cts +1 -0
  41. package/dist/constants.test.d.mts +1 -0
  42. package/dist/constants.test.mjs +14 -0
  43. package/dist/constants.test.mjs.map +1 -0
  44. package/dist/copy-file.cjs +13 -1
  45. package/dist/copy-file.mjs +8 -1
  46. package/dist/copy-file.mjs.map +1 -1
  47. package/dist/copy-file.test.cjs +13 -0
  48. package/dist/copy-file.test.d.cts +1 -0
  49. package/dist/copy-file.test.d.mts +1 -0
  50. package/dist/copy-file.test.mjs +14 -0
  51. package/dist/copy-file.test.mjs.map +1 -0
  52. package/dist/exists.cjs +11 -1
  53. package/dist/exists.mjs +6 -1
  54. package/dist/exists.mjs.map +1 -1
  55. package/dist/exists.test.cjs +13 -0
  56. package/dist/exists.test.d.cts +1 -0
  57. package/dist/exists.test.d.mts +1 -0
  58. package/dist/exists.test.mjs +14 -0
  59. package/dist/exists.test.mjs.map +1 -0
  60. package/dist/get-parent-path.cjs +8 -1
  61. package/dist/get-parent-path.mjs +3 -1
  62. package/dist/get-parent-path.mjs.map +1 -1
  63. package/dist/get-parent-path.test.cjs +13 -0
  64. package/dist/get-parent-path.test.d.cts +1 -0
  65. package/dist/get-parent-path.test.d.mts +1 -0
  66. package/dist/get-parent-path.test.mjs +14 -0
  67. package/dist/get-parent-path.test.mjs.map +1 -0
  68. package/dist/get-workspace-root.cjs +16 -0
  69. package/dist/get-workspace-root.mjs +12 -1
  70. package/dist/get-workspace-root.mjs.map +1 -1
  71. package/dist/get-workspace-root.test.cjs +13 -0
  72. package/dist/get-workspace-root.test.d.cts +1 -0
  73. package/dist/get-workspace-root.test.d.mts +1 -0
  74. package/dist/get-workspace-root.test.mjs +14 -0
  75. package/dist/get-workspace-root.test.mjs.map +1 -0
  76. package/dist/helpers.cjs +14 -0
  77. package/dist/helpers.mjs +10 -1
  78. package/dist/helpers.mjs.map +1 -1
  79. package/dist/helpers.test.cjs +13 -0
  80. package/dist/helpers.test.d.cts +1 -0
  81. package/dist/helpers.test.d.mts +1 -0
  82. package/dist/helpers.test.mjs +14 -0
  83. package/dist/helpers.test.mjs.map +1 -0
  84. package/dist/index.cjs +111 -0
  85. package/dist/index.mjs +107 -1
  86. package/dist/index.mjs.map +1 -0
  87. package/dist/index.test.cjs +13 -0
  88. package/dist/index.test.d.cts +1 -0
  89. package/dist/index.test.d.mts +1 -0
  90. package/dist/index.test.mjs +14 -0
  91. package/dist/index.test.mjs.map +1 -0
  92. package/dist/install.cjs +10 -0
  93. package/dist/install.mjs +6 -1
  94. package/dist/install.mjs.map +1 -1
  95. package/dist/install.test.cjs +13 -0
  96. package/dist/install.test.d.cts +1 -0
  97. package/dist/install.test.d.mts +1 -0
  98. package/dist/install.test.mjs +14 -0
  99. package/dist/install.test.mjs.map +1 -0
  100. package/dist/is-file.cjs +13 -1
  101. package/dist/is-file.mjs +8 -1
  102. package/dist/is-file.mjs.map +1 -1
  103. package/dist/is-file.test.cjs +13 -0
  104. package/dist/is-file.test.d.cts +1 -0
  105. package/dist/is-file.test.d.mts +1 -0
  106. package/dist/is-file.test.mjs +14 -0
  107. package/dist/is-file.test.mjs.map +1 -0
  108. package/dist/json.cjs +12 -0
  109. package/dist/json.mjs +8 -1
  110. package/dist/json.mjs.map +1 -1
  111. package/dist/json.test.cjs +13 -0
  112. package/dist/json.test.d.cts +1 -0
  113. package/dist/json.test.d.mts +1 -0
  114. package/dist/json.test.mjs +14 -0
  115. package/dist/json.test.mjs.map +1 -0
  116. package/dist/list-files.cjs +15 -1
  117. package/dist/list-files.mjs +10 -1
  118. package/dist/list-files.mjs.map +1 -1
  119. package/dist/list-files.test.cjs +13 -0
  120. package/dist/list-files.test.d.cts +1 -0
  121. package/dist/list-files.test.d.mts +1 -0
  122. package/dist/list-files.test.mjs +14 -0
  123. package/dist/list-files.test.mjs.map +1 -0
  124. package/dist/package-fns.cjs +16 -1
  125. package/dist/package-fns.mjs +11 -1
  126. package/dist/package-fns.mjs.map +1 -1
  127. package/dist/package-fns.test.cjs +13 -0
  128. package/dist/package-fns.test.d.cts +1 -0
  129. package/dist/package-fns.test.d.mts +1 -0
  130. package/dist/package-fns.test.mjs +14 -0
  131. package/dist/package-fns.test.mjs.map +1 -0
  132. package/dist/read-file.cjs +13 -1
  133. package/dist/read-file.mjs +8 -1
  134. package/dist/read-file.mjs.map +1 -1
  135. package/dist/read-file.test.cjs +13 -0
  136. package/dist/read-file.test.d.cts +1 -0
  137. package/dist/read-file.test.d.mts +1 -0
  138. package/dist/read-file.test.mjs +14 -0
  139. package/dist/read-file.test.mjs.map +1 -0
  140. package/dist/registry.cjs +13 -0
  141. package/dist/registry.mjs +9 -1
  142. package/dist/registry.mjs.map +1 -1
  143. package/dist/registry.test.cjs +13 -0
  144. package/dist/registry.test.d.cts +1 -0
  145. package/dist/registry.test.d.mts +1 -0
  146. package/dist/registry.test.mjs +14 -0
  147. package/dist/registry.test.mjs.map +1 -0
  148. package/dist/remove-file.cjs +11 -1
  149. package/dist/remove-file.mjs +6 -1
  150. package/dist/remove-file.mjs.map +1 -1
  151. package/dist/remove-file.test.cjs +13 -0
  152. package/dist/remove-file.test.d.cts +1 -0
  153. package/dist/remove-file.test.d.mts +1 -0
  154. package/dist/remove-file.test.mjs +14 -0
  155. package/dist/remove-file.test.mjs.map +1 -0
  156. package/dist/resolve.cjs +20 -1
  157. package/dist/resolve.mjs +15 -1
  158. package/dist/resolve.mjs.map +1 -1
  159. package/dist/resolve.test.cjs +13 -0
  160. package/dist/resolve.test.d.cts +1 -0
  161. package/dist/resolve.test.d.mts +1 -0
  162. package/dist/resolve.test.mjs +14 -0
  163. package/dist/resolve.test.mjs.map +1 -0
  164. package/dist/semver-fns.cjs +20 -1
  165. package/dist/semver-fns.mjs +15 -1
  166. package/dist/semver-fns.mjs.map +1 -1
  167. package/dist/semver-fns.test.cjs +13 -0
  168. package/dist/semver-fns.test.d.cts +1 -0
  169. package/dist/semver-fns.test.d.mts +1 -0
  170. package/dist/semver-fns.test.mjs +14 -0
  171. package/dist/semver-fns.test.mjs.map +1 -0
  172. package/dist/toml.cjs +12 -0
  173. package/dist/toml.mjs +8 -1
  174. package/dist/toml.mjs.map +1 -1
  175. package/dist/toml.test.cjs +13 -0
  176. package/dist/toml.test.d.cts +1 -0
  177. package/dist/toml.test.d.mts +1 -0
  178. package/dist/toml.test.mjs +14 -0
  179. package/dist/toml.test.mjs.map +1 -0
  180. package/dist/tsconfig.cjs +8 -1
  181. package/dist/tsconfig.mjs +3 -1
  182. package/dist/tsconfig.mjs.map +1 -1
  183. package/dist/tsconfig.test.cjs +13 -0
  184. package/dist/tsconfig.test.d.cts +1 -0
  185. package/dist/tsconfig.test.d.mts +1 -0
  186. package/dist/tsconfig.test.mjs +14 -0
  187. package/dist/tsconfig.test.mjs.map +1 -0
  188. package/dist/write-file.cjs +11 -1
  189. package/dist/write-file.mjs +6 -1
  190. package/dist/write-file.mjs.map +1 -1
  191. package/dist/write-file.test.cjs +13 -0
  192. package/dist/write-file.test.d.cts +1 -0
  193. package/dist/write-file.test.d.mts +1 -0
  194. package/dist/write-file.test.mjs +14 -0
  195. package/dist/write-file.test.mjs.map +1 -0
  196. package/dist/yaml.cjs +11 -1
  197. package/dist/yaml.mjs +6 -1
  198. package/dist/yaml.mjs.map +1 -1
  199. package/dist/yaml.test.cjs +13 -0
  200. package/dist/yaml.test.d.cts +1 -0
  201. package/dist/yaml.test.d.mts +1 -0
  202. package/dist/yaml.test.mjs +14 -0
  203. package/dist/yaml.test.mjs.map +1 -0
  204. package/package.json +110 -10
package/dist/index.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_exists = require('./exists.cjs');
3
4
  const require_helpers = require('./helpers.cjs');
4
5
  const require_buffer = require('./buffer.cjs');
@@ -23,6 +24,110 @@ const require_toml = require('./toml.cjs');
23
24
  const require_tsconfig = require('./tsconfig.cjs');
24
25
  const require_yaml = require('./yaml.cjs');
25
26
 
27
+ //#region src/index.ts
28
+ var src_exports = /* @__PURE__ */ require_runtime.__exportAll({
29
+ DEFAULT_EXTENSIONS: () => require_resolve.DEFAULT_EXTENSIONS,
30
+ PROJECT_ROOT_CONTENT: () => require_get_workspace_root.PROJECT_ROOT_CONTENT,
31
+ RELEASE_TYPES: () => require_semver_fns.RELEASE_TYPES,
32
+ WORKSPACE_ROOT_CONTENT: () => require_get_workspace_root.WORKSPACE_ROOT_CONTENT,
33
+ chmodX: () => require_chmod_x.chmodX,
34
+ chmodXSync: () => require_chmod_x.chmodXSync,
35
+ coerceVersion: () => require_semver_fns.coerceVersion,
36
+ commandExists: () => require_command_exists.commandExists,
37
+ commandExistsSync: () => require_command_exists.commandExistsSync,
38
+ compressDirectory: () => require_compress.compressDirectory,
39
+ copyFile: () => require_copy_file.copyFile,
40
+ copyFileSync: () => require_copy_file.copyFileSync,
41
+ copyFiles: () => require_copy_file.copyFiles,
42
+ copyFilesSync: () => require_copy_file.copyFilesSync,
43
+ createDirectory: () => require_helpers.createDirectory,
44
+ createDirectorySync: () => require_helpers.createDirectorySync,
45
+ deriveNewSemverVersion: () => require_semver_fns.deriveNewSemverVersion,
46
+ doesPackageMatch: () => require_package_fns.doesPackageMatch,
47
+ exists: () => require_exists.exists,
48
+ existsSync: () => require_exists.existsSync,
49
+ extractFileFromTar: () => require_helpers.extractFileFromTar,
50
+ extractFileFromTarGzip: () => require_helpers.extractFileFromTarGzip,
51
+ formatNodeOptions: () => require_registry.formatNodeOptions,
52
+ getFormattedNodeOptionsWithoutInspect: () => require_registry.getFormattedNodeOptionsWithoutInspect,
53
+ getNodeModulesPaths: () => require_resolve.getNodeModulesPaths,
54
+ getPackageInfo: () => require_package_fns.getPackageInfo,
55
+ getPackageListing: () => require_package_fns.getPackageListing,
56
+ getPackageManager: () => require_package_fns.getPackageManager,
57
+ getParentPath: () => require_get_parent_path.getParentPath,
58
+ getParsedNodeOptionsWithoutInspect: () => require_registry.getParsedNodeOptionsWithoutInspect,
59
+ getProjectRoot: () => require_get_workspace_root.getProjectRoot,
60
+ getRegistry: () => require_registry.getRegistry,
61
+ getResolutionCombinations: () => require_resolve.getResolutionCombinations,
62
+ getResolutionPaths: () => require_resolve.getResolutionPaths,
63
+ getWorkspaceRoot: () => require_get_workspace_root.getWorkspaceRoot,
64
+ importModule: () => require_resolve.importModule,
65
+ install: () => require_install.install,
66
+ isDirectory: () => require_is_file.isDirectory,
67
+ isDirectorySymlink: () => require_is_file.isDirectorySymlink,
68
+ isExecutable: () => require_chmod_x.isExecutable,
69
+ isExecutableSync: () => require_chmod_x.isExecutableSync,
70
+ isFile: () => require_is_file.isFile,
71
+ isFileSymlink: () => require_is_file.isFileSymlink,
72
+ isPackageExists: () => require_package_fns.isPackageExists,
73
+ isPackageListed: () => require_package_fns.isPackageListed,
74
+ isProjectRoot: () => require_get_workspace_root.isProjectRoot,
75
+ isRange: () => require_semver_fns.isRange,
76
+ isRelativeVersionKeyword: () => require_semver_fns.isRelativeVersionKeyword,
77
+ isSemver: () => require_semver_fns.isSemver,
78
+ isValidRange: () => require_semver_fns.isValidRange,
79
+ isValidSemver: () => require_semver_fns.isValidSemver,
80
+ isValidVersion: () => require_semver_fns.isValidVersion,
81
+ isWorkspaceRoot: () => require_get_workspace_root.isWorkspaceRoot,
82
+ isWritable: () => require_chmod_x.isWritable,
83
+ isWritableSync: () => require_chmod_x.isWritableSync,
84
+ list: () => require_list_files.list,
85
+ listDirectories: () => require_list_files.listDirectories,
86
+ listDirectoriesSync: () => require_list_files.listDirectoriesSync,
87
+ listFiles: () => require_list_files.listFiles,
88
+ listFilesSync: () => require_list_files.listFilesSync,
89
+ listSync: () => require_list_files.listSync,
90
+ loadPackageJson: () => require_package_fns.loadPackageJson,
91
+ loadTsConfig: () => require_tsconfig.loadTsConfig,
92
+ packageExists: () => require_install.packageExists,
93
+ parseVersion: () => require_semver_fns.parseVersion,
94
+ readFile: () => require_read_file.readFile,
95
+ readFileBuffer: () => require_buffer.readFileBuffer,
96
+ readFileBufferSync: () => require_buffer.readFileBufferSync,
97
+ readFileIfExisting: () => require_read_file.readFileIfExisting,
98
+ readFileIfExistingSync: () => require_read_file.readFileIfExistingSync,
99
+ readFileSync: () => require_read_file.readFileSync,
100
+ readJsonFile: () => require_json.readJsonFile,
101
+ readJsonFileSync: () => require_json.readJsonFileSync,
102
+ readTomlFile: () => require_toml.readTomlFile,
103
+ readTomlFileSync: () => require_toml.readTomlFileSync,
104
+ readYamlFile: () => require_yaml.readYamlFile,
105
+ readYamlFileSync: () => require_yaml.readYamlFileSync,
106
+ relativeToProjectRoot: () => require_get_workspace_root.relativeToProjectRoot,
107
+ relativeToWorkspaceRoot: () => require_get_workspace_root.relativeToWorkspaceRoot,
108
+ removeDirectory: () => require_helpers.removeDirectory,
109
+ removeDirectorySync: () => require_helpers.removeDirectorySync,
110
+ removeFile: () => require_remove_file.removeFile,
111
+ removeFileSync: () => require_remove_file.removeFileSync,
112
+ resolve: () => require_resolve.resolve,
113
+ resolvePackage: () => require_resolve.resolvePackage,
114
+ resolvePackageSync: () => require_resolve.resolvePackageSync,
115
+ resolveSafe: () => require_resolve.resolveSafe,
116
+ resolveSafeSync: () => require_resolve.resolveSafeSync,
117
+ resolveSync: () => require_resolve.resolveSync,
118
+ satisfiesVersion: () => require_semver_fns.satisfiesVersion,
119
+ tokenizeArgs: () => require_registry.tokenizeArgs,
120
+ writeFile: () => require_write_file.writeFile,
121
+ writeFileBuffer: () => require_buffer.writeFileBuffer,
122
+ writeFileBufferSync: () => require_buffer.writeFileBufferSync,
123
+ writeFileSync: () => require_write_file.writeFileSync,
124
+ writeJsonFile: () => require_json.writeJsonFile,
125
+ writeJsonFileSync: () => require_json.writeJsonFileSync,
126
+ writeTomlFile: () => require_toml.writeTomlFile,
127
+ writeTomlFileSync: () => require_toml.writeTomlFileSync
128
+ });
129
+
130
+ //#endregion
26
131
  exports.DEFAULT_EXTENSIONS = require_resolve.DEFAULT_EXTENSIONS;
27
132
  exports.PROJECT_ROOT_CONTENT = require_get_workspace_root.PROJECT_ROOT_CONTENT;
28
133
  exports.RELEASE_TYPES = require_semver_fns.RELEASE_TYPES;
@@ -113,6 +218,12 @@ exports.resolveSafe = require_resolve.resolveSafe;
113
218
  exports.resolveSafeSync = require_resolve.resolveSafeSync;
114
219
  exports.resolveSync = require_resolve.resolveSync;
115
220
  exports.satisfiesVersion = require_semver_fns.satisfiesVersion;
221
+ Object.defineProperty(exports, 'src_exports', {
222
+ enumerable: true,
223
+ get: function () {
224
+ return src_exports;
225
+ }
226
+ });
116
227
  exports.tokenizeArgs = require_registry.tokenizeArgs;
117
228
  exports.writeFile = require_write_file.writeFile;
118
229
  exports.writeFileBuffer = require_buffer.writeFileBuffer;
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { exists, existsSync } from "./exists.mjs";
2
3
  import { createDirectory, createDirectorySync, extractFileFromTar, extractFileFromTarGzip, removeDirectory, removeDirectorySync } from "./helpers.mjs";
3
4
  import { readFileBuffer, readFileBufferSync, writeFileBuffer, writeFileBufferSync } from "./buffer.mjs";
@@ -22,4 +23,109 @@ import { readTomlFile, readTomlFileSync, writeTomlFile, writeTomlFileSync } from
22
23
  import { loadTsConfig } from "./tsconfig.mjs";
23
24
  import { readYamlFile, readYamlFileSync } from "./yaml.mjs";
24
25
 
25
- export { DEFAULT_EXTENSIONS, PROJECT_ROOT_CONTENT, RELEASE_TYPES, WORKSPACE_ROOT_CONTENT, chmodX, chmodXSync, coerceVersion, commandExists, commandExistsSync, compressDirectory, copyFile, copyFileSync, copyFiles, copyFilesSync, createDirectory, createDirectorySync, deriveNewSemverVersion, doesPackageMatch, exists, existsSync, extractFileFromTar, extractFileFromTarGzip, formatNodeOptions, getFormattedNodeOptionsWithoutInspect, getNodeModulesPaths, getPackageInfo, getPackageListing, getPackageManager, getParentPath, getParsedNodeOptionsWithoutInspect, getProjectRoot, getRegistry, getResolutionCombinations, getResolutionPaths, getWorkspaceRoot, importModule, install, isDirectory, isDirectorySymlink, isExecutable, isExecutableSync, isFile, isFileSymlink, isPackageExists, isPackageListed, isProjectRoot, isRange, isRelativeVersionKeyword, isSemver, isValidRange, isValidSemver, isValidVersion, isWorkspaceRoot, isWritable, isWritableSync, list, listDirectories, listDirectoriesSync, listFiles, listFilesSync, listSync, loadPackageJson, loadTsConfig, packageExists, parseVersion, readFile, readFileBuffer, readFileBufferSync, readFileIfExisting, readFileIfExistingSync, readFileSync, readJsonFile, readJsonFileSync, readTomlFile, readTomlFileSync, readYamlFile, readYamlFileSync, relativeToProjectRoot, relativeToWorkspaceRoot, removeDirectory, removeDirectorySync, removeFile, removeFileSync, resolve, resolvePackage, resolvePackageSync, resolveSafe, resolveSafeSync, resolveSync, satisfiesVersion, tokenizeArgs, writeFile, writeFileBuffer, writeFileBufferSync, writeFileSync, writeJsonFile, writeJsonFileSync, writeTomlFile, writeTomlFileSync };
26
+ //#region src/index.ts
27
+ var src_exports = /* @__PURE__ */ __exportAll({
28
+ DEFAULT_EXTENSIONS: () => DEFAULT_EXTENSIONS,
29
+ PROJECT_ROOT_CONTENT: () => PROJECT_ROOT_CONTENT,
30
+ RELEASE_TYPES: () => RELEASE_TYPES,
31
+ WORKSPACE_ROOT_CONTENT: () => WORKSPACE_ROOT_CONTENT,
32
+ chmodX: () => chmodX,
33
+ chmodXSync: () => chmodXSync,
34
+ coerceVersion: () => coerceVersion,
35
+ commandExists: () => commandExists,
36
+ commandExistsSync: () => commandExistsSync,
37
+ compressDirectory: () => compressDirectory,
38
+ copyFile: () => copyFile,
39
+ copyFileSync: () => copyFileSync,
40
+ copyFiles: () => copyFiles,
41
+ copyFilesSync: () => copyFilesSync,
42
+ createDirectory: () => createDirectory,
43
+ createDirectorySync: () => createDirectorySync,
44
+ deriveNewSemverVersion: () => deriveNewSemverVersion,
45
+ doesPackageMatch: () => doesPackageMatch,
46
+ exists: () => exists,
47
+ existsSync: () => existsSync,
48
+ extractFileFromTar: () => extractFileFromTar,
49
+ extractFileFromTarGzip: () => extractFileFromTarGzip,
50
+ formatNodeOptions: () => formatNodeOptions,
51
+ getFormattedNodeOptionsWithoutInspect: () => getFormattedNodeOptionsWithoutInspect,
52
+ getNodeModulesPaths: () => getNodeModulesPaths,
53
+ getPackageInfo: () => getPackageInfo,
54
+ getPackageListing: () => getPackageListing,
55
+ getPackageManager: () => getPackageManager,
56
+ getParentPath: () => getParentPath,
57
+ getParsedNodeOptionsWithoutInspect: () => getParsedNodeOptionsWithoutInspect,
58
+ getProjectRoot: () => getProjectRoot,
59
+ getRegistry: () => getRegistry,
60
+ getResolutionCombinations: () => getResolutionCombinations,
61
+ getResolutionPaths: () => getResolutionPaths,
62
+ getWorkspaceRoot: () => getWorkspaceRoot,
63
+ importModule: () => importModule,
64
+ install: () => install,
65
+ isDirectory: () => isDirectory,
66
+ isDirectorySymlink: () => isDirectorySymlink,
67
+ isExecutable: () => isExecutable,
68
+ isExecutableSync: () => isExecutableSync,
69
+ isFile: () => isFile,
70
+ isFileSymlink: () => isFileSymlink,
71
+ isPackageExists: () => isPackageExists,
72
+ isPackageListed: () => isPackageListed,
73
+ isProjectRoot: () => isProjectRoot,
74
+ isRange: () => isRange,
75
+ isRelativeVersionKeyword: () => isRelativeVersionKeyword,
76
+ isSemver: () => isSemver,
77
+ isValidRange: () => isValidRange,
78
+ isValidSemver: () => isValidSemver,
79
+ isValidVersion: () => isValidVersion,
80
+ isWorkspaceRoot: () => isWorkspaceRoot,
81
+ isWritable: () => isWritable,
82
+ isWritableSync: () => isWritableSync,
83
+ list: () => list,
84
+ listDirectories: () => listDirectories,
85
+ listDirectoriesSync: () => listDirectoriesSync,
86
+ listFiles: () => listFiles,
87
+ listFilesSync: () => listFilesSync,
88
+ listSync: () => listSync,
89
+ loadPackageJson: () => loadPackageJson,
90
+ loadTsConfig: () => loadTsConfig,
91
+ packageExists: () => packageExists,
92
+ parseVersion: () => parseVersion,
93
+ readFile: () => readFile,
94
+ readFileBuffer: () => readFileBuffer,
95
+ readFileBufferSync: () => readFileBufferSync,
96
+ readFileIfExisting: () => readFileIfExisting,
97
+ readFileIfExistingSync: () => readFileIfExistingSync,
98
+ readFileSync: () => readFileSync,
99
+ readJsonFile: () => readJsonFile,
100
+ readJsonFileSync: () => readJsonFileSync,
101
+ readTomlFile: () => readTomlFile,
102
+ readTomlFileSync: () => readTomlFileSync,
103
+ readYamlFile: () => readYamlFile,
104
+ readYamlFileSync: () => readYamlFileSync,
105
+ relativeToProjectRoot: () => relativeToProjectRoot,
106
+ relativeToWorkspaceRoot: () => relativeToWorkspaceRoot,
107
+ removeDirectory: () => removeDirectory,
108
+ removeDirectorySync: () => removeDirectorySync,
109
+ removeFile: () => removeFile,
110
+ removeFileSync: () => removeFileSync,
111
+ resolve: () => resolve,
112
+ resolvePackage: () => resolvePackage,
113
+ resolvePackageSync: () => resolvePackageSync,
114
+ resolveSafe: () => resolveSafe,
115
+ resolveSafeSync: () => resolveSafeSync,
116
+ resolveSync: () => resolveSync,
117
+ satisfiesVersion: () => satisfiesVersion,
118
+ tokenizeArgs: () => tokenizeArgs,
119
+ writeFile: () => writeFile,
120
+ writeFileBuffer: () => writeFileBuffer,
121
+ writeFileBufferSync: () => writeFileBufferSync,
122
+ writeFileSync: () => writeFileSync,
123
+ writeJsonFile: () => writeJsonFile,
124
+ writeJsonFileSync: () => writeJsonFileSync,
125
+ writeTomlFile: () => writeTomlFile,
126
+ writeTomlFileSync: () => writeTomlFileSync
127
+ });
128
+
129
+ //#endregion
130
+ export { DEFAULT_EXTENSIONS, PROJECT_ROOT_CONTENT, RELEASE_TYPES, WORKSPACE_ROOT_CONTENT, chmodX, chmodXSync, coerceVersion, commandExists, commandExistsSync, compressDirectory, copyFile, copyFileSync, copyFiles, copyFilesSync, createDirectory, createDirectorySync, deriveNewSemverVersion, doesPackageMatch, exists, existsSync, extractFileFromTar, extractFileFromTarGzip, formatNodeOptions, getFormattedNodeOptionsWithoutInspect, getNodeModulesPaths, getPackageInfo, getPackageListing, getPackageManager, getParentPath, getParsedNodeOptionsWithoutInspect, getProjectRoot, getRegistry, getResolutionCombinations, getResolutionPaths, getWorkspaceRoot, importModule, install, isDirectory, isDirectorySymlink, isExecutable, isExecutableSync, isFile, isFileSymlink, isPackageExists, isPackageListed, isProjectRoot, isRange, isRelativeVersionKeyword, isSemver, isValidRange, isValidSemver, isValidVersion, isWorkspaceRoot, isWritable, isWritableSync, list, listDirectories, listDirectoriesSync, listFiles, listFilesSync, listSync, loadPackageJson, loadTsConfig, packageExists, parseVersion, readFile, readFileBuffer, readFileBufferSync, readFileIfExisting, readFileIfExistingSync, readFileSync, readJsonFile, readJsonFileSync, readTomlFile, readTomlFileSync, readYamlFile, readYamlFileSync, relativeToProjectRoot, relativeToWorkspaceRoot, removeDirectory, removeDirectorySync, removeFile, removeFileSync, resolve, resolvePackage, resolvePackageSync, resolveSafe, resolveSafeSync, resolveSync, satisfiesVersion, src_exports, tokenizeArgs, writeFile, writeFileBuffer, writeFileBufferSync, writeFileSync, writeJsonFile, writeJsonFileSync, writeTomlFile, writeTomlFileSync };
131
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * The fs library used by Storm Software for building NodeJS applications.\n *\n * @remarks\n * A package containing various file system utilities that expand the functionality of NodeJs's `fs` module\n *\n * @packageDocumentation\n */\n\nexport * from \"./buffer\";\nexport * from \"./chmod-x\";\nexport * from \"./command-exists\";\nexport * from \"./compress\";\nexport * from \"./constants\";\nexport * from \"./copy-file\";\nexport * from \"./exists\";\nexport * from \"./get-parent-path\";\nexport * from \"./get-workspace-root\";\nexport * from \"./helpers\";\nexport * from \"./install\";\nexport * from \"./is-file\";\nexport * from \"./json\";\nexport * from \"./list-files\";\nexport * from \"./package-fns\";\nexport * from \"./read-file\";\nexport * from \"./registry\";\nexport * from \"./remove-file\";\nexport * from \"./resolve\";\nexport * from \"./semver-fns\";\nexport * from \"./toml\";\nexport * from \"./tsconfig\";\nexport * from \"./write-file\";\nexport * from \"./yaml\";\n"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_index = require('./index.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/index.test.ts
6
+ (0, vitest.describe)("index.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_index.src_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_index.src_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { src_exports } from "./index.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/index.test.ts
5
+ describe("index.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(src_exports).toBeDefined();
8
+ expect(typeof src_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=index.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.mjs","names":["moduleExports"],"sources":["../src/index.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./index.ts\";\n\ndescribe(\"index.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,0BAA0B;AACjC,IAAG,8BAA8B;AAC/B,SAAOA,YAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,YAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
package/dist/install.cjs CHANGED
@@ -6,6 +6,10 @@ let _antfu_install_pkg = require("@antfu/install-pkg");
6
6
  require("tinyexec");
7
7
 
8
8
  //#region src/install.ts
9
+ var install_exports = /* @__PURE__ */ require_runtime.__exportAll({
10
+ install: () => install,
11
+ packageExists: () => packageExists
12
+ });
9
13
  /**
10
14
  * Install a specific or list of packages
11
15
  *
@@ -33,4 +37,10 @@ const packageExists = async (name, options) => {
33
37
 
34
38
  //#endregion
35
39
  exports.install = install;
40
+ Object.defineProperty(exports, 'install_exports', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return install_exports;
44
+ }
45
+ });
36
46
  exports.packageExists = packageExists;
package/dist/install.mjs CHANGED
@@ -1,9 +1,14 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { resolve } from "./resolve.mjs";
2
3
  import { cwd } from "@stryke/path/cwd";
3
4
  import { installPackage } from "@antfu/install-pkg";
4
5
  import "tinyexec";
5
6
 
6
7
  //#region src/install.ts
8
+ var install_exports = /* @__PURE__ */ __exportAll({
9
+ install: () => install,
10
+ packageExists: () => packageExists
11
+ });
7
12
  /**
8
13
  * Install a specific or list of packages
9
14
  *
@@ -30,5 +35,5 @@ const packageExists = async (name, options) => {
30
35
  };
31
36
 
32
37
  //#endregion
33
- export { install, packageExists };
38
+ export { install, install_exports, packageExists };
34
39
  //# sourceMappingURL=install.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"install.mjs","names":[],"sources":["../src/install.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { InstallPackageOptions } from \"@antfu/install-pkg\";\nimport { installPackage } from \"@antfu/install-pkg\";\nimport { cwd } from \"@stryke/path/cwd\";\nimport \"tinyexec\";\nimport { resolve } from \"./resolve\";\n\n/**\n * Install a specific package\n *\n * @param name - The name of the package to install\n * @param options - The options to use when installing the package\n */\nexport async function install(\n name: string,\n options?: InstallPackageOptions\n): Promise<ReturnType<typeof installPackage>>;\n\n/**\n * Install a list of packages\n *\n * @param names - The list of package names to install\n * @param options - The options to use when installing the package\n */\nexport async function install(\n names: string[],\n options?: InstallPackageOptions\n): Promise<ReturnType<typeof installPackage>>;\n\n/**\n * Install a specific or list of packages\n *\n * @param nameOrNames - The name or names of packages to install\n * @param options - The options to use when installing the package\n * @returns The result of the command or an exception\n */\nexport async function install(\n nameOrNames: string | string[],\n options?: InstallPackageOptions\n): Promise<ReturnType<typeof installPackage>> {\n return installPackage(nameOrNames, options);\n}\n\n/**\n * Check if a package exists and install it if it does not\n *\n * @param name - The name of the package to check\n * @param options - The options to use when installing the package\n */\nexport const packageExists = async (\n name: string,\n options?: InstallPackageOptions\n) => {\n const resolvePath = await resolve(options?.cwd || cwd());\n try {\n await resolve(name, { paths: [resolvePath] });\n } catch {\n await install(name, options);\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAqDA,eAAsB,QACpB,aACA,SAC4C;AAC5C,QAAO,eAAe,aAAa,QAAQ;;;;;;;;AAS7C,MAAa,gBAAgB,OAC3B,MACA,YACG;CACH,MAAM,cAAc,MAAM,QAAQ,SAAS,OAAO,KAAK,CAAC;AACxD,KAAI;AACF,QAAM,QAAQ,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;SACvC;AACN,QAAM,QAAQ,MAAM,QAAQ"}
1
+ {"version":3,"file":"install.mjs","names":[],"sources":["../src/install.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { InstallPackageOptions } from \"@antfu/install-pkg\";\nimport { installPackage } from \"@antfu/install-pkg\";\nimport { cwd } from \"@stryke/path/cwd\";\nimport \"tinyexec\";\nimport { resolve } from \"./resolve\";\n\n/**\n * Install a specific package\n *\n * @param name - The name of the package to install\n * @param options - The options to use when installing the package\n */\nexport async function install(\n name: string,\n options?: InstallPackageOptions\n): Promise<ReturnType<typeof installPackage>>;\n\n/**\n * Install a list of packages\n *\n * @param names - The list of package names to install\n * @param options - The options to use when installing the package\n */\nexport async function install(\n names: string[],\n options?: InstallPackageOptions\n): Promise<ReturnType<typeof installPackage>>;\n\n/**\n * Install a specific or list of packages\n *\n * @param nameOrNames - The name or names of packages to install\n * @param options - The options to use when installing the package\n * @returns The result of the command or an exception\n */\nexport async function install(\n nameOrNames: string | string[],\n options?: InstallPackageOptions\n): Promise<ReturnType<typeof installPackage>> {\n return installPackage(nameOrNames, options);\n}\n\n/**\n * Check if a package exists and install it if it does not\n *\n * @param name - The name of the package to check\n * @param options - The options to use when installing the package\n */\nexport const packageExists = async (\n name: string,\n options?: InstallPackageOptions\n) => {\n const resolvePath = await resolve(options?.cwd || cwd());\n try {\n await resolve(name, { paths: [resolvePath] });\n } catch {\n await install(name, options);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqDA,eAAsB,QACpB,aACA,SAC4C;AAC5C,QAAO,eAAe,aAAa,QAAQ;;;;;;;;AAS7C,MAAa,gBAAgB,OAC3B,MACA,YACG;CACH,MAAM,cAAc,MAAM,QAAQ,SAAS,OAAO,KAAK,CAAC;AACxD,KAAI;AACF,QAAM,QAAQ,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;SACvC;AACN,QAAM,QAAQ,MAAM,QAAQ"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_install = require('./install.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/install.test.ts
6
+ (0, vitest.describe)("install.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_install.install_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_install.install_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { install_exports } from "./install.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/install.test.ts
5
+ describe("install.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(install_exports).toBeDefined();
8
+ expect(typeof install_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=install.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.test.mjs","names":["moduleExports"],"sources":["../src/install.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./install.ts\";\n\ndescribe(\"install.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,4BAA4B;AACnC,IAAG,8BAA8B;AAC/B,SAAOA,gBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,gBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
package/dist/is-file.cjs CHANGED
@@ -4,6 +4,12 @@ let node_fs = require("node:fs");
4
4
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
5
5
 
6
6
  //#region src/is-file.ts
7
+ var is_file_exports = /* @__PURE__ */ require_runtime.__exportAll({
8
+ isDirectory: () => isDirectory,
9
+ isDirectorySymlink: () => isDirectorySymlink,
10
+ isFile: () => isFile,
11
+ isFileSymlink: () => isFileSymlink
12
+ });
7
13
  /**
8
14
  * Check if the given path is a file.
9
15
  *
@@ -49,4 +55,10 @@ const isDirectorySymlink = (path, additionalPath) => {
49
55
  exports.isDirectory = isDirectory;
50
56
  exports.isDirectorySymlink = isDirectorySymlink;
51
57
  exports.isFile = isFile;
52
- exports.isFileSymlink = isFileSymlink;
58
+ exports.isFileSymlink = isFileSymlink;
59
+ Object.defineProperty(exports, 'is_file_exports', {
60
+ enumerable: true,
61
+ get: function () {
62
+ return is_file_exports;
63
+ }
64
+ });
package/dist/is-file.mjs CHANGED
@@ -1,7 +1,14 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { lstatSync, statSync } from "node:fs";
2
3
  import { joinPaths } from "@stryke/path/join-paths";
3
4
 
4
5
  //#region src/is-file.ts
6
+ var is_file_exports = /* @__PURE__ */ __exportAll({
7
+ isDirectory: () => isDirectory,
8
+ isDirectorySymlink: () => isDirectorySymlink,
9
+ isFile: () => isFile,
10
+ isFileSymlink: () => isFileSymlink
11
+ });
5
12
  /**
6
13
  * Check if the given path is a file.
7
14
  *
@@ -44,5 +51,5 @@ const isDirectorySymlink = (path, additionalPath) => {
44
51
  };
45
52
 
46
53
  //#endregion
47
- export { isDirectory, isDirectorySymlink, isFile, isFileSymlink };
54
+ export { isDirectory, isDirectorySymlink, isFile, isFileSymlink, is_file_exports };
48
55
  //# sourceMappingURL=is-file.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-file.mjs","names":[],"sources":["../src/is-file.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { lstatSync, statSync } from \"node:fs\";\n\n/**\n * Check if the given path is a file.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a file\n */\nexport function isFile(path: string, additionalPath?: string): boolean {\n return Boolean(\n statSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isFile()\n );\n}\n\n/**\n * Check if the given path is a directory.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a directory\n */\nexport function isDirectory(path: string, additionalPath?: string): boolean {\n return Boolean(\n statSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isDirectory()\n );\n}\n\n/**\n * Check if the given path is a file . Does not dereference symbolic links.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a file\n */\nexport const isFileSymlink = (\n path: string,\n additionalPath?: string\n): boolean => {\n return Boolean(\n lstatSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isFile()\n );\n};\n\n/**\n * Check if the given path is a directory. Does not dereference symbolic links.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a directory\n */\nexport const isDirectorySymlink = (\n path: string,\n additionalPath?: string\n): boolean => {\n return Boolean(\n lstatSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isDirectory()\n );\n};\n"],"mappings":";;;;;;;;;;;AA4BA,SAAgB,OAAO,MAAc,gBAAkC;AACrE,QAAO,QACL,SAAS,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EAChE,gBAAgB,OACjB,CAAC,EAAE,QAAQ,CACb;;;;;;;;;AAUH,SAAgB,YAAY,MAAc,gBAAkC;AAC1E,QAAO,QACL,SAAS,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EAChE,gBAAgB,OACjB,CAAC,EAAE,aAAa,CAClB;;;;;;;;;AAUH,MAAa,iBACX,MACA,mBACY;AACZ,QAAO,QACL,UAAU,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EACjE,gBAAgB,OACjB,CAAC,EAAE,QAAQ,CACb;;;;;;;;;AAUH,MAAa,sBACX,MACA,mBACY;AACZ,QAAO,QACL,UAAU,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EACjE,gBAAgB,OACjB,CAAC,EAAE,aAAa,CAClB"}
1
+ {"version":3,"file":"is-file.mjs","names":[],"sources":["../src/is-file.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { lstatSync, statSync } from \"node:fs\";\n\n/**\n * Check if the given path is a file.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a file\n */\nexport function isFile(path: string, additionalPath?: string): boolean {\n return Boolean(\n statSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isFile()\n );\n}\n\n/**\n * Check if the given path is a directory.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a directory\n */\nexport function isDirectory(path: string, additionalPath?: string): boolean {\n return Boolean(\n statSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isDirectory()\n );\n}\n\n/**\n * Check if the given path is a file . Does not dereference symbolic links.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a file\n */\nexport const isFileSymlink = (\n path: string,\n additionalPath?: string\n): boolean => {\n return Boolean(\n lstatSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isFile()\n );\n};\n\n/**\n * Check if the given path is a directory. Does not dereference symbolic links.\n *\n * @param path - The location to check\n * @param additionalPath - An optional additional path to add to the start of the path\n * @returns An indicator specifying if the path is a directory\n */\nexport const isDirectorySymlink = (\n path: string,\n additionalPath?: string\n): boolean => {\n return Boolean(\n lstatSync(additionalPath ? joinPaths(additionalPath, path) : path, {\n throwIfNoEntry: false\n })?.isDirectory()\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,SAAgB,OAAO,MAAc,gBAAkC;AACrE,QAAO,QACL,SAAS,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EAChE,gBAAgB,OACjB,CAAC,EAAE,QAAQ,CACb;;;;;;;;;AAUH,SAAgB,YAAY,MAAc,gBAAkC;AAC1E,QAAO,QACL,SAAS,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EAChE,gBAAgB,OACjB,CAAC,EAAE,aAAa,CAClB;;;;;;;;;AAUH,MAAa,iBACX,MACA,mBACY;AACZ,QAAO,QACL,UAAU,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EACjE,gBAAgB,OACjB,CAAC,EAAE,QAAQ,CACb;;;;;;;;;AAUH,MAAa,sBACX,MACA,mBACY;AACZ,QAAO,QACL,UAAU,iBAAiB,UAAU,gBAAgB,KAAK,GAAG,MAAM,EACjE,gBAAgB,OACjB,CAAC,EAAE,aAAa,CAClB"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_is_file = require('./is-file.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/is-file.test.ts
6
+ (0, vitest.describe)("is-file.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_is_file.is_file_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_is_file.is_file_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { is_file_exports } from "./is-file.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/is-file.test.ts
5
+ describe("is-file.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(is_file_exports).toBeDefined();
8
+ expect(typeof is_file_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=is-file.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-file.test.mjs","names":["moduleExports"],"sources":["../src/is-file.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./is-file.ts\";\n\ndescribe(\"is-file.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,4BAA4B;AACnC,IAAG,8BAA8B;AAC/B,SAAOA,gBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,gBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
package/dist/json.cjs CHANGED
@@ -8,6 +8,12 @@ let _stryke_json_storm_json = require("@stryke/json/storm-json");
8
8
  let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
9
9
 
10
10
  //#region src/json.ts
11
+ var json_exports = /* @__PURE__ */ require_runtime.__exportAll({
12
+ readJsonFile: () => readJsonFile,
13
+ readJsonFileSync: () => readJsonFileSync,
14
+ writeJsonFile: () => writeJsonFile,
15
+ writeJsonFileSync: () => writeJsonFileSync
16
+ });
11
17
  /**
12
18
  * Reads a JSON file and returns the object the JSON content represents.
13
19
  *
@@ -82,6 +88,12 @@ async function writeJsonFile(path, data, options = {}) {
82
88
  }
83
89
 
84
90
  //#endregion
91
+ Object.defineProperty(exports, 'json_exports', {
92
+ enumerable: true,
93
+ get: function () {
94
+ return json_exports;
95
+ }
96
+ });
85
97
  exports.readJsonFile = readJsonFile;
86
98
  exports.readJsonFileSync = readJsonFileSync;
87
99
  exports.writeJsonFile = writeJsonFile;
package/dist/json.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { readFile, readFileSync } from "./read-file.mjs";
2
3
  import { writeFile, writeFileSync } from "./write-file.mjs";
3
4
  import { findFileExtension } from "@stryke/path";
@@ -6,6 +7,12 @@ import { StormJSON } from "@stryke/json/storm-json";
6
7
  import { isError } from "@stryke/type-checks/is-error";
7
8
 
8
9
  //#region src/json.ts
10
+ var json_exports = /* @__PURE__ */ __exportAll({
11
+ readJsonFile: () => readJsonFile,
12
+ readJsonFileSync: () => readJsonFileSync,
13
+ writeJsonFile: () => writeJsonFile,
14
+ writeJsonFileSync: () => writeJsonFileSync
15
+ });
9
16
  /**
10
17
  * Reads a JSON file and returns the object the JSON content represents.
11
18
  *
@@ -80,5 +87,5 @@ async function writeJsonFile(path, data, options = {}) {
80
87
  }
81
88
 
82
89
  //#endregion
83
- export { readJsonFile, readJsonFileSync, writeJsonFile, writeJsonFileSync };
90
+ export { json_exports, readJsonFile, readJsonFileSync, writeJsonFile, writeJsonFileSync };
84
91
  //# sourceMappingURL=json.mjs.map
package/dist/json.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"json.mjs","names":[],"sources":["../src/json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type {\n JsonParseOptions,\n JsonSerializeOptions\n} from \"@stryke/json/types\";\nimport { findFileExtension } from \"@stryke/path\";\nimport { isSetString } from \"@stryke/type-checks\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { readFile, readFileSync } from \"./read-file\";\nimport { writeFile, writeFileSync } from \"./write-file\";\n\n/**\n * Reads a JSON file and returns the object the JSON content represents.\n *\n * @param path - A path to a file.\n * @param options - JSON parse options\n * @returns Object the JSON content of the file represents\n */\nexport function readJsonFileSync<T extends object = any>(\n path: string,\n options?: JsonParseOptions\n): T {\n const content = readFileSync(path);\n\n try {\n return StormJSON.parse<T>(isSetString(content) ? content.trim() : \"{}\", {\n expectComments: findFileExtension(path) === \"jsonc\",\n ...options\n });\n } catch (error) {\n if (isError(error)) {\n error.message = error.message.replace(\"JSON\", path);\n throw error;\n }\n\n throw new Error(`Failed to parse JSON: ${path}`);\n }\n}\n\n/**\n * Reads a JSON file and returns the object the JSON content represents.\n *\n * @param path - A path to a file.\n * @param options - JSON parse options\n * @returns Object the JSON content of the file represents\n */\nexport async function readJsonFile<T extends object = any>(\n path: string,\n options: JsonParseOptions = {}\n): Promise<T> {\n const content = await readFile(path);\n\n try {\n return StormJSON.parse<T>(isSetString(content) ? content.trim() : \"{}\", {\n expectComments: findFileExtension(path) === \"jsonc\",\n ...options\n });\n } catch (error) {\n if (isError(error)) {\n error.message = error.message.replace(\"JSON\", path);\n throw error;\n }\n\n throw new Error(`Failed to parse JSON: ${path}`);\n }\n}\n\nexport interface JsonWriteOptions extends JsonSerializeOptions {\n /**\n * whether to append new line at the end of JSON file\n *\n * @defaultValue false\n */\n appendNewLine?: boolean;\n}\n\n/**\n * Serializes the given data to JSON and writes it to a file.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized to JSON and written to the file\n * @param options - JSON serialize options\n */\nexport function writeJsonFileSync<T extends object = object>(\n path: string,\n data: T,\n options: JsonWriteOptions = {}\n): void {\n const serializedJson = StormJSON.stringify(data, { spaces: 2, ...options });\n\n return writeFileSync(\n path,\n options?.appendNewLine ? `${serializedJson}\\n` : serializedJson\n );\n}\n\n/**\n * Serializes the given data to JSON and writes it to a file asynchronously.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized to JSON and written to the file\n * @param options - JSON serialize options\n */\nexport async function writeJsonFile<T extends object = object>(\n path: string,\n data: T,\n options: JsonWriteOptions = {}\n): Promise<void> {\n const serializedJson = StormJSON.stringify(data, { spaces: 2, ...options });\n\n return writeFile(\n path,\n options?.appendNewLine ? `${serializedJson}\\n` : serializedJson\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoCA,SAAgB,iBACd,MACA,SACG;CACH,MAAM,UAAU,aAAa,KAAK;AAElC,KAAI;AACF,SAAO,UAAU,MAAS,YAAY,QAAQ,GAAG,QAAQ,MAAM,GAAG,MAAM;GACtE,gBAAgB,kBAAkB,KAAK,KAAK;GAC5C,GAAG;GACJ,CAAC;UACK,OAAO;AACd,MAAI,QAAQ,MAAM,EAAE;AAClB,SAAM,UAAU,MAAM,QAAQ,QAAQ,QAAQ,KAAK;AACnD,SAAM;;AAGR,QAAM,IAAI,MAAM,yBAAyB,OAAO;;;;;;;;;;AAWpD,eAAsB,aACpB,MACA,UAA4B,EAAE,EAClB;CACZ,MAAM,UAAU,MAAM,SAAS,KAAK;AAEpC,KAAI;AACF,SAAO,UAAU,MAAS,YAAY,QAAQ,GAAG,QAAQ,MAAM,GAAG,MAAM;GACtE,gBAAgB,kBAAkB,KAAK,KAAK;GAC5C,GAAG;GACJ,CAAC;UACK,OAAO;AACd,MAAI,QAAQ,MAAM,EAAE;AAClB,SAAM,UAAU,MAAM,QAAQ,QAAQ,QAAQ,KAAK;AACnD,SAAM;;AAGR,QAAM,IAAI,MAAM,yBAAyB,OAAO;;;;;;;;;;AAoBpD,SAAgB,kBACd,MACA,MACA,UAA4B,EAAE,EACxB;CACN,MAAM,iBAAiB,UAAU,UAAU,MAAM;EAAE,QAAQ;EAAG,GAAG;EAAS,CAAC;AAE3E,QAAO,cACL,MACA,SAAS,gBAAgB,GAAG,eAAe,MAAM,eAClD;;;;;;;;;AAUH,eAAsB,cACpB,MACA,MACA,UAA4B,EAAE,EACf;CACf,MAAM,iBAAiB,UAAU,UAAU,MAAM;EAAE,QAAQ;EAAG,GAAG;EAAS,CAAC;AAE3E,QAAO,UACL,MACA,SAAS,gBAAgB,GAAG,eAAe,MAAM,eAClD"}
1
+ {"version":3,"file":"json.mjs","names":[],"sources":["../src/json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type {\n JsonParseOptions,\n JsonSerializeOptions\n} from \"@stryke/json/types\";\nimport { findFileExtension } from \"@stryke/path\";\nimport { isSetString } from \"@stryke/type-checks\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { readFile, readFileSync } from \"./read-file\";\nimport { writeFile, writeFileSync } from \"./write-file\";\n\n/**\n * Reads a JSON file and returns the object the JSON content represents.\n *\n * @param path - A path to a file.\n * @param options - JSON parse options\n * @returns Object the JSON content of the file represents\n */\nexport function readJsonFileSync<T extends object = any>(\n path: string,\n options?: JsonParseOptions\n): T {\n const content = readFileSync(path);\n\n try {\n return StormJSON.parse<T>(isSetString(content) ? content.trim() : \"{}\", {\n expectComments: findFileExtension(path) === \"jsonc\",\n ...options\n });\n } catch (error) {\n if (isError(error)) {\n error.message = error.message.replace(\"JSON\", path);\n throw error;\n }\n\n throw new Error(`Failed to parse JSON: ${path}`);\n }\n}\n\n/**\n * Reads a JSON file and returns the object the JSON content represents.\n *\n * @param path - A path to a file.\n * @param options - JSON parse options\n * @returns Object the JSON content of the file represents\n */\nexport async function readJsonFile<T extends object = any>(\n path: string,\n options: JsonParseOptions = {}\n): Promise<T> {\n const content = await readFile(path);\n\n try {\n return StormJSON.parse<T>(isSetString(content) ? content.trim() : \"{}\", {\n expectComments: findFileExtension(path) === \"jsonc\",\n ...options\n });\n } catch (error) {\n if (isError(error)) {\n error.message = error.message.replace(\"JSON\", path);\n throw error;\n }\n\n throw new Error(`Failed to parse JSON: ${path}`);\n }\n}\n\nexport interface JsonWriteOptions extends JsonSerializeOptions {\n /**\n * whether to append new line at the end of JSON file\n *\n * @defaultValue false\n */\n appendNewLine?: boolean;\n}\n\n/**\n * Serializes the given data to JSON and writes it to a file.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized to JSON and written to the file\n * @param options - JSON serialize options\n */\nexport function writeJsonFileSync<T extends object = object>(\n path: string,\n data: T,\n options: JsonWriteOptions = {}\n): void {\n const serializedJson = StormJSON.stringify(data, { spaces: 2, ...options });\n\n return writeFileSync(\n path,\n options?.appendNewLine ? `${serializedJson}\\n` : serializedJson\n );\n}\n\n/**\n * Serializes the given data to JSON and writes it to a file asynchronously.\n *\n * @param path - A path to a file.\n * @param data - data which should be serialized to JSON and written to the file\n * @param options - JSON serialize options\n */\nexport async function writeJsonFile<T extends object = object>(\n path: string,\n data: T,\n options: JsonWriteOptions = {}\n): Promise<void> {\n const serializedJson = StormJSON.stringify(data, { spaces: 2, ...options });\n\n return writeFile(\n path,\n options?.appendNewLine ? `${serializedJson}\\n` : serializedJson\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAgB,iBACd,MACA,SACG;CACH,MAAM,UAAU,aAAa,KAAK;AAElC,KAAI;AACF,SAAO,UAAU,MAAS,YAAY,QAAQ,GAAG,QAAQ,MAAM,GAAG,MAAM;GACtE,gBAAgB,kBAAkB,KAAK,KAAK;GAC5C,GAAG;GACJ,CAAC;UACK,OAAO;AACd,MAAI,QAAQ,MAAM,EAAE;AAClB,SAAM,UAAU,MAAM,QAAQ,QAAQ,QAAQ,KAAK;AACnD,SAAM;;AAGR,QAAM,IAAI,MAAM,yBAAyB,OAAO;;;;;;;;;;AAWpD,eAAsB,aACpB,MACA,UAA4B,EAAE,EAClB;CACZ,MAAM,UAAU,MAAM,SAAS,KAAK;AAEpC,KAAI;AACF,SAAO,UAAU,MAAS,YAAY,QAAQ,GAAG,QAAQ,MAAM,GAAG,MAAM;GACtE,gBAAgB,kBAAkB,KAAK,KAAK;GAC5C,GAAG;GACJ,CAAC;UACK,OAAO;AACd,MAAI,QAAQ,MAAM,EAAE;AAClB,SAAM,UAAU,MAAM,QAAQ,QAAQ,QAAQ,KAAK;AACnD,SAAM;;AAGR,QAAM,IAAI,MAAM,yBAAyB,OAAO;;;;;;;;;;AAoBpD,SAAgB,kBACd,MACA,MACA,UAA4B,EAAE,EACxB;CACN,MAAM,iBAAiB,UAAU,UAAU,MAAM;EAAE,QAAQ;EAAG,GAAG;EAAS,CAAC;AAE3E,QAAO,cACL,MACA,SAAS,gBAAgB,GAAG,eAAe,MAAM,eAClD;;;;;;;;;AAUH,eAAsB,cACpB,MACA,MACA,UAA4B,EAAE,EACf;CACf,MAAM,iBAAiB,UAAU,UAAU,MAAM;EAAE,QAAQ;EAAG,GAAG;EAAS,CAAC;AAE3E,QAAO,UACL,MACA,SAAS,gBAAgB,GAAG,eAAe,MAAM,eAClD"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_json = require('./json.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/json.test.ts
6
+ (0, vitest.describe)("json.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_json.json_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_json.json_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { json_exports } from "./json.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/json.test.ts
5
+ describe("json.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(json_exports).toBeDefined();
8
+ expect(typeof json_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=json.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.test.mjs","names":["moduleExports"],"sources":["../src/json.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./json.ts\";\n\ndescribe(\"json.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,yBAAyB;AAChC,IAAG,8BAA8B;AAC/B,SAAOA,aAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,aAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}