projen 0.50.5 → 0.50.9
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/.jsii +2 -2
- package/changelog.md +1 -6
- package/lib/awscdk/auto-discover.js +1 -1
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/cli/cmds/new.js +21 -4
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose.js +2 -2
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +1 -1
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +3 -3
- package/lib/version.js +1 -1
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/graceful-fs/package.json +1 -1
- package/node_modules/graceful-fs/polyfills.js +4 -2
- package/node_modules/is-core-module/.eslintrc +0 -1
- package/node_modules/is-core-module/CHANGELOG.md +10 -0
- package/node_modules/is-core-module/core.json +5 -5
- package/node_modules/is-core-module/package.json +7 -7
- package/node_modules/resolve/.eslintrc +33 -8
- package/node_modules/resolve/.github/FUNDING.yml +12 -0
- package/node_modules/resolve/appveyor.yml +4 -2
- package/node_modules/resolve/async.js +3 -0
- package/node_modules/resolve/bin/resolve +47 -0
- package/node_modules/resolve/lib/core.js +1 -2
- package/node_modules/resolve/lib/core.json +81 -12
- package/node_modules/resolve/lib/node-modules-paths.js +1 -1
- package/node_modules/resolve/lib/sync.js +4 -4
- package/node_modules/resolve/package.json +18 -12
- package/node_modules/resolve/readme.markdown +35 -13
- package/node_modules/resolve/sync.js +3 -0
- package/node_modules/resolve/test/mock_sync.js +2 -4
- package/node_modules/resolve/test/node_path.js +1 -1
- package/node_modules/resolve/test/resolver/invalid_main/package.json +1 -1
- package/node_modules/resolve/test/resolver/malformed_package_json/index.js +0 -0
- package/node_modules/resolve/test/resolver/malformed_package_json/package.json +1 -0
- package/node_modules/resolve/test/resolver.js +99 -3
- package/node_modules/resolve/test/resolver_sync.js +88 -3
- package/node_modules/supports-preserve-symlinks-flag/.eslintrc +14 -0
- package/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +12 -0
- package/node_modules/supports-preserve-symlinks-flag/.nycrc +9 -0
- package/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +22 -0
- package/node_modules/supports-preserve-symlinks-flag/LICENSE +21 -0
- package/node_modules/supports-preserve-symlinks-flag/README.md +42 -0
- package/node_modules/supports-preserve-symlinks-flag/browser.js +3 -0
- package/node_modules/supports-preserve-symlinks-flag/index.js +9 -0
- package/node_modules/supports-preserve-symlinks-flag/package.json +70 -0
- package/node_modules/supports-preserve-symlinks-flag/test/index.js +29 -0
- package/node_modules/xmlbuilder2/node_modules/@types/node/README.md +1 -1
- package/node_modules/xmlbuilder2/node_modules/@types/node/net.d.ts +1 -0
- package/node_modules/xmlbuilder2/node_modules/@types/node/package.json +2 -2
- package/node_modules/xmlbuilder2/node_modules/@types/node/process.d.ts +1 -1
- package/package.json +3 -3
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
- package/node_modules/is-core-module/.eslintignore +0 -1
- package/node_modules/resolve/.eslintignore +0 -1
- package/node_modules/resolve/test/.eslintrc +0 -5
|
@@ -1,83 +1,152 @@
|
|
|
1
1
|
{
|
|
2
2
|
"assert": true,
|
|
3
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
3
4
|
"assert/strict": ">= 15",
|
|
5
|
+
"node:assert/strict": ">= 16",
|
|
4
6
|
"async_hooks": ">= 8",
|
|
7
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
5
8
|
"buffer_ieee754": "< 0.9.7",
|
|
6
9
|
"buffer": true,
|
|
10
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
7
11
|
"child_process": true,
|
|
12
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
8
13
|
"cluster": true,
|
|
14
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
9
15
|
"console": true,
|
|
16
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
10
17
|
"constants": true,
|
|
18
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
11
19
|
"crypto": true,
|
|
20
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
12
21
|
"_debug_agent": ">= 1 && < 8",
|
|
13
22
|
"_debugger": "< 8",
|
|
14
23
|
"dgram": true,
|
|
15
|
-
"
|
|
24
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
25
|
+
"diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
|
|
26
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
16
27
|
"dns": true,
|
|
28
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
17
29
|
"dns/promises": ">= 15",
|
|
30
|
+
"node:dns/promises": ">= 16",
|
|
18
31
|
"domain": ">= 0.7.12",
|
|
32
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
19
33
|
"events": true,
|
|
34
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
20
35
|
"freelist": "< 6",
|
|
21
36
|
"fs": true,
|
|
37
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
22
38
|
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
39
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
23
40
|
"_http_agent": ">= 0.11.1",
|
|
41
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
24
42
|
"_http_client": ">= 0.11.1",
|
|
43
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
25
44
|
"_http_common": ">= 0.11.1",
|
|
45
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
26
46
|
"_http_incoming": ">= 0.11.1",
|
|
47
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
27
48
|
"_http_outgoing": ">= 0.11.1",
|
|
49
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
28
50
|
"_http_server": ">= 0.11.1",
|
|
51
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
29
52
|
"http": true,
|
|
53
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
30
54
|
"http2": ">= 8.8",
|
|
55
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
31
56
|
"https": true,
|
|
32
|
-
"
|
|
57
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
58
|
+
"inspector": ">= 8",
|
|
59
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
33
60
|
"_linklist": "< 8",
|
|
34
61
|
"module": true,
|
|
62
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
35
63
|
"net": true,
|
|
36
|
-
"node
|
|
37
|
-
"node-inspect/lib/
|
|
38
|
-
"node-inspect/lib/internal/
|
|
64
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
65
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
66
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
67
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
39
68
|
"os": true,
|
|
69
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
40
70
|
"path": true,
|
|
71
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
41
72
|
"path/posix": ">= 15.3",
|
|
73
|
+
"node:path/posix": ">= 16",
|
|
42
74
|
"path/win32": ">= 15.3",
|
|
75
|
+
"node:path/win32": ">= 16",
|
|
43
76
|
"perf_hooks": ">= 8.5",
|
|
77
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
44
78
|
"process": ">= 1",
|
|
79
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
45
80
|
"punycode": true,
|
|
81
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
46
82
|
"querystring": true,
|
|
83
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
47
84
|
"readline": true,
|
|
85
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
86
|
+
"readline/promises": ">= 17",
|
|
87
|
+
"node:readline/promises": ">= 17",
|
|
48
88
|
"repl": true,
|
|
89
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
49
90
|
"smalloc": ">= 0.11.5 && < 3",
|
|
50
91
|
"_stream_duplex": ">= 0.9.4",
|
|
92
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
|
|
51
93
|
"_stream_transform": ">= 0.9.4",
|
|
94
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
|
|
52
95
|
"_stream_wrap": ">= 1.4.1",
|
|
96
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
53
97
|
"_stream_passthrough": ">= 0.9.4",
|
|
98
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
|
|
54
99
|
"_stream_readable": ">= 0.9.4",
|
|
100
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
|
|
55
101
|
"_stream_writable": ">= 0.9.4",
|
|
102
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
|
|
56
103
|
"stream": true,
|
|
104
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
105
|
+
"stream/consumers": ">= 16.7",
|
|
106
|
+
"node:stream/consumers": ">= 16.7",
|
|
57
107
|
"stream/promises": ">= 15",
|
|
108
|
+
"node:stream/promises": ">= 16",
|
|
109
|
+
"stream/web": ">= 16.5",
|
|
110
|
+
"node:stream/web": ">= 16.5",
|
|
58
111
|
"string_decoder": true,
|
|
112
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
59
113
|
"sys": [">= 0.6 && < 0.7", ">= 0.8"],
|
|
114
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
60
115
|
"timers": true,
|
|
116
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
61
117
|
"timers/promises": ">= 15",
|
|
118
|
+
"node:timers/promises": ">= 16",
|
|
62
119
|
"_tls_common": ">= 0.11.13",
|
|
120
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
63
121
|
"_tls_legacy": ">= 0.11.3 && < 10",
|
|
64
122
|
"_tls_wrap": ">= 0.11.3",
|
|
123
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
65
124
|
"tls": true,
|
|
125
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
66
126
|
"trace_events": ">= 10",
|
|
127
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
67
128
|
"tty": true,
|
|
129
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
68
130
|
"url": true,
|
|
131
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
69
132
|
"util": true,
|
|
133
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
70
134
|
"util/types": ">= 15.3",
|
|
135
|
+
"node:util/types": ">= 16",
|
|
71
136
|
"v8/tools/arguments": ">= 10 && < 12",
|
|
72
|
-
"v8/tools/codemap": [">= 4.4
|
|
73
|
-
"v8/tools/consarray": [">= 4.4
|
|
74
|
-
"v8/tools/csvparser": [">= 4.4
|
|
75
|
-
"v8/tools/logreader": [">= 4.4
|
|
76
|
-
"v8/tools/profile_view": [">= 4.4
|
|
77
|
-
"v8/tools/splaytree": [">= 4.4
|
|
137
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
138
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
139
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
140
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
141
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
142
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
78
143
|
"v8": ">= 1",
|
|
144
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
79
145
|
"vm": true,
|
|
146
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
80
147
|
"wasi": ">= 13.4 && < 13.5",
|
|
81
148
|
"worker_threads": ">= 11.7",
|
|
82
|
-
"
|
|
149
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
150
|
+
"zlib": true,
|
|
151
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
83
152
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var path = require('path');
|
|
2
|
-
var parse = path.parse || require('path-parse');
|
|
2
|
+
var parse = path.parse || require('path-parse'); // eslint-disable-line global-require
|
|
3
3
|
|
|
4
4
|
var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
|
|
5
5
|
var prefix = '/';
|
|
@@ -9,22 +9,22 @@ var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function'
|
|
|
9
9
|
|
|
10
10
|
var defaultIsFile = function isFile(file) {
|
|
11
11
|
try {
|
|
12
|
-
var stat = fs.statSync(file);
|
|
12
|
+
var stat = fs.statSync(file, { throwIfNoEntry: false });
|
|
13
13
|
} catch (e) {
|
|
14
14
|
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
|
|
15
15
|
throw e;
|
|
16
16
|
}
|
|
17
|
-
return stat.isFile() || stat.isFIFO();
|
|
17
|
+
return !!stat && (stat.isFile() || stat.isFIFO());
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
var defaultIsDir = function isDirectory(dir) {
|
|
21
21
|
try {
|
|
22
|
-
var stat = fs.statSync(dir);
|
|
22
|
+
var stat = fs.statSync(dir, { throwIfNoEntry: false });
|
|
23
23
|
} catch (e) {
|
|
24
24
|
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
|
|
25
25
|
throw e;
|
|
26
26
|
}
|
|
27
|
-
return stat.isDirectory();
|
|
27
|
+
return !!stat && stat.isDirectory();
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
var defaultRealpathSync = function realpathSync(x) {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolve",
|
|
3
3
|
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.21.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git://github.com/browserify/resolve.git"
|
|
8
8
|
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"resolve": "./bin/resolve"
|
|
11
|
+
},
|
|
9
12
|
"main": "index.js",
|
|
10
13
|
"keywords": [
|
|
11
14
|
"resolve",
|
|
@@ -14,9 +17,10 @@
|
|
|
14
17
|
"module"
|
|
15
18
|
],
|
|
16
19
|
"scripts": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
+
"prepublishOnly": "safe-publish-latest && cp node_modules/is-core-module/core.json ./lib/ ||:",
|
|
21
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
22
|
+
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
|
|
23
|
+
"lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'",
|
|
20
24
|
"pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
|
|
21
25
|
"tests-only": "tape test/*.js",
|
|
22
26
|
"pretest": "npm run lint",
|
|
@@ -25,15 +29,16 @@
|
|
|
25
29
|
"test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
|
|
26
30
|
},
|
|
27
31
|
"devDependencies": {
|
|
28
|
-
"@ljharb/eslint-config": "^
|
|
29
|
-
"array.prototype.map": "^1.0.
|
|
30
|
-
"aud": "^1.1.
|
|
32
|
+
"@ljharb/eslint-config": "^20.1.0",
|
|
33
|
+
"array.prototype.map": "^1.0.4",
|
|
34
|
+
"aud": "^1.1.5",
|
|
31
35
|
"eclint": "^2.8.1",
|
|
32
|
-
"eslint": "^
|
|
36
|
+
"eslint": "^8.6.0",
|
|
37
|
+
"in-publish": "^2.0.1",
|
|
33
38
|
"object-keys": "^1.1.1",
|
|
34
|
-
"safe-publish-latest": "^
|
|
39
|
+
"safe-publish-latest": "^2.0.0",
|
|
35
40
|
"tap": "0.4.13",
|
|
36
|
-
"tape": "^5.
|
|
41
|
+
"tape": "^5.4.0"
|
|
37
42
|
},
|
|
38
43
|
"license": "MIT",
|
|
39
44
|
"author": {
|
|
@@ -45,7 +50,8 @@
|
|
|
45
50
|
"url": "https://github.com/sponsors/ljharb"
|
|
46
51
|
},
|
|
47
52
|
"dependencies": {
|
|
48
|
-
"is-core-module": "^2.
|
|
49
|
-
"path-parse": "^1.0.
|
|
53
|
+
"is-core-module": "^2.8.0",
|
|
54
|
+
"path-parse": "^1.0.7",
|
|
55
|
+
"supports-preserve-symlinks-flag": "^1.0.0"
|
|
50
56
|
}
|
|
51
57
|
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
# resolve
|
|
1
|
+
# resolve <sup>[![Version Badge][2]][1]</sup>
|
|
2
2
|
|
|
3
|
-
implements the [node `require.resolve()`
|
|
4
|
-
algorithm](https://nodejs.org/api/modules.html#modules_all_together)
|
|
5
|
-
such that you can `require.resolve()` on behalf of a file asynchronously and
|
|
6
|
-
synchronously
|
|
3
|
+
implements the [node `require.resolve()` algorithm](https://nodejs.org/api/modules.html#modules_all_together) such that you can `require.resolve()` on behalf of a file asynchronously and synchronously
|
|
7
4
|
|
|
8
|
-
[![
|
|
5
|
+
[![github actions][actions-image]][actions-url]
|
|
6
|
+
[![coverage][codecov-image]][codecov-url]
|
|
7
|
+
[![dependency status][5]][6]
|
|
8
|
+
[![dev dependency status][7]][8]
|
|
9
|
+
[![License][license-image]][license-url]
|
|
10
|
+
[![Downloads][downloads-image]][downloads-url]
|
|
11
|
+
|
|
12
|
+
[![npm badge][11]][1]
|
|
9
13
|
|
|
10
14
|
# example
|
|
11
15
|
|
|
12
16
|
asynchronously resolve:
|
|
13
17
|
|
|
14
18
|
```js
|
|
15
|
-
var resolve = require('resolve');
|
|
19
|
+
var resolve = require('resolve/async'); // or, require('resolve')
|
|
16
20
|
resolve('tap', { basedir: __dirname }, function (err, res) {
|
|
17
21
|
if (err) console.error(err);
|
|
18
22
|
else console.log(res);
|
|
@@ -27,8 +31,8 @@ $ node example/async.js
|
|
|
27
31
|
synchronously resolve:
|
|
28
32
|
|
|
29
33
|
```js
|
|
30
|
-
var resolve = require('resolve');
|
|
31
|
-
var res = resolve
|
|
34
|
+
var resolve = require('resolve/sync'); // or, `require('resolve').sync
|
|
35
|
+
var res = resolve('tap', { basedir: __dirname });
|
|
32
36
|
console.log(res);
|
|
33
37
|
```
|
|
34
38
|
|
|
@@ -41,6 +45,8 @@ $ node example/sync.js
|
|
|
41
45
|
|
|
42
46
|
```js
|
|
43
47
|
var resolve = require('resolve');
|
|
48
|
+
var async = require('resolve/async');
|
|
49
|
+
var sync = require('resolve/sync');
|
|
44
50
|
```
|
|
45
51
|
|
|
46
52
|
For both the synchronous and asynchronous methods, errors may have any of the following `err.code` values:
|
|
@@ -67,7 +73,7 @@ options are:
|
|
|
67
73
|
|
|
68
74
|
* opts.isFile - function to asynchronously test whether a file exists
|
|
69
75
|
|
|
70
|
-
* opts.isDirectory - function to asynchronously test whether a
|
|
76
|
+
* opts.isDirectory - function to asynchronously test whether a file exists and is a directory
|
|
71
77
|
|
|
72
78
|
* opts.realpath - function to asynchronously resolve a potential symlink to its real path
|
|
73
79
|
|
|
@@ -79,7 +85,7 @@ options are:
|
|
|
79
85
|
* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field
|
|
80
86
|
* pkg - package data
|
|
81
87
|
* pkgfile - path to package.json
|
|
82
|
-
* dir - directory
|
|
88
|
+
* dir - directory that contains package.json
|
|
83
89
|
|
|
84
90
|
* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package
|
|
85
91
|
* pkg - package data
|
|
@@ -177,7 +183,7 @@ options are:
|
|
|
177
183
|
|
|
178
184
|
* opts.isFile - function to synchronously test whether a file exists
|
|
179
185
|
|
|
180
|
-
* opts.isDirectory - function to synchronously test whether a
|
|
186
|
+
* opts.isDirectory - function to synchronously test whether a file exists and is a directory
|
|
181
187
|
|
|
182
188
|
* opts.realpathSync - function to synchronously resolve a potential symlink to its real path
|
|
183
189
|
|
|
@@ -187,7 +193,7 @@ options are:
|
|
|
187
193
|
|
|
188
194
|
* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field
|
|
189
195
|
* pkg - package data
|
|
190
|
-
* dir - directory
|
|
196
|
+
* dir - directory that contains package.json (Note: the second argument will change to "pkgfile" in v2)
|
|
191
197
|
|
|
192
198
|
* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package
|
|
193
199
|
* pkg - package data
|
|
@@ -277,3 +283,19 @@ npm install resolve
|
|
|
277
283
|
# license
|
|
278
284
|
|
|
279
285
|
MIT
|
|
286
|
+
|
|
287
|
+
[1]: https://npmjs.org/package/resolve
|
|
288
|
+
[2]: https://versionbadg.es/browserify/resolve.svg
|
|
289
|
+
[5]: https://david-dm.org/browserify/resolve.svg
|
|
290
|
+
[6]: https://david-dm.org/browserify/resolve
|
|
291
|
+
[7]: https://david-dm.org/browserify/resolve/dev-status.svg
|
|
292
|
+
[8]: https://david-dm.org/browserify/resolve#info=devDependencies
|
|
293
|
+
[11]: https://nodei.co/npm/resolve.png?downloads=true&stars=true
|
|
294
|
+
[license-image]: https://img.shields.io/npm/l/resolve.svg
|
|
295
|
+
[license-url]: LICENSE
|
|
296
|
+
[downloads-image]: https://img.shields.io/npm/dm/resolve.svg
|
|
297
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=resolve
|
|
298
|
+
[codecov-image]: https://codecov.io/gh/browserify/resolve/branch/main/graphs/badge.svg
|
|
299
|
+
[codecov-url]: https://app.codecov.io/gh/browserify/resolve/
|
|
300
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/resolve
|
|
301
|
+
[actions-url]: https://github.com/browserify/resolve/actions
|
|
@@ -122,9 +122,8 @@ test('symlinked', function (t) {
|
|
|
122
122
|
var dir = path.dirname(resolved);
|
|
123
123
|
var base = path.basename(resolved);
|
|
124
124
|
return path.join(dir, 'symlinked', base);
|
|
125
|
-
} else {
|
|
126
|
-
return path.join(resolved, 'symlinked');
|
|
127
125
|
}
|
|
126
|
+
return path.join(resolved, 'symlinked');
|
|
128
127
|
}
|
|
129
128
|
};
|
|
130
129
|
}
|
|
@@ -183,9 +182,8 @@ test('readPackageSync', function (t) {
|
|
|
183
182
|
var readPackageSync = function (readFileSync, file) {
|
|
184
183
|
if (file.indexOf(path.join('bar', 'package.json')) >= 0) {
|
|
185
184
|
return { main: './something-else.js' };
|
|
186
|
-
} else {
|
|
187
|
-
return JSON.parse(files[path.resolve(file)]);
|
|
188
185
|
}
|
|
186
|
+
return JSON.parse(files[path.resolve(file)]);
|
|
189
187
|
};
|
|
190
188
|
|
|
191
189
|
t.test('with readPackage', function (st) {
|
|
@@ -63,7 +63,7 @@ test('$NODE_PATH', function (t) {
|
|
|
63
63
|
basedir: path.join(__dirname, 'node_path/x'),
|
|
64
64
|
isDirectory: isDir
|
|
65
65
|
}, function (err, res) {
|
|
66
|
-
var root = require('tap/package.json').main;
|
|
66
|
+
var root = require('tap/package.json').main; // eslint-disable-line global-require
|
|
67
67
|
t.error(err);
|
|
68
68
|
t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves');
|
|
69
69
|
});
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
var path = require('path');
|
|
2
2
|
var test = require('tape');
|
|
3
3
|
var resolve = require('../');
|
|
4
|
+
var async = require('../async');
|
|
5
|
+
|
|
6
|
+
test('`./async` entry point', function (t) {
|
|
7
|
+
t.equal(resolve, async, '`./async` entry point is the same as `main`');
|
|
8
|
+
t.end();
|
|
9
|
+
});
|
|
4
10
|
|
|
5
11
|
test('async foo', function (t) {
|
|
6
12
|
t.plan(12);
|
|
@@ -288,7 +294,7 @@ test('without basedir', function (t) {
|
|
|
288
294
|
t.plan(1);
|
|
289
295
|
|
|
290
296
|
var dir = path.join(__dirname, 'resolver/without_basedir');
|
|
291
|
-
var tester = require(path.join(dir, 'main.js'));
|
|
297
|
+
var tester = require(path.join(dir, 'main.js')); // eslint-disable-line global-require
|
|
292
298
|
|
|
293
299
|
tester(t, function (err, res, pkg) {
|
|
294
300
|
if (err) {
|
|
@@ -404,7 +410,7 @@ test('non-string "main" field in package.json', function (t) {
|
|
|
404
410
|
var dir = path.join(__dirname, 'resolver');
|
|
405
411
|
resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) {
|
|
406
412
|
t.ok(err, 'errors on non-string main');
|
|
407
|
-
t.equal(err.message, 'package “
|
|
413
|
+
t.equal(err.message, 'package “invalid_main” `main` must be a string');
|
|
408
414
|
t.equal(err.code, 'INVALID_PACKAGE_MAIN');
|
|
409
415
|
t.equal(res, undefined, 'res is undefined');
|
|
410
416
|
t.equal(pkg, undefined, 'pkg is undefined');
|
|
@@ -417,7 +423,7 @@ test('non-string "main" field in package.json', function (t) {
|
|
|
417
423
|
var dir = path.join(__dirname, 'resolver');
|
|
418
424
|
resolve('./invalid_main', { basedir: dir }, function (err, res, pkg) {
|
|
419
425
|
t.ok(err, 'errors on non-string main');
|
|
420
|
-
t.equal(err.message, 'package “
|
|
426
|
+
t.equal(err.message, 'package “invalid_main” `main` must be a string');
|
|
421
427
|
t.equal(err.code, 'INVALID_PACKAGE_MAIN');
|
|
422
428
|
t.equal(res, undefined, 'res is undefined');
|
|
423
429
|
t.equal(pkg, undefined, 'pkg is undefined');
|
|
@@ -448,3 +454,93 @@ test('browser field in package.json', function (t) {
|
|
|
448
454
|
}
|
|
449
455
|
);
|
|
450
456
|
});
|
|
457
|
+
|
|
458
|
+
test('absolute paths', function (t) {
|
|
459
|
+
t.plan(4);
|
|
460
|
+
|
|
461
|
+
var extensionless = __filename.slice(0, -path.extname(__filename).length);
|
|
462
|
+
|
|
463
|
+
resolve(__filename, function (err, res) {
|
|
464
|
+
t.equal(
|
|
465
|
+
res,
|
|
466
|
+
__filename,
|
|
467
|
+
'absolute path to this file resolves'
|
|
468
|
+
);
|
|
469
|
+
});
|
|
470
|
+
resolve(extensionless, function (err, res) {
|
|
471
|
+
t.equal(
|
|
472
|
+
res,
|
|
473
|
+
__filename,
|
|
474
|
+
'extensionless absolute path to this file resolves'
|
|
475
|
+
);
|
|
476
|
+
});
|
|
477
|
+
resolve(__filename, { basedir: process.cwd() }, function (err, res) {
|
|
478
|
+
t.equal(
|
|
479
|
+
res,
|
|
480
|
+
__filename,
|
|
481
|
+
'absolute path to this file with a basedir resolves'
|
|
482
|
+
);
|
|
483
|
+
});
|
|
484
|
+
resolve(extensionless, { basedir: process.cwd() }, function (err, res) {
|
|
485
|
+
t.equal(
|
|
486
|
+
res,
|
|
487
|
+
__filename,
|
|
488
|
+
'extensionless absolute path to this file with a basedir resolves'
|
|
489
|
+
);
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
test('malformed package.json', function (t) {
|
|
494
|
+
/* eslint operator-linebreak: ["error", "before"], function-paren-newline: "off" */
|
|
495
|
+
t.plan(
|
|
496
|
+
(3 * 3) // 3 sets of 3 assertions in the final callback
|
|
497
|
+
+ 2 // 1 readPackage call with malformed package.json
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
var basedir = path.join(__dirname, 'resolver/malformed_package_json');
|
|
501
|
+
var expected = path.join(basedir, 'index.js');
|
|
502
|
+
|
|
503
|
+
resolve('./index.js', { basedir: basedir }, function (err, res, pkg) {
|
|
504
|
+
t.error(err, 'no error');
|
|
505
|
+
t.equal(res, expected, 'malformed package.json is silently ignored');
|
|
506
|
+
t.equal(pkg, undefined, 'malformed package.json gives an undefined `pkg` argument');
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
resolve(
|
|
510
|
+
'./index.js',
|
|
511
|
+
{
|
|
512
|
+
basedir: basedir,
|
|
513
|
+
packageFilter: function (pkg, pkgfile, dir) {
|
|
514
|
+
t.fail('should not reach here');
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
function (err, res, pkg) {
|
|
518
|
+
t.error(err, 'with packageFilter: no error');
|
|
519
|
+
t.equal(res, expected, 'with packageFilter: malformed package.json is silently ignored');
|
|
520
|
+
t.equal(pkg, undefined, 'with packageFilter: malformed package.json gives an undefined `pkg` argument');
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
|
|
524
|
+
resolve(
|
|
525
|
+
'./index.js',
|
|
526
|
+
{
|
|
527
|
+
basedir: basedir,
|
|
528
|
+
readPackage: function (readFile, pkgfile, cb) {
|
|
529
|
+
t.equal(pkgfile, path.join(basedir, 'package.json'), 'readPackageSync: `pkgfile` is package.json path');
|
|
530
|
+
readFile(pkgfile, function (err, result) {
|
|
531
|
+
try {
|
|
532
|
+
cb(null, JSON.parse(result));
|
|
533
|
+
} catch (e) {
|
|
534
|
+
t.ok(e instanceof SyntaxError, 'readPackage: malformed package.json parses as a syntax error');
|
|
535
|
+
cb(null);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
function (err, res, pkg) {
|
|
541
|
+
t.error(err, 'with readPackage: no error');
|
|
542
|
+
t.equal(res, expected, 'with readPackage: malformed package.json is silently ignored');
|
|
543
|
+
t.equal(pkg, undefined, 'with readPackage: malformed package.json gives an undefined `pkg` argument');
|
|
544
|
+
}
|
|
545
|
+
);
|
|
546
|
+
});
|