@@ -240,6 +240,235 @@ exports[`test/arborist/reify.js TAP add a new pkg to a prefix that needs to be m
240240
241241`
242242
243+ exports[`test/arborist/reify.js TAP add deps to workspaces add a to root > lockfile added workspace as dep 1`] = `
244+ Object {
245+ "lockfileVersion": 3,
246+ "name": "tap-testdir-reify-add-deps-to-workspaces-add-a-to-root",
247+ "packages": Object {
248+ "": Object {
249+ "dependencies": Object {
250+ "a": "^1.2.3",
251+ "mkdirp": "^1.0.4",
252+ },
253+ "workspaces": Array [
254+ "packages/*",
255+ ],
256+ },
257+ "node_modules/a": Object {
258+ "link": true,
259+ "resolved": "packages/a",
260+ },
261+ "node_modules/b": Object {
262+ "link": true,
263+ "resolved": "packages/b",
264+ },
265+ "node_modules/minimist": Object {
266+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
267+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
268+ "version": "1.2.5",
269+ },
270+ "node_modules/mkdirp": Object {
271+ "bin": Object {
272+ "mkdirp": "bin/cmd.js",
273+ },
274+ "engines": Object {
275+ "node": ">=10",
276+ },
277+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
278+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
279+ "version": "1.0.4",
280+ },
281+ "packages/a": Object {
282+ "dependencies": Object {
283+ "mkdirp": "^0.5.0",
284+ },
285+ "version": "1.2.3",
286+ },
287+ "packages/a/node_modules/mkdirp": Object {
288+ "bin": Object {
289+ "mkdirp": "bin/cmd.js",
290+ },
291+ "dependencies": Object {
292+ "minimist": "^1.2.5",
293+ },
294+ "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
295+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
296+ "version": "0.5.5",
297+ },
298+ "packages/b": Object {
299+ "version": "1.2.3",
300+ },
301+ },
302+ "requires": true,
303+ }
304+ `
305+
306+ exports[`test/arborist/reify.js TAP add deps to workspaces add a to root > package.json added workspace as dep 1`] = `
307+ Object {
308+ "dependencies": Object {
309+ "a": "^1.2.3",
310+ "mkdirp": "^1.0.4",
311+ },
312+ "workspaces": Array [
313+ "packages/*",
314+ ],
315+ }
316+ `
317+
318+ exports[`test/arborist/reify.js TAP add deps to workspaces add a to root > returned tree 1`] = `
319+ ArboristNode {
320+ "children": Map {
321+ "a" => ArboristLink {
322+ "edgesIn": Set {
323+ EdgeIn {
324+ "from": "",
325+ "name": "a",
326+ "spec": "file:{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/a",
327+ "type": "workspace",
328+ },
329+ },
330+ "isWorkspace": true,
331+ "location": "node_modules/a",
332+ "name": "a",
333+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/node_modules/a",
334+ "realpath": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/a",
335+ "resolved": "file:../packages/a",
336+ "target": ArboristNode {
337+ "location": "packages/a",
338+ },
339+ "version": "1.2.3",
340+ },
341+ "b" => ArboristLink {
342+ "edgesIn": Set {
343+ EdgeIn {
344+ "from": "",
345+ "name": "b",
346+ "spec": "file:{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/b",
347+ "type": "workspace",
348+ },
349+ },
350+ "isWorkspace": true,
351+ "location": "node_modules/b",
352+ "name": "b",
353+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/node_modules/b",
354+ "realpath": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/b",
355+ "resolved": "file:../packages/b",
356+ "target": ArboristNode {
357+ "location": "packages/b",
358+ },
359+ "version": "1.2.3",
360+ },
361+ "minimist" => ArboristNode {
362+ "edgesIn": Set {
363+ EdgeIn {
364+ "from": "packages/a/node_modules/mkdirp",
365+ "name": "minimist",
366+ "spec": "^1.2.5",
367+ "type": "prod",
368+ },
369+ },
370+ "location": "node_modules/minimist",
371+ "name": "minimist",
372+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/node_modules/minimist",
373+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
374+ "version": "1.2.5",
375+ },
376+ "mkdirp" => ArboristNode {
377+ "edgesIn": Set {
378+ EdgeIn {
379+ "from": "",
380+ "name": "mkdirp",
381+ "spec": "^1.0.4",
382+ "type": "prod",
383+ },
384+ },
385+ "location": "node_modules/mkdirp",
386+ "name": "mkdirp",
387+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/node_modules/mkdirp",
388+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
389+ "version": "1.0.4",
390+ },
391+ },
392+ "edgesOut": Map {
393+ "a" => EdgeOut {
394+ "name": "a",
395+ "spec": "file:{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/a",
396+ "to": "node_modules/a",
397+ "type": "workspace",
398+ },
399+ "b" => EdgeOut {
400+ "name": "b",
401+ "spec": "file:{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/b",
402+ "to": "node_modules/b",
403+ "type": "workspace",
404+ },
405+ "mkdirp" => EdgeOut {
406+ "name": "mkdirp",
407+ "spec": "^1.0.4",
408+ "to": "node_modules/mkdirp",
409+ "type": "prod",
410+ },
411+ },
412+ "fsChildren": Set {
413+ ArboristNode {
414+ "children": Map {
415+ "mkdirp" => ArboristNode {
416+ "edgesIn": Set {
417+ EdgeIn {
418+ "from": "packages/a",
419+ "name": "mkdirp",
420+ "spec": "^0.5.0",
421+ "type": "prod",
422+ },
423+ },
424+ "edgesOut": Map {
425+ "minimist" => EdgeOut {
426+ "name": "minimist",
427+ "spec": "^1.2.5",
428+ "to": "node_modules/minimist",
429+ "type": "prod",
430+ },
431+ },
432+ "location": "packages/a/node_modules/mkdirp",
433+ "name": "mkdirp",
434+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/a/node_modules/mkdirp",
435+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
436+ "version": "0.5.5",
437+ },
438+ },
439+ "edgesOut": Map {
440+ "mkdirp" => EdgeOut {
441+ "name": "mkdirp",
442+ "spec": "^0.5.0",
443+ "to": "packages/a/node_modules/mkdirp",
444+ "type": "prod",
445+ },
446+ },
447+ "isWorkspace": true,
448+ "location": "packages/a",
449+ "name": "a",
450+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/a",
451+ "version": "1.2.3",
452+ },
453+ ArboristNode {
454+ "isWorkspace": true,
455+ "location": "packages/b",
456+ "name": "b",
457+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root/packages/b",
458+ "version": "1.2.3",
459+ },
460+ },
461+ "isProjectRoot": true,
462+ "location": "",
463+ "name": "tap-testdir-reify-add-deps-to-workspaces-add-a-to-root",
464+ "path": "{CWD}/test/arborist/tap-testdir-reify-add-deps-to-workspaces-add-a-to-root",
465+ "workspaces": Map {
466+ "a" => "packages/a",
467+ "b" => "packages/b",
468+ },
469+ }
470+ `
471+
243472exports[`test/arborist/reify.js TAP add deps to workspaces add mkdirp 0.5.0 to b > lockfile 1`] = `
244473Object {
245474 "dependencies": Object {
@@ -33222,7 +33451,7 @@ Object {
3322233451 "a": "github:foo/bar#baz",
3322333452 "b": "^1.2.3",
3322433453 "d": "npm:c@1.x <1.9.9",
33225- "e": "file:e ",
33454+ "e": "* ",
3322633455 "f": "git+https://user:pass@github.com/baz/quux.git#asdf",
3322733456 "g": "*",
3322833457 "h": "~1.2.3",
0 commit comments