uniweb 0.12.20 → 0.12.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -1
- package/package.json +7 -7
- package/partials/agents.md +41 -11
- package/partials/config-reference.hbs +1 -2
- package/src/commands/add.js +1 -87
- package/src/commands/build.js +2 -2
- package/src/commands/clone.js +337 -0
- package/src/commands/content.js +199 -0
- package/src/commands/deploy.js +27 -6
- package/src/commands/docs.js +2 -3
- package/src/commands/doctor.js +24 -5
- package/src/commands/org.js +66 -0
- package/src/commands/publish.js +4 -3
- package/src/commands/pull.js +238 -0
- package/src/commands/push.js +400 -0
- package/src/commands/register.js +274 -0
- package/src/commands/rename.js +10 -5
- package/src/commands/update.js +211 -245
- package/src/commands/validate.js +288 -0
- package/src/framework-index.json +11 -10
- package/src/index.js +155 -26
- package/src/templates/processor.js +41 -19
- package/src/utils/config.js +30 -2
- package/src/utils/dep-survey.js +99 -0
- package/src/utils/json-file.js +68 -0
- package/src/utils/placement.js +100 -0
- package/src/utils/pm.js +29 -0
- package/src/utils/registry-auth.js +380 -0
- package/src/utils/registry-orgs.js +179 -0
- package/src/utils/scaffold.js +18 -5
- package/src/utils/site-content-refs.js +21 -0
- package/src/utils/update-check.js +4 -2
- package/src/versions.js +11 -4
- package/templates/foundation/_gitignore +5 -0
- package/templates/site/_gitignore +5 -0
- package/templates/site/package.json.hbs +2 -2
- package/templates/workspace/_gitignore +33 -0
package/src/commands/rename.js
CHANGED
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
updateRootScripts,
|
|
55
55
|
} from '../utils/config.js'
|
|
56
56
|
import { discoverFoundations, discoverSites } from '../utils/discover.js'
|
|
57
|
+
import { writeJsonPreservingStyleAsync } from '../utils/json-file.js'
|
|
57
58
|
import { getExistingPackageNames, validatePackageName } from '../utils/names.js'
|
|
58
59
|
import { detectPackageManager, installCmd } from '../utils/pm.js'
|
|
59
60
|
import { getCliPrefix } from '../utils/interactive.js'
|
|
@@ -184,9 +185,10 @@ async function validateRenameName(rootDir, newName) {
|
|
|
184
185
|
* Rewrite the `name` field in a package.json file.
|
|
185
186
|
*/
|
|
186
187
|
async function rewritePackageJsonName(pkgPath, newName) {
|
|
187
|
-
const
|
|
188
|
+
const src = await readFile(pkgPath, 'utf-8')
|
|
189
|
+
const pkg = JSON.parse(src)
|
|
188
190
|
pkg.name = newName
|
|
189
|
-
await
|
|
191
|
+
await writeJsonPreservingStyleAsync(pkgPath, pkg, src)
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
// ─── Foundation rename ───────────────────────────────────────────
|
|
@@ -234,11 +236,13 @@ async function renameFoundation(rootDir, oldName, newName, prefix) {
|
|
|
234
236
|
for (const site of sites) {
|
|
235
237
|
const sitePkgPath = join(rootDir, site.path, 'package.json')
|
|
236
238
|
const siteYmlPath = join(rootDir, site.path, 'site.yml')
|
|
237
|
-
let pkg, ymlData
|
|
239
|
+
let pkg, pkgSrc, ymlData
|
|
238
240
|
try {
|
|
239
|
-
|
|
241
|
+
pkgSrc = await readFile(sitePkgPath, 'utf-8')
|
|
242
|
+
pkg = JSON.parse(pkgSrc)
|
|
240
243
|
} catch {
|
|
241
244
|
pkg = null
|
|
245
|
+
pkgSrc = null
|
|
242
246
|
}
|
|
243
247
|
try {
|
|
244
248
|
ymlData = yaml.load(await readFile(siteYmlPath, 'utf-8')) || {}
|
|
@@ -252,6 +256,7 @@ async function renameFoundation(rootDir, oldName, newName, prefix) {
|
|
|
252
256
|
path: site.path,
|
|
253
257
|
name: site.name,
|
|
254
258
|
pkg,
|
|
259
|
+
pkgSrc,
|
|
255
260
|
sitePkgPath,
|
|
256
261
|
siteYmlPath,
|
|
257
262
|
ymlData,
|
|
@@ -295,7 +300,7 @@ async function renameFoundation(rootDir, oldName, newName, prefix) {
|
|
|
295
300
|
s.pkg.dependencies[newName] = oldValue.startsWith('file:')
|
|
296
301
|
? `file:${newRel}`
|
|
297
302
|
: oldValue // npm-pinned, leave it; rename-then-republish is out of scope.
|
|
298
|
-
await
|
|
303
|
+
await writeJsonPreservingStyleAsync(s.sitePkgPath, s.pkg, s.pkgSrc)
|
|
299
304
|
}
|
|
300
305
|
if (s.ymlMatches) {
|
|
301
306
|
const newYmlData = { ...s.ymlData, foundation: newName }
|