@ryanatkn/gro 0.168.0 → 0.169.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.
Files changed (92) hide show
  1. package/dist/changeset.task.d.ts +1 -1
  2. package/dist/changeset.task.d.ts.map +1 -1
  3. package/dist/changeset.task.js +1 -1
  4. package/dist/check.task.d.ts.map +1 -1
  5. package/dist/check.task.js +1 -1
  6. package/dist/clean.task.d.ts +1 -1
  7. package/dist/clean.task.d.ts.map +1 -1
  8. package/dist/clean.task.js +1 -1
  9. package/dist/cli.d.ts +1 -1
  10. package/dist/cli.d.ts.map +1 -1
  11. package/dist/commit.task.d.ts +1 -1
  12. package/dist/commit.task.d.ts.map +1 -1
  13. package/dist/commit.task.js +1 -1
  14. package/dist/deploy.task.d.ts +3 -3
  15. package/dist/deploy.task.d.ts.map +1 -1
  16. package/dist/deploy.task.js +1 -1
  17. package/dist/disknode.d.ts +1 -1
  18. package/dist/disknode.d.ts.map +1 -1
  19. package/dist/esbuild_plugin_external_worker.d.ts.map +1 -1
  20. package/dist/filer.d.ts +1 -1
  21. package/dist/filer.d.ts.map +1 -1
  22. package/dist/gen.d.ts +1 -1
  23. package/dist/gen.d.ts.map +1 -1
  24. package/dist/gen_helpers.d.ts +1 -1
  25. package/dist/gen_helpers.d.ts.map +1 -1
  26. package/dist/gro_config.d.ts +1 -1
  27. package/dist/gro_config.d.ts.map +1 -1
  28. package/dist/gro_plugin_server.d.ts +2 -2
  29. package/dist/gro_plugin_server.d.ts.map +1 -1
  30. package/dist/input_path.d.ts +1 -1
  31. package/dist/input_path.d.ts.map +1 -1
  32. package/dist/modules.d.ts +1 -1
  33. package/dist/modules.d.ts.map +1 -1
  34. package/dist/package.d.ts.map +1 -1
  35. package/dist/package.js +4 -38
  36. package/dist/package_json.d.ts.map +1 -1
  37. package/dist/package_json.js +4 -0
  38. package/dist/parse_exports.d.ts +1 -1
  39. package/dist/parse_exports.d.ts.map +1 -1
  40. package/dist/parse_imports.d.ts +1 -1
  41. package/dist/parse_imports.d.ts.map +1 -1
  42. package/dist/paths.d.ts +1 -1
  43. package/dist/paths.d.ts.map +1 -1
  44. package/dist/publish.task.d.ts +2 -2
  45. package/dist/publish.task.d.ts.map +1 -1
  46. package/dist/publish.task.js +1 -1
  47. package/dist/resolve_specifier.d.ts +1 -1
  48. package/dist/resolve_specifier.d.ts.map +1 -1
  49. package/dist/search_fs.d.ts +1 -1
  50. package/dist/search_fs.d.ts.map +1 -1
  51. package/dist/task.d.ts +1 -1
  52. package/dist/task.d.ts.map +1 -1
  53. package/dist/upgrade.task.d.ts +1 -1
  54. package/dist/upgrade.task.d.ts.map +1 -1
  55. package/dist/upgrade.task.js +1 -1
  56. package/dist/watch_dir.d.ts +1 -1
  57. package/dist/watch_dir.d.ts.map +1 -1
  58. package/package.json +6 -2
  59. package/src/lib/changeset.task.ts +5 -1
  60. package/src/lib/check.task.ts +1 -1
  61. package/src/lib/clean.task.ts +1 -1
  62. package/src/lib/cli.ts +1 -1
  63. package/src/lib/commit.task.ts +1 -1
  64. package/src/lib/deploy.task.ts +6 -6
  65. package/src/lib/disknode.ts +1 -1
  66. package/src/lib/esbuild_plugin_external_worker.ts +1 -1
  67. package/src/lib/filer.ts +1 -1
  68. package/src/lib/gen.ts +1 -1
  69. package/src/lib/gen_helpers.ts +1 -1
  70. package/src/lib/gro_config.ts +1 -1
  71. package/src/lib/gro_plugin_server.ts +1 -1
  72. package/src/lib/input_path.ts +1 -1
  73. package/src/lib/modules.ts +1 -1
  74. package/src/lib/package.ts +4 -38
  75. package/src/lib/package_json.ts +4 -0
  76. package/src/lib/parse_exports.ts +1 -1
  77. package/src/lib/parse_imports.ts +1 -1
  78. package/src/lib/paths.ts +1 -1
  79. package/src/lib/publish.task.ts +8 -8
  80. package/src/lib/resolve_specifier.ts +1 -1
  81. package/src/lib/search_fs.ts +1 -2
  82. package/src/lib/task.ts +1 -1
  83. package/src/lib/upgrade.task.ts +1 -1
  84. package/src/lib/watch_dir.ts +1 -2
  85. package/dist/git.d.ts +0 -81
  86. package/dist/git.d.ts.map +0 -1
  87. package/dist/git.js +0 -218
  88. package/dist/path.d.ts +0 -17
  89. package/dist/path.d.ts.map +0 -1
  90. package/dist/path.js +0 -2
  91. package/src/lib/git.ts +0 -298
  92. package/src/lib/path.ts +0 -23
