ccdeck 3.50.0 → 3.52.0
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 +2 -0
- package/THIRD_PARTY_NOTICES.md +28 -0
- package/dist/web/assets/BrowserWatchModal-CRqdEVdh.js +1 -0
- package/dist/web/assets/IntegrationModal-BDzEIGSM.js +7 -0
- package/dist/web/assets/RadioPanel-BJlsCpnN.js +1 -0
- package/dist/web/assets/TrafficRadar-BGxw-hlO.js +8 -0
- package/dist/web/assets/UsageHistoryModal-C_WBpNIp.js +1 -0
- package/dist/web/assets/app-B53fC4gE.js +358 -0
- package/dist/web/assets/app-Co1HNGP8.css +1 -0
- package/dist/web/assets/{index-DSIUCKoe.js → index-D9nJhUJR.js} +1 -1
- package/dist/web/index.html +3 -3
- package/node_modules/bare-addon-resolve/LICENSE +201 -0
- package/node_modules/bare-addon-resolve/README.md +226 -0
- package/node_modules/bare-addon-resolve/index.d.ts +100 -0
- package/node_modules/bare-addon-resolve/index.js +531 -0
- package/node_modules/bare-addon-resolve/lib/errors.d.ts +16 -0
- package/node_modules/bare-addon-resolve/lib/errors.js +21 -0
- package/node_modules/bare-addon-resolve/package.json +57 -0
- package/node_modules/bare-module-resolve/LICENSE +201 -0
- package/node_modules/bare-module-resolve/README.md +322 -0
- package/node_modules/bare-module-resolve/index.d.ts +171 -0
- package/node_modules/bare-module-resolve/index.js +899 -0
- package/node_modules/bare-module-resolve/lib/errors.d.ts +31 -0
- package/node_modules/bare-module-resolve/lib/errors.js +37 -0
- package/node_modules/bare-module-resolve/package.json +56 -0
- package/node_modules/bare-semver/LICENSE +201 -0
- package/node_modules/bare-semver/README.md +147 -0
- package/node_modules/bare-semver/index.d.ts +61 -0
- package/node_modules/bare-semver/index.js +13 -0
- package/node_modules/bare-semver/lib/comparator.js +37 -0
- package/node_modules/bare-semver/lib/constants.js +7 -0
- package/node_modules/bare-semver/lib/errors.js +22 -0
- package/node_modules/bare-semver/lib/range.js +256 -0
- package/node_modules/bare-semver/lib/version.js +240 -0
- package/node_modules/bare-semver/package.json +43 -0
- package/node_modules/fs-native-extensions/CMakeLists.txt +118 -0
- package/node_modules/fs-native-extensions/LICENSE +201 -0
- package/node_modules/fs-native-extensions/README.md +160 -0
- package/node_modules/fs-native-extensions/binding.c +1825 -0
- package/node_modules/fs-native-extensions/binding.js +3 -0
- package/node_modules/fs-native-extensions/include/fs-ext.h +193 -0
- package/node_modules/fs-native-extensions/index.js +356 -0
- package/node_modules/fs-native-extensions/package.json +72 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/ios-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/ios-arm64-simulator/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/ios-x64-simulator/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/src/apple.c +197 -0
- package/node_modules/fs-native-extensions/src/linux.c +146 -0
- package/node_modules/fs-native-extensions/src/platform.h +51 -0
- package/node_modules/fs-native-extensions/src/posix.c +33 -0
- package/node_modules/fs-native-extensions/src/shared.c +397 -0
- package/node_modules/fs-native-extensions/src/win32/nt.h +226 -0
- package/node_modules/fs-native-extensions/src/win32.c +531 -0
- package/node_modules/require-addon/LICENSE +201 -0
- package/node_modules/require-addon/README.md +19 -0
- package/node_modules/require-addon/lib/bare.js +1 -0
- package/node_modules/require-addon/lib/default.js +7 -0
- package/node_modules/require-addon/lib/node.js +79 -0
- package/node_modules/require-addon/package.json +64 -0
- package/node_modules/which-runtime/LICENSE +201 -0
- package/node_modules/which-runtime/README.md +29 -0
- package/node_modules/which-runtime/index.js +36 -0
- package/node_modules/which-runtime/package.json +32 -0
- package/package.json +9 -2
- package/release-notes.json +33 -0
- package/src/server/integrations/jira-comment.mjs +37 -0
- package/src/server/integrations/jira-move.mjs +37 -11
- package/src/server/integrations/jira-transition.mjs +43 -0
- package/src/server/integrations/jira-write-guard.mjs +218 -0
- package/src/server/integrations/jira.mjs +16 -0
- package/src/server/integrations/routes.mjs +70 -7
- package/src/server/static-cache.mjs +34 -16
- package/src/server/traffic-radar-wire.mjs +6 -0
- package/dist/web/assets/BrowserWatchModal-CSckhvRP.js +0 -1
- package/dist/web/assets/IntegrationModal-CT8_QnAx.js +0 -7
- package/dist/web/assets/RadioPanel-D3JLkVYu.js +0 -1
- package/dist/web/assets/TrafficRadar-Cuk5tXfL.js +0 -8
- package/dist/web/assets/UsageHistoryModal-DiEH73iz.js +0 -1
- package/dist/web/assets/app-BRaZrImF.js +0 -321
- package/dist/web/assets/app-DfGYllmZ.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./app-
|
|
1
|
+
import"./app-B53fC4gE.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();
|
package/dist/web/index.html
CHANGED
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
document.documentElement.setAttribute("data-density", density === "tightest" || density === "tighter" || density === "compact" || density === "comfortable" ? density : "default");
|
|
78
78
|
})();
|
|
79
79
|
</script>
|
|
80
|
-
<script type="module" crossorigin src="/assets/index-
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/app-
|
|
82
|
-
<link rel="stylesheet" crossorigin href="/assets/app-
|
|
80
|
+
<script type="module" crossorigin src="/assets/index-D9nJhUJR.js"></script>
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/app-B53fC4gE.js">
|
|
82
|
+
<link rel="stylesheet" crossorigin href="/assets/app-Co1HNGP8.css">
|
|
83
83
|
</head>
|
|
84
84
|
<body>
|
|
85
85
|
<div id="root"></div>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# bare-addon-resolve
|
|
2
|
+
|
|
3
|
+
Low-level addon resolution algorithm for Bare. The algorithm is implemented as a generator function that yields either package manifests to be read or resolution candidates to be tested by the caller. As a convenience, the main export is a synchronous and asynchronous iterable that relies on package manifests being read by a callback. For asynchronous iteration, the callback may return promises which will be awaited before being passed to the generator.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm i bare-addon-resolve
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
For synchronous resolution:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
const resolve = require('bare-addon-resolve')
|
|
15
|
+
|
|
16
|
+
function readPackage(url) {
|
|
17
|
+
// Read and parse `url` if it exists, otherwise `null`
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
for (const resolution of resolve('./addon', new URL('file:///directory/'), readPackage)) {
|
|
21
|
+
console.log(resolution)
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For asynchronous resolution:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
const resolve = require('bare-addon-resolve')
|
|
29
|
+
|
|
30
|
+
async function readPackage(url) {
|
|
31
|
+
// Read and parse `url` if it exists, otherwise `null`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
for await (const resolution of resolve('./addon', new URL('file:///directory/'), readPackage)) {
|
|
35
|
+
console.log(resolution)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
See the [`bare-addon-resolve` reference](https://docs.pears.com/reference/bare/modules/bare-addon-resolve).
|
|
42
|
+
|
|
43
|
+
## Algorithm
|
|
44
|
+
|
|
45
|
+
The following generator functions implement the resolution algorithm. The yielded values have the following shape:
|
|
46
|
+
|
|
47
|
+
**Package manifest**
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
next.value = {
|
|
51
|
+
package: URL
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If the package manifest identified by `next.value.package` exists, `generator.next()` must be passed the parsed JSON value of the manifest. If it does not exist, pass `null` instead.
|
|
56
|
+
|
|
57
|
+
**Resolution candidate**
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
next.value = {
|
|
61
|
+
resolution: URL
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If the addon identified by `next.value.resolution` exists, `generator.next()` may be passed `true` to signal that the resolution for the current set of conditions has been identified. If it does not exist, pass `false` instead.
|
|
66
|
+
|
|
67
|
+
To drive the generator functions, a loop like the following can be used:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
const generator = resolve.addon(specifier, parentURL)
|
|
71
|
+
|
|
72
|
+
let next = generator.next()
|
|
73
|
+
|
|
74
|
+
while (next.done !== true) {
|
|
75
|
+
const value = next.value
|
|
76
|
+
|
|
77
|
+
if (value.package) {
|
|
78
|
+
// Read and parse `value.package` if it exists, otherwise `null`
|
|
79
|
+
let info
|
|
80
|
+
|
|
81
|
+
next = generator.next(info)
|
|
82
|
+
} else {
|
|
83
|
+
const resolution = value.resolution
|
|
84
|
+
|
|
85
|
+
// `true` if `resolution` was the correct candidate, otherwise `false`
|
|
86
|
+
let resolved
|
|
87
|
+
|
|
88
|
+
next = generator.next(resolved)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Options are the same as `resolve()` for all functions.
|
|
94
|
+
|
|
95
|
+
> [!WARNING]
|
|
96
|
+
> These functions are currently subject to change between minor releases. If using them directly, make sure to specify a tilde range (`~1.2.3`) when declaring the module dependency.
|
|
97
|
+
|
|
98
|
+
The `preresolved`, `builtinTarget`, and `lookupPackageScope` generators referenced below are provided by [`bare-module-resolve`](https://github.com/holepunchto/bare-module-resolve) and behave as documented there.
|
|
99
|
+
|
|
100
|
+
### `const generator = resolve.addon(specifier, parentURL[, options])`
|
|
101
|
+
|
|
102
|
+
1. If `specifier` [starts with a Windows drive letter](https://url.spec.whatwg.org/#start-with-a-windows-drive-letter):
|
|
103
|
+
1. Prepend `/` to `specifier`.
|
|
104
|
+
2. If `options.resolutions` is set:
|
|
105
|
+
1. If `preresolved(specifier, options.resolutions, parentURL, options)` yields a resolution that isn't deferred, return.
|
|
106
|
+
3. If `url(specifier, parentURL, options)` yields, return.
|
|
107
|
+
4. Let `version` be `null`.
|
|
108
|
+
5. Let `i` be the index of the last `@` in `specifier`.
|
|
109
|
+
6. If `i` is greater than `0`:
|
|
110
|
+
1. Set `version` to the substring of `specifier` following `i`.
|
|
111
|
+
2. If `version` is a valid semantic version:
|
|
112
|
+
1. Set `specifier` to the substring of `specifier` until `i`.
|
|
113
|
+
3. Otherwise, set `version` to `null`.
|
|
114
|
+
7. If `specifier` equals `.` or `..`, or if `specifier` starts with `/`, `\`, `./`, `.\`, `../`, or `..\`:
|
|
115
|
+
1. If `file(specifier, parentURL, options)` resolves, return.
|
|
116
|
+
2. Return `directory(specifier, version, parentURL, options)`.
|
|
117
|
+
8. Return `package(specifier, version, parentURL, options)`.
|
|
118
|
+
|
|
119
|
+
### `const generator = resolve.url(url, parentURL[, options])`
|
|
120
|
+
|
|
121
|
+
1. If `url` is not a valid URL, return.
|
|
122
|
+
2. Yield `url`.
|
|
123
|
+
|
|
124
|
+
### `const generator = resolve.package(packageSpecifier, packageVersion, parentURL[, options])`
|
|
125
|
+
|
|
126
|
+
1. If `packageSpecifier` is the empty string, throw.
|
|
127
|
+
2. If `packageSpecifier` does not start with `@`:
|
|
128
|
+
1. Set `packageName` to the substring of `packageSpecifier` until the first `/` or the end of the string.
|
|
129
|
+
3. Otherwise:
|
|
130
|
+
1. If `packageSpecifier` does not include `/`, throw.
|
|
131
|
+
2. Set `packageName` to the substring of `packageSpecifier` until the second `/` or the end of the string.
|
|
132
|
+
4. If `packageName` starts with `.` or includes `\` or `%`, throw.
|
|
133
|
+
5. Let `packageSubpath` be `.` concatenated with the substring of `packageSpecifier` from the position at the length of `packageName`.
|
|
134
|
+
6. If `parentURL` has an opaque path, return.
|
|
135
|
+
7. If `packageSelf(packageName, packageSubpath, packageVersion, parentURL, options)` yields, return.
|
|
136
|
+
8. Repeat:
|
|
137
|
+
1. Let `packageURL` be the resolution of `node_modules/` concatenated with `packageName` and `/` relative to `parentURL`.
|
|
138
|
+
2. Set `parentURL` to its parent directory.
|
|
139
|
+
3. Let `info` be the result of yielding the resolution of `package.json` relative to `packageURL`.
|
|
140
|
+
4. If `info` is not `null`:
|
|
141
|
+
1. Return `directory(packageSubpath, packageVersion, packageURL, options)`.
|
|
142
|
+
5. If the path of `parentURL` is empty or `/`, return.
|
|
143
|
+
|
|
144
|
+
### `const generator = resolve.packageSelf(packageName, packageSubpath, packageVersion, parentURL[, options])`
|
|
145
|
+
|
|
146
|
+
1. For each value `packageURL` of `lookupPackageScope(parentURL, options)`:
|
|
147
|
+
1. Let `info` be the result of yielding `packageURL`.
|
|
148
|
+
2. If `info` is not `null`:
|
|
149
|
+
1. If `info.name` does not equal `packageName`, return.
|
|
150
|
+
2. Return `directory(packageSubpath, packageVersion, packageURL, options)`.
|
|
151
|
+
|
|
152
|
+
### `const generator = resolve.file(filename, parentURL[, options])`
|
|
153
|
+
|
|
154
|
+
1. If `filename` equals `.` or `..`, or if `filename` ends with `/` or `\`, return.
|
|
155
|
+
2. If `parentURL` has an opaque path, return.
|
|
156
|
+
3. If `parentURL` is a `file:` URL and `filename` includes encoded `/` or `\`, throw.
|
|
157
|
+
4. For each value `ext` of `options.extensions`:
|
|
158
|
+
1. If `filename` ends with `ext`, set `ext` to the empty string.
|
|
159
|
+
2. Yield the resolution of `filename` concatenated with `ext` relative to `parentURL`; if it resolves, return.
|
|
160
|
+
|
|
161
|
+
### `const generator = resolve.directory(dirname, version, parentURL[, options])`
|
|
162
|
+
|
|
163
|
+
1. If `parentURL` has an opaque path, return.
|
|
164
|
+
2. If `dirname` ends with `/` or `\`:
|
|
165
|
+
1. Let `directoryURL` be the resolution of `dirname` relative to `parentURL`.
|
|
166
|
+
3. Otherwise:
|
|
167
|
+
1. Let `directoryURL` be the resolution of `dirname` concatenated with `/` relative to `parentURL`.
|
|
168
|
+
4. Let `unversioned` be `true` if `version` is `null`, otherwise `false`.
|
|
169
|
+
5. Let `info` be the result of yielding the resolution of `package.json` relative to `directoryURL`.
|
|
170
|
+
6. If `info` is `null`, return.
|
|
171
|
+
7. If `info.name` is a non-empty string:
|
|
172
|
+
1. If `info.name` includes `__`, throw.
|
|
173
|
+
2. Let `name` be `info.name` with every `/` replaced by `__` and any leading `@` removed.
|
|
174
|
+
8. Otherwise, return.
|
|
175
|
+
9. If `info.version` is a non-empty string:
|
|
176
|
+
1. If `version` is not `null` and `info.version` does not equal `version`, return.
|
|
177
|
+
2. Set `version` to `info.version`.
|
|
178
|
+
10. If `builtinTarget(name, version, options.builtins, options)` yields, return.
|
|
179
|
+
11. Let `native` be the values of `options.hosts` that do not start with `wasi-`, and `wasm` the values that do.
|
|
180
|
+
12. If `prebuilds(name, version, unversioned, directoryURL, native, options)` resolves, return.
|
|
181
|
+
13. If `linked(name, version, options)` resolves, return.
|
|
182
|
+
14. Return `prebuilds(name, version, unversioned, directoryURL, wasm, options)` with `options.extensions` set to `['.wasm']`.
|
|
183
|
+
|
|
184
|
+
#### `const generator = prebuilds(name, version, unversioned, directoryURL, hosts, options)`
|
|
185
|
+
|
|
186
|
+
1. For each value `prebuildsURL` of `lookupPrebuildsScope(directoryURL, options)`:
|
|
187
|
+
1. Let `resolved` be `false`.
|
|
188
|
+
2. For each value `host` of `hosts`:
|
|
189
|
+
1. Let `conditions` be the result of splitting `host` on `-`.
|
|
190
|
+
2. If `host` is one of `darwin-arm64`, `darwin-x64`, `ios-arm64-simulator`, or `ios-x64-simulator`, let `universal` be `host` with its second component replaced by `universal`; otherwise let `universal` be `null`.
|
|
191
|
+
3. Append the values of `conditions` to `options.matchedConditions`.
|
|
192
|
+
4. If `version` is not `null`:
|
|
193
|
+
1. If `file(host + '/' + name + '@' + version, prebuildsURL, options)` resolves, set `resolved` to `true`.
|
|
194
|
+
2. If `universal` is not `null` and `file(universal + '/' + name + '@' + version, prebuildsURL, options)` resolves, set `resolved` to `true`.
|
|
195
|
+
5. If `unversioned` is `true`:
|
|
196
|
+
1. If `file(host + '/' + name, prebuildsURL, options)` resolves, set `resolved` to `true`.
|
|
197
|
+
2. If `universal` is not `null` and `file(universal + '/' + name, prebuildsURL, options)` resolves, set `resolved` to `true`.
|
|
198
|
+
6. Remove the values of `conditions` from `options.matchedConditions`.
|
|
199
|
+
3. If `resolved` is `true`, return.
|
|
200
|
+
|
|
201
|
+
### `const generator = resolve.linked(name, version[, options])`
|
|
202
|
+
|
|
203
|
+
1. If `options.linked` is `false` or `options.hosts` is empty, return.
|
|
204
|
+
2. For each value `host` of `options.hosts`:
|
|
205
|
+
1. Let `platform` be the substring of `host` until the first `-`.
|
|
206
|
+
2. If `platform` is the empty string, continue.
|
|
207
|
+
3. Append `platform` to `options.matchedConditions`.
|
|
208
|
+
4. Let `candidates` be the following artefact names, in order, where each entry containing `<version>` is only included when `version` is not `null`:
|
|
209
|
+
1. If `platform` is `darwin` or `ios`:
|
|
210
|
+
1. `<name>.<version>.framework/<name>.<version>`
|
|
211
|
+
2. `lib<name>.<version>.dylib`, only if `platform` is `darwin`
|
|
212
|
+
3. `<name>.framework/<name>`
|
|
213
|
+
4. `lib<name>.dylib`, only if `platform` is `darwin`
|
|
214
|
+
2. Otherwise, if `platform` is `linux` or `android`:
|
|
215
|
+
1. `lib<name>.<version>.so`
|
|
216
|
+
2. `lib<name>.so`
|
|
217
|
+
3. Otherwise, if `platform` is `win32`:
|
|
218
|
+
1. `<name>-<version>.dll`
|
|
219
|
+
2. `<name>.dll`
|
|
220
|
+
5. For each value `candidate` of `candidates`:
|
|
221
|
+
1. Yield `options.linkedProtocol` concatenated with `candidate`; if it resolves, stop iterating `candidates`.
|
|
222
|
+
6. Remove `platform` from `options.matchedConditions`.
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
Apache-2.0
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import URL from 'bare-url'
|
|
2
|
+
import { constants, type Builtins, type Conditions, type ResolutionsMap } from 'bare-module-resolve'
|
|
3
|
+
|
|
4
|
+
type JSON = string | number | boolean | JSON[] | { [key: string]: JSON }
|
|
5
|
+
|
|
6
|
+
interface ResolveOptions {
|
|
7
|
+
builtinProtocol?: string
|
|
8
|
+
builtins?: Builtins
|
|
9
|
+
conditions?: Conditions
|
|
10
|
+
extensions?: string[]
|
|
11
|
+
host?: string
|
|
12
|
+
hosts?: string[]
|
|
13
|
+
linked?: boolean
|
|
14
|
+
linkedProtocol?: string
|
|
15
|
+
matchedConditions?: string[]
|
|
16
|
+
resolutions?: ResolutionsMap
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Resolve `specifier` relative to `parentURL`, which must be a WHATWG `URL` instance. `readPackage`
|
|
21
|
+
* is called with a `URL` instance for every package manifest to be read and must either return the
|
|
22
|
+
* parsed JSON package manifest, if it exists, or `null`. If `readPackage` returns a promise,
|
|
23
|
+
* synchronous iteration is not supported.
|
|
24
|
+
* @param specifier - The module specifier to resolve.
|
|
25
|
+
* @param parentURL - The URL to resolve `specifier` relative to.
|
|
26
|
+
* @param readPackage - Called with the URL of each package manifest encountered; must return the
|
|
27
|
+
* parsed manifest or `null`. Returning a promise disables synchronous iteration.
|
|
28
|
+
* @returns Yields candidate resolution `URL`s for the caller to test, in the order the algorithm
|
|
29
|
+
* tries them.
|
|
30
|
+
* @throws {INVALID_ADDON_SPECIFIER} `parentURL` is a `file:` URL and the specifier contains a
|
|
31
|
+
* percent-encoded `/` or `\` (`%2f` or `%5c`, in either case).
|
|
32
|
+
* @throws {INVALID_PACKAGE_NAME} a package manifest's `name` field contains `__`.
|
|
33
|
+
*/
|
|
34
|
+
declare function resolve(
|
|
35
|
+
specifier: string,
|
|
36
|
+
parentURL: URL,
|
|
37
|
+
readPackage?: (url: URL) => JSON | null
|
|
38
|
+
): Iterable<URL>
|
|
39
|
+
|
|
40
|
+
declare function resolve(
|
|
41
|
+
specifier: string,
|
|
42
|
+
parentURL: URL,
|
|
43
|
+
readPackage: (url: URL) => Promise<JSON | null>
|
|
44
|
+
): AsyncIterable<URL>
|
|
45
|
+
|
|
46
|
+
declare function resolve(
|
|
47
|
+
specifier: string,
|
|
48
|
+
parentURL: URL,
|
|
49
|
+
opts: ResolveOptions,
|
|
50
|
+
readPackage?: (url: URL) => JSON | null
|
|
51
|
+
): Iterable<URL>
|
|
52
|
+
|
|
53
|
+
declare function resolve(
|
|
54
|
+
specifier: string,
|
|
55
|
+
parentURL: URL,
|
|
56
|
+
opts: ResolveOptions,
|
|
57
|
+
readPackage: (url: URL) => Promise<JSON | null>
|
|
58
|
+
): AsyncIterable<URL>
|
|
59
|
+
|
|
60
|
+
declare namespace resolve {
|
|
61
|
+
export { constants, type ResolveOptions }
|
|
62
|
+
|
|
63
|
+
export type Resolver = Generator<
|
|
64
|
+
{ resolution: URL } | { package: URL },
|
|
65
|
+
number,
|
|
66
|
+
void | boolean | JSON | null
|
|
67
|
+
>
|
|
68
|
+
|
|
69
|
+
export function addon(specifier: string, parentURL: URL, opts?: ResolveOptions): Resolver
|
|
70
|
+
|
|
71
|
+
export function url(specifier: string, parentURL: URL, opts?: ResolveOptions): Resolver
|
|
72
|
+
|
|
73
|
+
export function package(
|
|
74
|
+
packageSpecifier: string,
|
|
75
|
+
packageVersion: string,
|
|
76
|
+
parentURL: URL,
|
|
77
|
+
opts?: ResolveOptions
|
|
78
|
+
): Resolver
|
|
79
|
+
|
|
80
|
+
export function packageSelf(
|
|
81
|
+
packageName: string,
|
|
82
|
+
packageSubpath: string,
|
|
83
|
+
packageVersion: string,
|
|
84
|
+
parentURL: URL,
|
|
85
|
+
opts?: ResolveOptions
|
|
86
|
+
): Resolver
|
|
87
|
+
|
|
88
|
+
export function file(filename: string, parentURL: URL, opts?: ResolveOptions): Resolver
|
|
89
|
+
|
|
90
|
+
export function directory(
|
|
91
|
+
dirname: string,
|
|
92
|
+
version: string,
|
|
93
|
+
parentURL: URL,
|
|
94
|
+
opts?: ResolveOptions
|
|
95
|
+
): Resolver
|
|
96
|
+
|
|
97
|
+
export function linked(name: string, version?: string, opts?: ResolveOptions): Resolver
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export = resolve
|