@ryanatkn/gro 0.130.0 → 0.130.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // generated by src/lib/package.gen.ts
2
2
  export const package_json = {
3
3
  name: '@ryanatkn/gro',
4
- version: '0.130.0',
4
+ version: '0.130.1',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  motto: 'generate, run, optimize',
7
7
  glyph: '🌰',
@@ -266,7 +266,7 @@ export const package_json = {
266
266
  };
267
267
  export const src_json = {
268
268
  name: '@ryanatkn/gro',
269
- version: '0.130.0',
269
+ version: '0.130.1',
270
270
  modules: {
271
271
  '.': {
272
272
  path: 'index.ts',
@@ -1 +1 @@
1
- {"version":3,"file":"publish.task.d.ts","sourceRoot":"../src/lib/","sources":["publish.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAwBhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAsI3B,CAAC"}
1
+ {"version":3,"file":"publish.task.d.ts","sourceRoot":"../src/lib/","sources":["publish.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAwBhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CA+I3B,CAAC"}
@@ -79,6 +79,7 @@ export const task = {
79
79
  await invoke_task('check', { workspace: true });
80
80
  }
81
81
  let version;
82
+ let optional_and_version_unchanged = false;
82
83
  // Bump the version so the package.json is updated before building:
83
84
  // TODO problem here is build may fail and put us in a bad state,
84
85
  // but I don't see how we could do this to robustly
@@ -116,16 +117,24 @@ export const task = {
116
117
  // The version didn't change.
117
118
  // For now this is the best detection we have for a no-op `changeset version`.
118
119
  if (optional) {
119
- return; // exit gracefully
120
+ optional_and_version_unchanged = true;
120
121
  }
121
122
  else {
123
+ // Doesn't build if the version didn't change and publishing isn't optional.
122
124
  throw new Task_Error(`\`${changeset_cli} version\` failed: are there any changes?`);
123
125
  }
124
126
  }
125
127
  }
128
+ // Build after the version is bumped so the new version is in the build as needed.
126
129
  if (build) {
127
130
  await invoke_task('build');
128
131
  }
132
+ // Return early if there are no changes and publishing is optional, but after building,
133
+ // so if callers want to optimize away building
134
+ // they need to do so manually like in `gro release`.
135
+ // TODO this could be cleaned up if tasks had a return value to callers, it could specifiy that it didn't build
136
+ if (optional_and_version_unchanged)
137
+ return;
129
138
  if (dry) {
130
139
  log.info('publishing branch ' + branch);
131
140
  log.info(green('dry run complete!'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.130.0",
3
+ "version": "0.130.1",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "glyph": "🌰",
@@ -5,7 +5,7 @@ import type {Src_Json} from './src_json.js';
5
5
 
6
6
  export const package_json = {
7
7
  name: '@ryanatkn/gro',
8
- version: '0.130.0',
8
+ version: '0.130.1',
9
9
  description: 'task runner and toolkit extending SvelteKit',
10
10
  motto: 'generate, run, optimize',
11
11
  glyph: '🌰',
@@ -272,7 +272,7 @@ export const package_json = {
272
272
 
273
273
  export const src_json = {
274
274
  name: '@ryanatkn/gro',
275
- version: '0.130.0',
275
+ version: '0.130.1',
276
276
  modules: {
277
277
  '.': {
278
278
  path: 'index.ts',
@@ -114,6 +114,7 @@ export const task: Task<Args> = {
114
114
  }
115
115
 
116
116
  let version!: string;
117
+ let optional_and_version_unchanged = false;
117
118
 
118
119
  // Bump the version so the package.json is updated before building:
119
120
  // TODO problem here is build may fail and put us in a bad state,
@@ -159,17 +160,25 @@ export const task: Task<Args> = {
159
160
  // The version didn't change.
160
161
  // For now this is the best detection we have for a no-op `changeset version`.
161
162
  if (optional) {
162
- return; // exit gracefully
163
+ optional_and_version_unchanged = true;
163
164
  } else {
165
+ // Doesn't build if the version didn't change and publishing isn't optional.
164
166
  throw new Task_Error(`\`${changeset_cli} version\` failed: are there any changes?`);
165
167
  }
166
168
  }
167
169
  }
168
170
 
171
+ // Build after the version is bumped so the new version is in the build as needed.
169
172
  if (build) {
170
173
  await invoke_task('build');
171
174
  }
172
175
 
176
+ // Return early if there are no changes and publishing is optional, but after building,
177
+ // so if callers want to optimize away building
178
+ // they need to do so manually like in `gro release`.
179
+ // TODO this could be cleaned up if tasks had a return value to callers, it could specifiy that it didn't build
180
+ if (optional_and_version_unchanged) return;
181
+
173
182
  if (dry) {
174
183
  log.info('publishing branch ' + branch);
175
184
  log.info(green('dry run complete!'));