Debian Codegraph @

workspaces/arborist/test/fixtures/reify-cases/workspaces-add-new-dep.js

raw
1 // generated from test/fixtures/workspaces-add-new-dep
2 module.exports = t => {
3 const path = t.testdir({
4 "a": {
5 "package.json": JSON.stringify({
6 "name": "a",
7 "version": "1.0.0",
8 "dependencies": {
9 "abbrev": "^1.1.1"
10 }
11 })
12 },
13 "node_modules": {
14 ".package-lock.json": JSON.stringify({
15 "name": "workspaces-add-new-dep",
16 "lockfileVersion": 2,
17 "requires": true,
18 "packages": {
19 "a": {
20 "version": "1.0.0"
21 },
22 "node_modules/a": {
23 "resolved": "a",
24 "link": true
25 }
26 }
27 }),
28 "a": t.fixture('symlink', "../a"),
29 "pkg-a": t.fixture('symlink', "../a")
30 },
31 "package-lock.json": JSON.stringify({
32 "name": "workspaces-add-new-dep",
33 "lockfileVersion": 2,
34 "requires": true,
35 "packages": {
36 "": {
37 "workspaces": [
38 "a"
39 ]
40 },
41 "a": {
42 "version": "1.0.0"
43 },
44 "node_modules/a": {
45 "resolved": "a",
46 "link": true
47 }
48 },
49 "dependencies": {
50 "a": {
51 "version": "file:a"
52 }
53 }
54 }),
55 "package.json": JSON.stringify({
56 "name": "workspaces-add-new-dep",
57 "workspaces": [
58 "a"
59 ]
60 })
61 })
62 const {utimesSync} = require('fs')
63 const n = Date.now() + 10000
64 const {resolve} = require('path')
65
66 utimesSync(resolve(path, "node_modules/.package-lock.json"), new Date(n), new Date(n))
67 return path
68 }