github.com/evanw/esbuild@v0.21.4/internal/resolver/testExpectations.json (about)

     1  [{
     2    "manifest": {
     3      "__info": [],
     4      "dependencyTreeRoots": [{
     5        "name": "root",
     6        "reference": "workspace:."
     7      }],
     8      "ignorePatternData": null,
     9      "enableTopLevelFallback": false,
    10      "fallbackPool": [],
    11      "fallbackExclusionList": [],
    12      "packageRegistryData": [
    13        [null, [
    14          [null, {
    15            "packageLocation": "./",
    16            "packageDependencies": [["test", "npm:1.0.0"]],
    17            "linkType": "SOFT"
    18          }]
    19        ]],
    20        ["root", [
    21          ["workspace:.", {
    22            "packageLocation": "./",
    23            "packageDependencies": [["test", "npm:1.0.0"]],
    24            "linkType": "SOFT"
    25          }]
    26        ]],
    27        ["workspace-alias-dependency", [
    28          ["workspace:workspace-alias-dependency", {
    29            "packageLocation": "./workspace-alias-dependency/",
    30            "packageDependencies": [["alias", ["test", "npm:1.0.0"]]],
    31            "linkType": "SOFT"
    32          }]
    33        ]],
    34        ["workspace-self-dependency", [
    35          ["workspace:workspace-self-dependency", {
    36            "packageLocation": "./workspace-self-dependency/",
    37            "packageDependencies": [["workspace-self-dependency", "workspace:workspace-self-dependency"]],
    38            "linkType": "SOFT"
    39          }]
    40        ]],
    41        ["workspace-unfulfilled-peer-dependency", [
    42          ["workspace:workspace-unfulfilled-peer-dependency", {
    43            "packageLocation": "./workspace-unfulfilled-peer-dependency/",
    44            "packageDependencies": [["test", null]],
    45            "linkType": "SOFT"
    46          }]
    47        ]],
    48        ["longer", [
    49          ["workspace:longer", {
    50            "packageLocation": "./longer/",
    51            "packageDependencies": [["test", "npm:2.0.0"]],
    52            "linkType": "SOFT"
    53          }]
    54        ]],
    55        ["long", [
    56          ["workspace:long", {
    57            "packageLocation": "./long/",
    58            "packageDependencies": [["test", "npm:1.0.0"]],
    59            "linkType": "SOFT"
    60          }]
    61        ]],
    62        ["longerer", [
    63          ["workspace:longerer", {
    64            "packageLocation": "./longerer/",
    65            "packageDependencies": [["test", "npm:3.0.0"]],
    66            "linkType": "SOFT"
    67          }]
    68        ]],
    69        ["test", [
    70          ["npm:1.0.0", {
    71            "packageLocation": "./test-1.0.0/",
    72            "packageDependencies": [],
    73            "linkType": "HARD"
    74          }],
    75          ["npm:2.0.0", {
    76            "packageLocation": "./test-2.0.0/",
    77            "packageDependencies": [],
    78            "linkType": "HARD"
    79          }],
    80          ["npm:3.0.0", {
    81            "packageLocation": "./test-3.0.0/",
    82            "packageDependencies": [],
    83            "linkType": "HARD"
    84          }]
    85        ]]
    86      ]
    87    },
    88    "tests": [{
    89      "it": "should allow a package to import one of its dependencies",
    90      "imported": "test",
    91      "importer": "/path/to/project/",
    92      "expected": "/path/to/project/test-1.0.0/"
    93    }, {
    94      "it": "should allow a package to import itself, if specified in its own dependencies",
    95      "imported": "workspace-self-dependency",
    96      "importer": "/path/to/project/workspace-self-dependency/",
    97      "expected": "/path/to/project/workspace-self-dependency/"
    98    }, {
    99      "it": "should allow a package to import an aliased dependency",
   100      "imported": "alias",
   101      "importer": "/path/to/project/workspace-alias-dependency/",
   102      "expected": "/path/to/project/test-1.0.0/"
   103    }, {
   104      "it": "shouldn't allow a package to import something that isn't one of its dependencies",
   105      "imported": "missing-dependency",
   106      "importer": "/path/to/project/",
   107      "expected": "error!"
   108    }, {
   109      "it": "shouldn't accidentally discard the trailing slash from the package locations",
   110      "imported": "test",
   111      "importer": "/path/to/project/long/",
   112      "expected": "/path/to/project/test-1.0.0/"
   113    }, {
   114      "it": "should throw an exception when trying to access an unfulfilled peer dependency",
   115      "imported": "test",
   116      "importer": "/path/to/project/workspace-unfulfilled-peer-dependency/",
   117      "expected": "error!"
   118    }]
   119  }, {
   120    "manifest": {
   121      "__info": [],
   122      "dependencyTreeRoots": [{
   123        "name": "root",
   124        "reference": "workspace:."
   125      }],
   126      "ignorePatternData": null,
   127      "enableTopLevelFallback": true,
   128      "fallbackPool": [
   129        ["test-2", "npm:1.0.0"],
   130        ["alias", ["test-1", "npm:1.0.0"]]
   131      ],
   132      "fallbackExclusionList": [[
   133        "workspace-no-fallbacks",
   134        ["workspace:workspace-no-fallbacks"]
   135      ]],
   136      "packageRegistryData": [
   137        [null, [
   138          [null, {
   139            "packageLocation": "./",
   140            "packageDependencies": [["test-1", "npm:1.0.0"]],
   141            "linkType": "SOFT"
   142          }]
   143        ]],
   144        ["root", [
   145          ["workspace:.", {
   146            "packageLocation": "./",
   147            "packageDependencies": [["test-1", "npm:1.0.0"]],
   148            "linkType": "SOFT"
   149          }]
   150        ]],
   151        ["workspace-no-fallbacks", [
   152          ["workspace:workspace-no-fallbacks", {
   153            "packageLocation": "./workspace-no-fallbacks/",
   154            "packageDependencies": [],
   155            "linkType": "SOFT"
   156          }]
   157        ]],
   158        ["workspace-with-fallbacks", [
   159          ["workspace:workspace-with-fallbacks", {
   160            "packageLocation": "./workspace-with-fallbacks/",
   161            "packageDependencies": [],
   162            "linkType": "SOFT"
   163          }]
   164        ]],
   165        ["workspace-unfulfilled-peer-dependency", [
   166          ["workspace:workspace-unfulfilled-peer-dependency", {
   167            "packageLocation": "./workspace-unfulfilled-peer-dependency/",
   168            "packageDependencies": [
   169              ["test-1", null],
   170              ["test-2", null]
   171            ],
   172            "linkType": "SOFT"
   173          }]
   174        ]],
   175        ["test-1", [
   176          ["npm:1.0.0", {
   177            "packageLocation": "./test-1/",
   178            "packageDependencies": [],
   179            "linkType": "HARD"
   180          }]
   181        ]],
   182        ["test-2", [
   183          ["npm:1.0.0", {
   184            "packageLocation": "./test-2/",
   185            "packageDependencies": [],
   186            "linkType": "HARD"
   187          }]
   188        ]]
   189      ]
   190    },
   191    "tests": [{
   192      "it": "should allow resolution coming from the fallback pool if enableTopLevelFallback is set to true",
   193      "imported": "test-1",
   194      "importer": "/path/to/project/",
   195      "expected": "/path/to/project/test-1/"
   196    }, {
   197      "it": "should allow the fallback pool to contain aliases",
   198      "imported": "alias",
   199      "importer": "/path/to/project/",
   200      "expected": "/path/to/project/test-1/"
   201    }, {
   202      "it": "shouldn't use the fallback pool when the importer package is listed in fallbackExclusionList",
   203      "imported": "test-1",
   204      "importer": "/path/to/project/workspace-no-fallbacks/",
   205      "expected": "error!"
   206    }, {
   207      "it": "should implicitly use the top-level package dependencies as part of the fallback pool",
   208      "imported": "test-2",
   209      "importer": "/path/to/project/workspace-with-fallbacks/",
   210      "expected": "/path/to/project/test-2/"
   211    }, {
   212      "it": "should throw an error if a resolution isn't in in the package dependencies, nor inside the fallback pool",
   213      "imported": "test-3",
   214      "importer": "/path/to/project/workspace-with-fallbacks/",
   215      "expected": "error!"
   216    }, {
   217      "it": "should use the top-level fallback if a dependency is missing because of an unfulfilled peer dependency",
   218      "imported": "test-1",
   219      "importer": "/path/to/project/workspace-unfulfilled-peer-dependency/",
   220      "expected": "/path/to/project/test-1/"
   221    }, {
   222      "it": "should use the fallback pool if a dependency is missing because of an unfulfilled peer dependency",
   223      "imported": "test-2",
   224      "importer": "/path/to/project/workspace-unfulfilled-peer-dependency/",
   225      "expected": "/path/to/project/test-2/"
   226    }]
   227  }, {
   228    "manifest": {
   229      "__info": [],
   230      "dependencyTreeRoots": [{
   231        "name": "root",
   232        "reference": "workspace:."
   233      }],
   234      "ignorePatternData": null,
   235      "enableTopLevelFallback": false,
   236      "fallbackPool": [
   237        ["test", "npm:1.0.0"]
   238      ],
   239      "fallbackExclusionList": [],
   240      "packageRegistryData": [
   241        [null, [
   242          [null, {
   243            "packageLocation": "./",
   244            "packageDependencies": [],
   245            "linkType": "SOFT"
   246          }]
   247        ]],
   248        ["root", [
   249          ["workspace:.", {
   250            "packageLocation": "./",
   251            "packageDependencies": [],
   252            "linkType": "SOFT"
   253          }]
   254        ]],
   255        ["test", [
   256          ["npm:1.0.0", {
   257            "packageLocation": "./test-1/",
   258            "packageDependencies": [],
   259            "linkType": "HARD"
   260          }]
   261        ]]
   262      ]
   263    },
   264    "tests": [{
   265      "it": "should ignore the fallback pool if enableTopLevelFallback is set to false",
   266      "imported": "test",
   267      "importer": "/path/to/project/",
   268      "expected": "error!"
   269    }]
   270  }, {
   271    "manifest": {
   272      "__info": [],
   273      "dependencyTreeRoots": [{
   274        "name": "root",
   275        "reference": "workspace:."
   276      }],
   277      "ignorePatternData": "^not-a-workspace(/|$)",
   278      "enableTopLevelFallback": false,
   279      "fallbackPool": [],
   280      "fallbackExclusionList": [],
   281      "packageRegistryData": [
   282        [null, [
   283          [null, {
   284            "packageLocation": "./",
   285            "packageDependencies": [],
   286            "linkType": "SOFT"
   287          }]
   288        ]],
   289        ["root", [
   290          ["workspace:.", {
   291            "packageLocation": "./",
   292            "packageDependencies": [["test", "npm:1.0.0"]],
   293            "linkType": "SOFT"
   294          }]
   295        ]],
   296        ["test", [
   297          ["npm:1.0.0", {
   298            "packageLocation": "./test/",
   299            "packageDependencies": [],
   300            "linkType": "HARD"
   301          }]
   302        ]]
   303      ]
   304    },
   305    "tests": [{
   306      "it": "shouldn't go through PnP when trying to resolve dependencies from packages covered by ignorePatternData",
   307      "imported": "test",
   308      "importer": "/path/to/project/not-a-workspace/",
   309      "expected": "error!"
   310    }]
   311  }]