stonyx 0.2.3-alpha.51 → 0.2.3-alpha.52

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 (2) hide show
  1. package/dist/cli/new.js +12 -5
  2. package/package.json +1 -1
package/dist/cli/new.js CHANGED
@@ -147,10 +147,18 @@ export function releaseTagFor(version) {
147
147
  return identifier;
148
148
  }
149
149
  export function generatePackageJson(name, selectedModules, coreVersion = readCoreVersion()) {
150
- // `coreVersion` is injectable for tests, so the shape is asserted here too --
151
- // otherwise an injected non-semver string reaches the manifest verbatim and
152
- // `releaseTagFor` falls through to `latest`.
153
- assertVersionShape(coreVersion, 'the supplied core version');
150
+ // Resolved first, before anything is emitted, and unconditionally -- deliberately
151
+ // not inside the module loop below. `releaseTagFor` asserts the version's shape as
152
+ // its first act, so this one call is also what stops an injected non-semver
153
+ // `coreVersion` from reaching the manifest verbatim.
154
+ //
155
+ // A second `assertVersionShape(coreVersion, ...)` stood at the top of this function
156
+ // until abofs/stonyx#118's review: deleting it left the suite green, because this
157
+ // call already rejects the same value on every path. It was removed rather than
158
+ // left as decoration. The invariant that replaces it is positional -- keep this
159
+ // call above the emission and the guard stays load-bearing; push it under an
160
+ // `if (selectedModules.length)` and the core becomes unvalidated again.
161
+ const moduleTag = releaseTagFor(coreVersion);
154
162
  // The framework is a runtime dependency of the application, pinned exactly to
155
163
  // the core that generated the project.
156
164
  const dependencies = { stonyx: coreVersion };
@@ -161,7 +169,6 @@ export function generatePackageJson(name, selectedModules, coreVersion = readCor
161
169
  };
162
170
  // Modules are discovered from devDependencies (see docs/modules.md), and are
163
171
  // requested on the core's own release line rather than at `latest`.
164
- const moduleTag = releaseTagFor(coreVersion);
165
172
  for (const mod of selectedModules) {
166
173
  devDependencies[mod.package] = moduleTag;
167
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stonyx",
3
- "version": "0.2.3-alpha.51",
3
+ "version": "0.2.3-alpha.52",
4
4
  "description": "Base stonyx framework module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",