@@ -3,7 +3,7 @@ import { type Task } from './task.ts';
3
3
  export declare const Args: z.ZodObject<{
4
4
  _: z.ZodDefault<z.ZodArray<z.ZodString>>;
5
5
  only: z.ZodPipe<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>, z.ZodTransform<string[], string | string[]>>;
6
- origin: z.ZodDefault<z.ZodString>;
6
+ origin: any;
7
7
  force: z.ZodDefault<z.ZodBoolean>;
8
8
  pull: z.ZodDefault<z.ZodBoolean>;
9
9
  'no-pull': z.ZodDefault<z.ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,eAAO,MAAM,IAAI;;;;;;;;;;;;kBAiCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4E3B,CAAC"}
1
+ {"version":3,"file":"upgrade.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/upgrade.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAMhD,eAAO,MAAM,IAAI;;;;;;;;;;;;kBAiCf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA4E3B,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { spawn } from '@ryanatkn/belt/process.js';
2
2
  import { z } from 'zod';
3
3
  import { rmSync } from 'node:fs';
4
+ import { Git_Origin, git_pull } from '@ryanatkn/belt/git.js';
4
5
  import { Task_Error } from "./task.js";
5
6
  import { extract_deps, load_package_json } from "./package_json.js";
6
- import { Git_Origin, git_pull } from "./git.js";
7
7
  import { spawn_cli } from "./cli.js";
8
8
  import { serialize_args, to_forwarded_args } from "./args.js";
9
9
  import { NODE_MODULES_DIRNAME } from "./constants.js";
@@ -1,5 +1,5 @@
1
1
  import { type ChokidarOptions, type Matcher } from 'chokidar';
2
- import type { Path_Filter } from './path.ts';
2
+ import type { Path_Filter } from '@ryanatkn/belt/path.js';
3
3
  export interface Watch_Node_Fs {
4
4
  init: () => Promise<void>;
5
5
  close: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"watch_dir.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/watch_dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,eAAe,EAAkB,KAAK,OAAO,EAAC,MAAM,UAAU,CAAC;AAMnF,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAM3C,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC9D,MAAM,MAAM,uBAAuB,GAAG,C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E,eAAe,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,0DAOvB,iBAAiB,KAAG,aA+CtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.168.0",
3
+ "version": "0.169.0",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -49,7 +49,7 @@
49
49
  "typescript"
50
50
  ],
51
51
  "dependencies": {
52
- "@ryanatkn/belt": "^0.34.1",
52
+ "@ryanatkn/belt": "^0.35.1",
53
53
  "chokidar": "^4.0.3",
54
54
  "dotenv": "^17.2.2",
55
55
  "esm-env": "^1.2.2",
@@ -134,6 +134,10 @@
134
134
  "./*.js": {
135
135
  "types": "./dist/*.d.ts",
136
136
  "default": "./dist/*.js"
137
+ },
138
+ "./*.ts": {
139
+ "types": "./dist/*.d.ts",
140
+ "default": "./dist/*.js"
137
141
  }
138
142
  }
139
143
  }
@@ -5,10 +5,14 @@ import type {WrittenConfig} from '@changesets/types';
5
5
  import {readFile, writeFile} from 'node:fs/promises';
6
6
  import {join} from 'node:path';
7
7
  import {existsSync, readdirSync} from 'node:fs';
8
+ import {
9
+ Git_Origin,
10
+ git_check_fully_staged_workspace,
11
+ git_push_to_create,
12
+ } from '@ryanatkn/belt/git.js';
8
13
 
9
14
  import {Task_Error, type Task} from './task.ts';
10
15
  import {find_cli, spawn_cli} from './cli.ts';
11
- import {Git_Origin, git_check_fully_staged_workspace, git_push_to_create} from './git.ts';
12
16
  import {has_sveltekit_library} from './sveltekit_helpers.ts';
13
17
  import {
14
18
  CHANGESET_CLI,
@@ -1,9 +1,9 @@
1
1
  import {z} from 'zod';
2
2
  import {spawn} from '@ryanatkn/belt/process.js';
3
3
  import {styleText as st} from 'node:util';
4
+ import {git_check_clean_workspace} from '@ryanatkn/belt/git.js';
4
5
 
5
6
  import {Task_Error, type Task} from './task.ts';
6
- import {git_check_clean_workspace} from './git.ts';
7
7
  import {sync_package_json} from './package_json.ts';
8
8
 
9
9
  export const Args = z.strictObject({
@@ -1,9 +1,9 @@
1
1
  import {spawn} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
+ import {Git_Origin} from '@ryanatkn/belt/git.js';
3
4
 
4
5
  import type {Task} from './task.ts';
5
6
  import {clean_fs} from './clean_fs.ts';
6
- import {Git_Origin} from './git.ts';
7
7
 
8
8
  export const Args = z.strictObject({
9
9
  build_dev: z.boolean().meta({description: 'delete the Gro build dev directory'}).default(false),
package/src/lib/cli.ts CHANGED
@@ -9,9 +9,9 @@ import {join} from 'node:path';
9
9
  import {existsSync} from 'node:fs';
10
10
  import {fileURLToPath, type URL} from 'node:url';
11
11
  import type {Logger} from '@ryanatkn/belt/log.js';
12
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
12
13
 
13
14
  import {NODE_MODULES_DIRNAME} from './constants.ts';
14
- import type {Path_Id} from './path.ts';
15
15
  import {print_command_args} from './args.ts';
16
16
 
17
17
  // TODO maybe upstream to Belt?
@@ -1,8 +1,8 @@
1
1
  import {spawn} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
+ import {Git_Origin, git_current_branch_name, git_push} from '@ryanatkn/belt/git.js';
3
4
 
4
5
  import type {Task} from './task.ts';
5
- import {Git_Origin, git_current_branch_name, git_push} from './git.ts';
6
6
 
7
7
  export const Args = z.strictObject({
8
8
  _: z
@@ -5,11 +5,6 @@ import {z} from 'zod';
5
5
  import {cp, mkdir, rm} from 'node:fs/promises';
6
6
  import {join, resolve} from 'node:path';
7
7
  import {existsSync, readdirSync} from 'node:fs';
8
-
9
- import {Task_Error, type Task} from './task.ts';
10
- import {print_path} from './paths.ts';
11
- import {GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME} from './constants.ts';
12
- import {empty_dir} from './fs.ts';
13
8
  import {
14
9
  git_check_clean_workspace,
15
10
  git_checkout,
@@ -25,7 +20,12 @@ import {
25
20
  git_check_setting_pull_rebase,
26
21
  git_clone_locally,
27
22
  git_current_branch_name,
28
- } from './git.ts';
23
+ } from '@ryanatkn/belt/git.js';
24
+
25
+ import {Task_Error, type Task} from './task.ts';
26
+ import {print_path} from './paths.ts';
27
+ import {GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME} from './constants.ts';
28
+ import {empty_dir} from './fs.ts';
29
29
 
30
30
  // docs at ./docs/deploy.md
31
31
 
@@ -1,4 +1,4 @@
1
- import type {Path_Id} from './path.ts';
1
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
2
2
 
3
3
  // TODO extract more here from Filer
4
4
 
@@ -2,6 +2,7 @@ import * as esbuild from 'esbuild';
2
2
  import type {Logger} from '@ryanatkn/belt/log.js';
3
3
  import {basename} from 'node:path';
4
4
  import type {CompileOptions, ModuleCompileOptions, PreprocessorGroup} from 'svelte/compiler';
5
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
5
6
 
6
7
  import {print_build_result, to_define_import_meta_env} from './esbuild_helpers.ts';
7
8
  import {resolve_specifier} from './resolve_specifier.ts';
@@ -11,7 +12,6 @@ import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim
11
12
  import {esbuild_plugin_sveltekit_local_imports} from './esbuild_plugin_sveltekit_local_imports.ts';
12
13
  import {esbuild_plugin_svelte} from './esbuild_plugin_svelte.ts';
13
14
  import type {Parsed_Svelte_Config} from './svelte_config.ts';
14
- import type {Path_Id} from './path.ts';
15
15
 
16
16
  export interface Esbuild_Plugin_External_Worker_Options {
17
17
  dev: boolean;
package/src/lib/filer.ts CHANGED
@@ -7,8 +7,8 @@ import {fileURLToPath, pathToFileURL} from 'node:url';
7
7
  import {Unreachable_Error} from '@ryanatkn/belt/error.js';
8
8
  import type {Logger} from '@ryanatkn/belt/log.js';
9
9
  import type {Package_Json} from '@ryanatkn/belt/package_json.js';
10
+ import type {File_Filter, Path_Id} from '@ryanatkn/belt/path.js';
10
11
 
11
- import type {File_Filter, Path_Id} from './path.ts';
12
12
  import {
13
13
  watch_dir,
14
14
  type Watch_Node_Fs,
package/src/lib/gen.ts CHANGED
@@ -5,9 +5,9 @@ import type {Result} from '@ryanatkn/belt/result.js';
5
5
  import type {Timings} from '@ryanatkn/belt/timings.js';
6
6
  import {styleText as st} from 'node:util';
7
7
  import {existsSync} from 'node:fs';
8
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
8
9
 
9
10
  import {print_path} from './paths.ts';
10
- import type {Path_Id} from './path.ts';
11
11
  import type {Gro_Config} from './gro_config.ts';
12
12
  import type {Parsed_Svelte_Config} from './svelte_config.ts';
13
13
  import {load_modules, type Load_Modules_Failure, type Module_Meta} from './modules.ts';
@@ -1,6 +1,7 @@
1
1
  import {resolve} from 'node:path';
2
2
  import type {Logger} from '@ryanatkn/belt/log.js';
3
3
  import type {Timings} from '@ryanatkn/belt/timings.js';
4
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
4
5
 
5
6
  import type {Gro_Config} from './gro_config.ts';
6
7
  import {filter_dependents, type Filer} from './filer.ts';
@@ -14,7 +15,6 @@ import {
14
15
  } from './gen.ts';
15
16
  import {default_svelte_config} from './svelte_config.ts';
16
17
  import {to_root_path} from './paths.ts';
17
- import type {Path_Id} from './path.ts';
18
18
  import {load_module} from './modules.ts';
19
19
 
20
20
  /**
@@ -1,6 +1,7 @@
1
1
  import {join, resolve} from 'node:path';
2
2
  import {existsSync} from 'node:fs';
3
3
  import {identity} from '@ryanatkn/belt/function.js';
4
+ import type {Path_Filter, Path_Id} from '@ryanatkn/belt/path.js';
4
5
 
5
6
  import {GRO_DIST_DIR, IS_THIS_GRO, paths} from './paths.ts';
6
7
  import {
@@ -15,7 +16,6 @@ import {
15
16
  import create_default_config from './gro.config.default.ts';
16
17
  import type {Create_Config_Plugins} from './plugin.ts';
17
18
  import type {Map_Package_Json} from './package_json.ts';
18
- import type {Path_Filter, Path_Id} from './path.ts';
19
19
  import type {Parsed_Svelte_Config} from './svelte_config.ts';
20
20
 
21
21
  /**
@@ -7,10 +7,10 @@ import {strip_before, strip_end} from '@ryanatkn/belt/string.js';
7
7
  import type {Result} from '@ryanatkn/belt/result.js';
8
8
  import {existsSync} from 'node:fs';
9
9
  import {throttle} from '@ryanatkn/belt/throttle.js';
10
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
10
11
 
11
12
  import type {Plugin} from './plugin.ts';
12
13
  import {base_path_to_path_id, LIB_DIRNAME, paths} from './paths.ts';
13
- import type {Path_Id} from './path.ts';
14
14
  import {GRO_DEV_DIRNAME, SERVER_DIST_PATH} from './constants.ts';
15
15
  import {parse_svelte_config, default_svelte_config} from './svelte_config.ts';
16
16
  import {esbuild_plugin_sveltekit_shim_app} from './esbuild_plugin_sveltekit_shim_app.ts';
@@ -3,9 +3,9 @@ import {existsSync, statSync} from 'node:fs';
3
3
  import {strip_start} from '@ryanatkn/belt/string.js';
4
4
  import {z} from 'zod';
5
5
  import type {Flavored} from '@ryanatkn/belt/types.js';
6
+ import type {Path_Info, Path_Id, Resolved_Path} from '@ryanatkn/belt/path.js';
6
7
 
7
8
  import {GRO_PACKAGE_DIR, GRO_DIST_DIR} from './paths.ts';
8
- import type {Path_Info, Path_Id, Resolved_Path} from './path.ts';
9
9
  import {search_fs} from './search_fs.ts';
10
10
  import {TASK_FILE_SUFFIX_JS} from './task.ts';
11
11
 
@@ -3,10 +3,10 @@ import {Unreachable_Error} from '@ryanatkn/belt/error.js';
3
3
  import type {Result} from '@ryanatkn/belt/result.js';
4
4
  import {print_error} from '@ryanatkn/belt/print.js';
5
5
  import {pathToFileURL} from 'node:url';
6
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
6
7
 
7
8
  import type {Resolved_Input_File} from './input_path.ts';
8
9
  import {print_path} from './paths.ts';
9
- import type {Path_Id} from './path.ts';
10
10
 
11
11
  export interface Module_Meta<T_Module extends Record<string, any> = Record<string, any>> {
12
12
  id: Path_Id;
@@ -5,7 +5,7 @@ import type {Src_Json} from '@ryanatkn/belt/src_json.js';
5
5
 
6
6
  export const package_json: Package_Json = {
7
7
  name: '@ryanatkn/gro',
8
- version: '0.168.0',
8
+ version: '0.169.0',
9
9
  description: 'task runner and toolkit extending SvelteKit',
10
10
  motto: 'generate, run, optimize',
11
11
  glyph: '🌰',
@@ -44,7 +44,7 @@ export const package_json: Package_Json = {
44
44
  'typescript',
45
45
  ],
46
46
  dependencies: {
47
- '@ryanatkn/belt': '^0.34.1',
47
+ '@ryanatkn/belt': '^0.35.1',
48
48
  chokidar: '^4.0.3',
49
49
  dotenv: '^17.2.2',
50
50
  'esm-env': '^1.2.2',
@@ -99,12 +99,13 @@ export const package_json: Package_Json = {
99
99
  './package.json': './package.json',
100
100
  '.': {types: './dist/index.d.ts', default: './dist/index.js'},
101
101
  './*.js': {types: './dist/*.d.ts', default: './dist/*.js'},
102
+ './*.ts': {types: './dist/*.d.ts', default: './dist/*.js'},
102
103
  },
103
104
  } as any;
104
105
 
105
106
  export const src_json: Src_Json = {
106
107
  name: '@ryanatkn/gro',
107
- version: '0.168.0',
108
+ version: '0.169.0',
108
109
  modules: {
109
110
  '.': {
110
111
  path: 'index.ts',
@@ -401,30 +402,6 @@ export const src_json: Src_Json = {
401
402
  {name: 'normalize_gen_config', kind: 'function'},
402
403
  ],
403
404
  },
404
- './git.js': {
405
- path: 'git.ts',
406
- declarations: [
407
- {name: 'Git_Origin', kind: 'variable'},
408
- {name: 'Git_Branch', kind: 'variable'},
409
- {name: 'git_current_branch_name', kind: 'function'},
410
- {name: 'git_remote_branch_exists', kind: 'function'},
411
- {name: 'git_local_branch_exists', kind: 'function'},
412
- {name: 'git_check_clean_workspace', kind: 'function'},
413
- {name: 'git_check_fully_staged_workspace', kind: 'function'},
414
- {name: 'git_fetch', kind: 'function'},
415
- {name: 'git_checkout', kind: 'function'},
416
- {name: 'git_pull', kind: 'function'},
417
- {name: 'git_push', kind: 'function'},
418
- {name: 'git_push_to_create', kind: 'function'},
419
- {name: 'git_delete_local_branch', kind: 'function'},
420
- {name: 'git_delete_remote_branch', kind: 'function'},
421
- {name: 'git_reset_branch_to_first_commit', kind: 'function'},
422
- {name: 'git_current_commit_hash', kind: 'function'},
423
- {name: 'git_current_branch_first_commit_hash', kind: 'function'},
424
- {name: 'git_check_setting_pull_rebase', kind: 'function'},
425
- {name: 'git_clone_locally', kind: 'function'},
426
- ],
427
- },
428
405
  './github.js': {
429
406
  path: 'github.ts',
430
407
  declarations: [
@@ -614,17 +591,6 @@ export const src_json: Src_Json = {
614
591
  {name: 'parse_imports', kind: 'function'},
615
592
  ],
616
593
  },
617
- './path.js': {
618
- path: 'path.ts',
619
- declarations: [
620
- {name: 'Path_Id', kind: 'type'},
621
- {name: 'Path_Info', kind: 'type'},
622
- {name: 'Resolved_Path', kind: 'type'},
623
- {name: 'Path_Filter', kind: 'type'},
624
- {name: 'File_Filter', kind: 'type'},
625
- {name: 'to_file_path', kind: 'function'},
626
- ],
627
- },
628
594
  './paths.js': {
629
595
  path: 'paths.ts',
630
596
  declarations: [
@@ -145,6 +145,10 @@ export const to_package_exports = (paths: Array<string>): Package_Json_Exports =
145
145
  types: IMPORT_PREFIX + '*.d.ts',
146
146
  default: IMPORT_PREFIX + '*.js',
147
147
  };
148
+ exports['./*.ts'] = {
149
+ types: IMPORT_PREFIX + '*.d.ts',
150
+ default: IMPORT_PREFIX + '*.js',
151
+ };
148
152
  }
149
153
 
150
154
  if (has_svelte) {
@@ -3,8 +3,8 @@ import {extname} from 'node:path';
3
3
  import type {Flavored} from '@ryanatkn/belt/types.js';
4
4
  import type {Logger} from '@ryanatkn/belt/log.js';
5
5
  import type {Src_Module_Declaration_Kind} from '@ryanatkn/belt/src_json.js';
6
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
6
7
 
7
- import type {Path_Id} from './path.ts';
8
8
  import {TS_MATCHER} from './constants.ts';
9
9
  import {Parse_Exports_Context} from './parse_exports_context.ts';
10
10
 
@@ -1,8 +1,8 @@
1
1
  import {parseSync, type ImportDeclaration} from 'oxc-parser';
2
2
  import type {Flavored} from '@ryanatkn/belt/types.js';
3
3
  import {Unreachable_Error} from '@ryanatkn/belt/error.js';
4
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
4
5
 
5
- import type {Path_Id} from './path.ts';
6
6
  import {JS_MATCHER, TS_MATCHER, SVELTE_MATCHER, SVELTE_SCRIPT_MATCHER} from './constants.ts';
7
7
 
8
8
  export type Import_Specifier = Flavored<string, 'Import_Specifier'>;
package/src/lib/paths.ts CHANGED
@@ -2,6 +2,7 @@ import {join, extname, relative, basename} from 'node:path';
2
2
  import {fileURLToPath} from 'node:url';
3
3
  import {ensure_end, strip_end} from '@ryanatkn/belt/string.js';
4
4
  import {styleText as st} from 'node:util';
5
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
5
6
 
6
7
  import {
7
8
  GRO_CONFIG_FILENAME,
@@ -11,7 +12,6 @@ import {
11
12
  SVELTEKIT_DIST_DIRNAME,
12
13
  } from './constants.ts';
13
14
  import {default_svelte_config} from './svelte_config.ts';
14
- import type {Path_Id} from './path.ts';
15
15
 
16
16
  /*
17
17
 
@@ -2,13 +2,6 @@ import {spawn} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
3
  import {styleText as st} from 'node:util';
4
4
  import {existsSync} from 'node:fs';
5
-
6
- import {Task_Error, type Task} from './task.ts';
7
- import {load_package_json, parse_repo_url} from './package_json.ts';
8
- import {find_cli, spawn_cli} from './cli.ts';
9
- import {has_sveltekit_library} from './sveltekit_helpers.ts';
10
- import {update_changelog} from './changelog.ts';
11
- import {load_from_env} from './env.ts';
12
5
  import {
13
6
  Git_Branch,
14
7
  Git_Origin,
@@ -16,7 +9,14 @@ import {
16
9
  git_checkout,
17
10
  git_fetch,
18
11
  git_pull,
19
- } from './git.ts';
12
+ } from '@ryanatkn/belt/git.js';
13
+
14
+ import {Task_Error, type Task} from './task.ts';
15
+ import {load_package_json, parse_repo_url} from './package_json.ts';
16
+ import {find_cli, spawn_cli} from './cli.ts';
17
+ import {has_sveltekit_library} from './sveltekit_helpers.ts';
18
+ import {update_changelog} from './changelog.ts';
19
+ import {load_from_env} from './env.ts';
20
20
  import {CHANGESET_CLI} from './changeset_helpers.ts';
21
21
 
22
22
  export const Args = z.strictObject({
@@ -1,8 +1,8 @@
1
1
  import {extname, isAbsolute, join, relative} from 'node:path';
2
2
  import {existsSync} from 'node:fs';
3
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
3
4
 
4
5
  import {replace_extension} from './paths.ts';
5
- import type {Path_Id} from './path.ts';
6
6
 
7
7
  // TODO ideally this module doesnt exist, but import.meta.resolve doesn't work in loaders last I tried
8
8
 
@@ -3,8 +3,7 @@ import {to_array} from '@ryanatkn/belt/array.js';
3
3
  import {ensure_end} from '@ryanatkn/belt/string.js';
4
4
  import {isAbsolute, join} from 'node:path';
5
5
  import {existsSync, readdirSync} from 'node:fs';
6
-
7
- import type {File_Filter, Resolved_Path, Path_Filter} from './path.ts';
6
+ import type {File_Filter, Resolved_Path, Path_Filter} from '@ryanatkn/belt/path.js';
8
7
 
9
8
  export interface Search_Fs_Options {
10
9
  /**
package/src/lib/task.ts CHANGED
@@ -5,9 +5,9 @@ import type {Timings} from '@ryanatkn/belt/timings.js';
5
5
  import {styleText as st} from 'node:util';
6
6
  import type {Result} from '@ryanatkn/belt/result.js';
7
7
  import {isAbsolute, join, relative} from 'node:path';
8
+ import type {Path_Id} from '@ryanatkn/belt/path.js';
8
9
 
9
10
  import type {Args} from './args.ts';
10
- import type {Path_Id} from './path.ts';
11
11
  import type {Gro_Config} from './gro_config.ts';
12
12
  import type {Parsed_Svelte_Config} from './svelte_config.ts';
13
13
  import {
@@ -1,10 +1,10 @@
1
1
  import {spawn} from '@ryanatkn/belt/process.js';
2
2
  import {z} from 'zod';
3
3
  import {rmSync} from 'node:fs';
4
+ import {Git_Origin, git_pull} from '@ryanatkn/belt/git.js';
4
5
 
5
6
  import {Task_Error, type Task} from './task.ts';
6
7
  import {extract_deps, load_package_json, type Package_Json_Dep} from './package_json.ts';
7
- import {Git_Origin, git_pull} from './git.ts';
8
8
  import {spawn_cli} from './cli.ts';
9
9
  import {serialize_args, to_forwarded_args} from './args.ts';
10
10
  import {NODE_MODULES_DIRNAME} from './constants.ts';
@@ -2,10 +2,9 @@ import {watch, type ChokidarOptions, type FSWatcher, type Matcher} from 'chokida
2
2
  import {relative} from 'node:path';
3
3
  import {statSync} from 'node:fs';
4
4
  import {create_deferred, type Deferred} from '@ryanatkn/belt/async.js';
5
+ import type {Path_Filter} from '@ryanatkn/belt/path.js';
5
6
  import {EMPTY_OBJECT} from '@ryanatkn/belt/object.js';
6
7
 
7
- import type {Path_Filter} from './path.ts';
8
-
9
8
  const TMP_FILE_PATTERN = /\.tmp\./;
10
9
 
11
10
  // TODO pretty hacky
package/dist/git.d.ts DELETED
@@ -1,81 +0,0 @@
1
- import type { SpawnOptions } from 'node:child_process';
2
- import { z } from 'zod';
3
- import type { Flavored } from '@ryanatkn/belt/types.js';
4
- export declare const Git_Origin: z.ZodString;
5
- export type Git_Origin = Flavored<string, 'Git_Origin'>;
6
- export declare const Git_Branch: z.ZodString;
7
- export type Git_Branch = Flavored<string, 'Git_Branch'>;
8
- /**
9
- * Returns the current git branch name or throws if something goes wrong.
10
- */
11
- export declare const git_current_branch_name: (options?: SpawnOptions) => Promise<Git_Branch>;
12
- /**
13
- * @returns a boolean indicating if the remote git branch exists
14
- */
15
- export declare const git_remote_branch_exists: (origin?: Git_Origin, branch?: Git_Branch, options?: SpawnOptions) => Promise<boolean>;
16
- /**
17
- * @returns a boolean indicating if the local git branch exists
18
- */
19
- export declare const git_local_branch_exists: (branch: Git_Branch, options?: SpawnOptions) => Promise<boolean>;
20
- /**
21
- * TODO make this return an enum and separate the text into a different function
22
- * @returns an error message if the git workspace has any unstaged or uncommitted changes, or `null` if it's clean
23
- */
24
- export declare const git_check_clean_workspace: (options?: SpawnOptions) => Promise<string | null>;
25
- /**
26
- * TODO make this return an enum and separate the text into a different function
27
- * @returns an error message if the git workspace has any unstaged stages, or `null` if it's clean
28
- */
29
- export declare const git_check_fully_staged_workspace: (options?: SpawnOptions) => Promise<string | null>;
30
- /**
31
- * Calls `git fetch` and throws if anything goes wrong.
32
- */
33
- export declare const git_fetch: (origin?: Git_Origin, branch?: Git_Branch, options?: SpawnOptions) => Promise<void>;
34
- /**
35
- * Calls `git checkout` and throws if anything goes wrong.
36
- * @returns the previous branch name, if it changed
37
- */
38
- export declare const git_checkout: (branch: Git_Branch, options?: SpawnOptions) => Promise<Git_Branch | null>;
39
- /**
40
- * Calls `git pull` and throws if anything goes wrong.
41
- */
42
- export declare const git_pull: (origin?: Git_Origin, branch?: Git_Branch, options?: SpawnOptions) => Promise<void>;
43
- /**
44
- * Calls `git push` and throws if anything goes wrong.
45
- */
46
- export declare const git_push: (origin: Git_Origin, branch?: Git_Branch, options?: SpawnOptions, set_upstream?: boolean) => Promise<void>;
47
- /**
48
- * Calls `git push` and throws if anything goes wrong.
49
- */
50
- export declare const git_push_to_create: (origin?: Git_Origin, branch?: Git_Branch, options?: SpawnOptions) => Promise<void>;
51
- /**
52
- * Deletes a branch locally and throws if anything goes wrong.
53
- */
54
- export declare const git_delete_local_branch: (branch: Git_Branch, options?: SpawnOptions) => Promise<void>;
55
- /**
56
- * Deletes a branch remotely and throws if anything goes wrong.
57
- */
58
- export declare const git_delete_remote_branch: (origin: Git_Origin, branch: Git_Branch, options?: SpawnOptions) => Promise<void>;
59
- /**
60
- * Resets the `target` branch back to its first commit both locally and remotely.
61
- */
62
- export declare const git_reset_branch_to_first_commit: (origin: Git_Origin, branch: Git_Branch, options?: SpawnOptions) => Promise<void>;
63
- /**
64
- * Returns the branch's latest commit hash or throws if something goes wrong.
65
- */
66
- export declare const git_current_commit_hash: (branch?: string, options?: SpawnOptions) => Promise<string | null>;
67
- /**
68
- * Returns the hash of the current branch's first commit or throws if something goes wrong.
69
- */
70
- export declare const git_current_branch_first_commit_hash: (options?: SpawnOptions) => Promise<string>;
71
- /**
72
- * Returns the global git config setting for `pull.rebase`.
73
- * Gro is currently written to expect `true`,
74
- * but the restriction could be loosened with additional work.
75
- */
76
- export declare const git_check_setting_pull_rebase: (options?: SpawnOptions) => Promise<boolean>;
77
- /**
78
- * Clones a branch locally to another directory and updates the origin to match the source.
79
- */
80
- export declare const git_clone_locally: (origin: Git_Origin, branch: Git_Branch, source_dir: string, target_dir: string, options?: SpawnOptions) => Promise<void>;
81
- //# sourceMappingURL=git.d.ts.map
package/dist/git.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/git.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAMtD,eAAO,MAAM,UAAU,aAAa,CAAC;AACrC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,UAAU,aAAa,CAAC;AACrC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAU,UAAU,YAAY,KAAG,OAAO,CAAC,UAAU,CAKxF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACpC,SAAQ,UAAmC,EAC3C,SAAS,UAAU,EACnB,UAAU,YAAY,KACpB,OAAO,CAAC,OAAO,CAmBjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GACnC,QAAQ,UAAU,EAClB,UAAU,YAAY,KACpB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