ccdeck 3.49.1 → 3.51.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 +7 -3
- package/THIRD_PARTY_NOTICES.md +28 -0
- package/bin/cli/commands.js +34 -3
- package/bin/cli/second-start.js +6 -1
- package/dist/web/assets/BrowserWatchModal-CDpunrq9.js +1 -0
- package/dist/web/assets/IntegrationModal-BctMcNU8.js +7 -0
- package/dist/web/assets/{RadioPanel-gFYxdsBg.js → RadioPanel-DQNFtYOx.js} +1 -1
- package/dist/web/assets/{TrafficRadar-B9MfKca4.js → TrafficRadar-DRt3Al7E.js} +1 -1
- package/dist/web/assets/UsageHistoryModal-DlgPufgs.js +1 -0
- package/dist/web/assets/{app-D2NP6IPl.js → app-4x4wTE-L.js} +73 -73
- package/dist/web/assets/{app-DfGYllmZ.css → app-o4kL0FgZ.css} +1 -1
- package/dist/web/assets/{index-Be6Ox-74.js → index-CWUj8Kqh.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 +12 -2
- package/release-notes.json +25 -0
- package/src/server/claude-accounts.mjs +19 -3
- package/src/server/claude-collector.mjs +18 -2
- package/src/server/cswap-install.mjs +60 -18
- 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/lan-deck.mjs +9 -0
- package/src/server/lan-engine.mjs +17 -2
- package/src/server/lan-manifest.mjs +10 -3
- package/src/server/lifecycle.mjs +27 -2
- package/src/server/login-guard.mjs +4 -0
- package/src/server/npm-upgrade.mjs +46 -18
- package/src/server/pinned-build.mjs +5 -0
- package/src/server/quota-store-resets.mjs +13 -6
- package/src/server/quota.mjs +8 -1
- package/src/server/running-deck.mjs +14 -0
- package/src/server/static-cache.mjs +34 -16
- package/src/server/terminal-cli-update.mjs +189 -0
- package/src/server/terminal-cli.mjs +93 -0
- package/src/server/traffic-radar-wire.mjs +6 -0
- package/src/server/usage-share.mjs +444 -0
- package/dist/web/assets/BrowserWatchModal-CCARqAMn.js +0 -1
- package/dist/web/assets/IntegrationModal-B8t53aE5.js +0 -7
- package/dist/web/assets/UsageHistoryModal-DvYWhsYv.js +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare class ModuleResolveError extends Error {
|
|
2
|
+
readonly code: string
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param msg - The error message.
|
|
6
|
+
* @returns A new `ModuleResolveError` with code `INVALID_MODULE_SPECIFIER`.
|
|
7
|
+
*/
|
|
8
|
+
static INVALID_MODULE_SPECIFIER(msg: string): ModuleResolveError
|
|
9
|
+
/**
|
|
10
|
+
* @param msg - The error message.
|
|
11
|
+
* @returns A new `ModuleResolveError` with code `INVALID_PACKAGE_TARGET`.
|
|
12
|
+
*/
|
|
13
|
+
static INVALID_PACKAGE_TARGET(msg: string): ModuleResolveError
|
|
14
|
+
/**
|
|
15
|
+
* @param msg - The error message.
|
|
16
|
+
* @returns A new `ModuleResolveError` with code `PACKAGE_PATH_NOT_EXPORTED`.
|
|
17
|
+
*/
|
|
18
|
+
static PACKAGE_PATH_NOT_EXPORTED(msg: string): ModuleResolveError
|
|
19
|
+
/**
|
|
20
|
+
* @param msg - The error message.
|
|
21
|
+
* @returns A new `ModuleResolveError` with code `PACKAGE_IMPORT_NOT_DEFINED`.
|
|
22
|
+
*/
|
|
23
|
+
static PACKAGE_IMPORT_NOT_DEFINED(msg: string): ModuleResolveError
|
|
24
|
+
/**
|
|
25
|
+
* @param msg - The error message.
|
|
26
|
+
* @returns A new `ModuleResolveError` with code `UNSUPPORTED_ENGINE`.
|
|
27
|
+
*/
|
|
28
|
+
static UNSUPPORTED_ENGINE(msg: string): ModuleResolveError
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export = ModuleResolveError
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module.exports = class ModuleResolveError extends Error {
|
|
2
|
+
constructor(msg, fn = ModuleResolveError, code = fn.name) {
|
|
3
|
+
super(`${code}: ${msg}`)
|
|
4
|
+
|
|
5
|
+
this.code = code
|
|
6
|
+
|
|
7
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, fn)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
get name() {
|
|
11
|
+
return 'ModuleResolveError'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static INVALID_MODULE_SPECIFIER(msg) {
|
|
15
|
+
return new ModuleResolveError(msg, ModuleResolveError.INVALID_MODULE_SPECIFIER)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static INVALID_PACKAGE_TARGET(msg) {
|
|
19
|
+
return new ModuleResolveError(msg, ModuleResolveError.INVALID_PACKAGE_TARGET)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static INVALID_PACKAGE_CONFIGURATION(msg) {
|
|
23
|
+
return new ModuleResolveError(msg, ModuleResolveError.INVALID_PACKAGE_CONFIGURATION)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static PACKAGE_PATH_NOT_EXPORTED(msg) {
|
|
27
|
+
return new ModuleResolveError(msg, ModuleResolveError.PACKAGE_PATH_NOT_EXPORTED)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static PACKAGE_IMPORT_NOT_DEFINED(msg) {
|
|
31
|
+
return new ModuleResolveError(msg, ModuleResolveError.PACKAGE_IMPORT_NOT_DEFINED)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static UNSUPPORTED_ENGINE(msg) {
|
|
35
|
+
return new ModuleResolveError(msg, ModuleResolveError.UNSUPPORTED_ENGINE)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bare-module-resolve",
|
|
3
|
+
"version": "1.12.6",
|
|
4
|
+
"description": "Low-level module resolution algorithm for Bare",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./package": "./package.json",
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"default": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"./errors": {
|
|
12
|
+
"types": "./lib/errors.d.ts",
|
|
13
|
+
"default": "./lib/errors.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"index.js",
|
|
18
|
+
"index.d.ts",
|
|
19
|
+
"lib"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"format": "prettier --write . && lunte --fix",
|
|
23
|
+
"lint": "prettier --check . && lunte",
|
|
24
|
+
"test": "npm run test:bare && npm run test:node",
|
|
25
|
+
"test:bare": "brittle-bare --coverage test.js",
|
|
26
|
+
"test:node": "brittle-node --coverage test.js"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/holepunchto/bare-module-resolve.git"
|
|
31
|
+
},
|
|
32
|
+
"author": "Holepunch",
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/holepunchto/bare-module-resolve/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/holepunchto/bare-module-resolve#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"bare-semver": "^1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"bare-url": "^2.1.3",
|
|
43
|
+
"brittle": "^3.2.1",
|
|
44
|
+
"lunte": "^1.7.0",
|
|
45
|
+
"prettier": "^3.3.3",
|
|
46
|
+
"prettier-config-holepunch": "^2.0.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"bare-url": "*"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"bare-url": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -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,147 @@
|
|
|
1
|
+
# bare-semver
|
|
2
|
+
|
|
3
|
+
Minimal semantic versioning library for Bare.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm i bare-semver
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
const semver = require('bare-semver')
|
|
13
|
+
|
|
14
|
+
const version = semver.Version.parse('1.2.3-alpha.1+build.42')
|
|
15
|
+
|
|
16
|
+
console.log(version.major) // 1
|
|
17
|
+
console.log(version.minor) // 2
|
|
18
|
+
console.log(version.patch) // 3
|
|
19
|
+
|
|
20
|
+
const satisfied = semver.satisfies('1.2.3', '>=1.0.0 <2.0.0')
|
|
21
|
+
|
|
22
|
+
console.log(satisfied) // true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
#### `const satisfied = semver.satisfies(version, range)`
|
|
28
|
+
|
|
29
|
+
Test whether `version` satisfies `range`. Both `version` and `range` may be strings, in which case they will be parsed.
|
|
30
|
+
|
|
31
|
+
#### `semver.constants`
|
|
32
|
+
|
|
33
|
+
An object containing the comparison operator constants:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
constants = {
|
|
37
|
+
EQ: 1,
|
|
38
|
+
LT: 2,
|
|
39
|
+
LTE: 3,
|
|
40
|
+
GT: 4,
|
|
41
|
+
GTE: 5
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### `semver.errors`
|
|
46
|
+
|
|
47
|
+
The `SemVerError` class. Thrown when parsing invalid versions or ranges.
|
|
48
|
+
|
|
49
|
+
#### `const version = new semver.Version(major, minor, patch[, options])`
|
|
50
|
+
|
|
51
|
+
Create a new version with the given `major`, `minor`, and `patch` components.
|
|
52
|
+
|
|
53
|
+
Options include:
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
options = {
|
|
57
|
+
prerelease: [],
|
|
58
|
+
build: []
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### `version.major`
|
|
63
|
+
|
|
64
|
+
The major version number.
|
|
65
|
+
|
|
66
|
+
#### `version.minor`
|
|
67
|
+
|
|
68
|
+
The minor version number.
|
|
69
|
+
|
|
70
|
+
#### `version.patch`
|
|
71
|
+
|
|
72
|
+
The patch version number.
|
|
73
|
+
|
|
74
|
+
#### `version.prerelease`
|
|
75
|
+
|
|
76
|
+
An array of prerelease tags.
|
|
77
|
+
|
|
78
|
+
#### `version.build`
|
|
79
|
+
|
|
80
|
+
An array of build metadata tags.
|
|
81
|
+
|
|
82
|
+
#### `const result = version.compare(other)`
|
|
83
|
+
|
|
84
|
+
Compare `version` with `other`, returning `1` if `version` is greater, `-1` if less, or `0` if equal. Comparison follows the Semantic Versioning 2.0.0 specification, including prerelease precedence rules.
|
|
85
|
+
|
|
86
|
+
#### `const string = version.toString()`
|
|
87
|
+
|
|
88
|
+
Return the string representation of `version`.
|
|
89
|
+
|
|
90
|
+
#### `const version = semver.Version.parse(input)`
|
|
91
|
+
|
|
92
|
+
Parse a semantic version string into a `Version` instance. Throws a `SemVerError` with code `INVALID_VERSION` if `input` is not a valid version string.
|
|
93
|
+
|
|
94
|
+
#### `const result = semver.Version.compare(a, b)`
|
|
95
|
+
|
|
96
|
+
Compare two `Version` instances, returning `1`, `-1`, or `0`.
|
|
97
|
+
|
|
98
|
+
#### `const comparator = new semver.Comparator(operator, version)`
|
|
99
|
+
|
|
100
|
+
Create a new comparator with the given `operator` constant and `version`.
|
|
101
|
+
|
|
102
|
+
#### `comparator.operator`
|
|
103
|
+
|
|
104
|
+
The comparison operator constant.
|
|
105
|
+
|
|
106
|
+
#### `comparator.version`
|
|
107
|
+
|
|
108
|
+
The `Version` instance to compare against.
|
|
109
|
+
|
|
110
|
+
#### `const satisfied = comparator.test(version)`
|
|
111
|
+
|
|
112
|
+
Test whether `version` satisfies the comparator.
|
|
113
|
+
|
|
114
|
+
#### `const string = comparator.toString()`
|
|
115
|
+
|
|
116
|
+
Return the string representation of the comparator, e.g. `>=1.0.0`.
|
|
117
|
+
|
|
118
|
+
#### `const range = new semver.Range([comparators])`
|
|
119
|
+
|
|
120
|
+
Create a new range from a two-dimensional array of `Comparator` instances. Each inner array represents a set of comparators joined by intersection, and the outer array represents the union of those sets.
|
|
121
|
+
|
|
122
|
+
#### `range.comparators`
|
|
123
|
+
|
|
124
|
+
The two-dimensional array of `Comparator` instances.
|
|
125
|
+
|
|
126
|
+
#### `const satisfied = range.test(version)`
|
|
127
|
+
|
|
128
|
+
Test whether `version` satisfies the range.
|
|
129
|
+
|
|
130
|
+
#### `const string = range.toString()`
|
|
131
|
+
|
|
132
|
+
Return the string representation of the range.
|
|
133
|
+
|
|
134
|
+
#### `const range = semver.Range.parse(input)`
|
|
135
|
+
|
|
136
|
+
Parse a range string into a `Range` instance. Supports the following syntax, which is desugared into sets of comparators following the [npm advanced range syntax](https://www.npmjs.com/package/semver#advanced-range-syntax):
|
|
137
|
+
|
|
138
|
+
- Comparison operators: `<`, `<=`, `>`, `>=`, `=`, e.g. `>=1.2.3`.
|
|
139
|
+
- Logical OR of comparator sets: `||`, e.g. `1.2.3 || >=2.0.0`.
|
|
140
|
+
- Caret ranges: `^1.2.3` allows changes that do not modify the left-most non-zero component, e.g. `^1.2.3` is `>=1.2.3 <2.0.0-0` and `^0.2.3` is `>=0.2.3 <0.3.0-0`.
|
|
141
|
+
- Tilde ranges: `~1.2.3` allows patch-level changes if a minor version is specified and minor-level changes if not, e.g. `~1.2.3` is `>=1.2.3 <1.3.0-0` and `~1` is `>=1.0.0 <2.0.0-0`. `~>` is accepted as an alias for `~`.
|
|
142
|
+
- X-ranges: `x`, `X`, or `*` stand in for a component, e.g. `1.2.x` is `>=1.2.0 <1.3.0-0` and `*` is `>=0.0.0`. Partial versions such as `1` and `1.2` are treated as X-ranges.
|
|
143
|
+
- Hyphen ranges: `1.2.3 - 2.3.4` specifies an inclusive set, expanding to `>=1.2.3 <=2.3.4`. A partial upper bound caps the range, e.g. `1.2.3 - 2.3` is `>=1.2.3 <2.4.0-0`.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
Apache-2.0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const constants: { EQ: 1; LT: 2; LTE: 3; GT: 4; GTE: 5 }
|
|
2
|
+
|
|
3
|
+
declare class SemVerError extends Error {
|
|
4
|
+
static INVALID_VERSION(msg: string, fn?: Function): SemVerError
|
|
5
|
+
|
|
6
|
+
static INVALID_RANGE(msg: string, fn?: Function): SemVerError
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { SemVerError as errors }
|
|
10
|
+
|
|
11
|
+
export function satisfies(version: Version, range: Range): boolean
|
|
12
|
+
|
|
13
|
+
export class Version {
|
|
14
|
+
constructor(
|
|
15
|
+
major: number,
|
|
16
|
+
minor: number,
|
|
17
|
+
patch: number,
|
|
18
|
+
opts?: { prerelease?: string[]; build?: string[] }
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
major: number
|
|
22
|
+
minor: number
|
|
23
|
+
patch: number
|
|
24
|
+
prerelease: string[]
|
|
25
|
+
build: string[]
|
|
26
|
+
|
|
27
|
+
compare(version: Version): boolean
|
|
28
|
+
|
|
29
|
+
toString(): string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export namespace Version {
|
|
33
|
+
export function parse(input: string): Version
|
|
34
|
+
|
|
35
|
+
export function compare(a: Version, b: Version): number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class Comparator {
|
|
39
|
+
constructor(operator: number, version: Version)
|
|
40
|
+
|
|
41
|
+
operator: number
|
|
42
|
+
version: Version
|
|
43
|
+
|
|
44
|
+
test(version: Version): boolean
|
|
45
|
+
|
|
46
|
+
toString(): string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class Range {
|
|
50
|
+
constructor(comparators?: Comparator[][])
|
|
51
|
+
|
|
52
|
+
comparators: Comparator[][]
|
|
53
|
+
|
|
54
|
+
test(version: Version): boolean
|
|
55
|
+
|
|
56
|
+
toString(): string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export namespace Range {
|
|
60
|
+
export function parse(input: string): Range
|
|
61
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
exports.constants = require('./lib/constants')
|
|
2
|
+
exports.errors = require('./lib/errors')
|
|
3
|
+
|
|
4
|
+
const Version = (exports.Version = require('./lib/version'))
|
|
5
|
+
const Range = (exports.Range = require('./lib/range'))
|
|
6
|
+
exports.Comparator = require('./lib/comparator')
|
|
7
|
+
|
|
8
|
+
exports.satisfies = function satisfies(version, range) {
|
|
9
|
+
if (typeof version === 'string') version = Version.parse(version)
|
|
10
|
+
if (typeof range === 'string') range = Range.parse(range)
|
|
11
|
+
|
|
12
|
+
return range.test(version)
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const constants = require('./constants')
|
|
2
|
+
|
|
3
|
+
const symbols = {
|
|
4
|
+
[constants.EQ]: '=',
|
|
5
|
+
[constants.LT]: '<',
|
|
6
|
+
[constants.LTE]: '<=',
|
|
7
|
+
[constants.GT]: '>',
|
|
8
|
+
[constants.GTE]: '>='
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = class Comparator {
|
|
12
|
+
constructor(operator, version) {
|
|
13
|
+
this.operator = operator
|
|
14
|
+
this.version = version
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
test(version) {
|
|
18
|
+
const result = version.compare(this.version)
|
|
19
|
+
|
|
20
|
+
switch (this.operator) {
|
|
21
|
+
case constants.LT:
|
|
22
|
+
return result < 0
|
|
23
|
+
case constants.LTE:
|
|
24
|
+
return result <= 0
|
|
25
|
+
case constants.GT:
|
|
26
|
+
return result > 0
|
|
27
|
+
case constants.GTE:
|
|
28
|
+
return result >= 0
|
|
29
|
+
default:
|
|
30
|
+
return result === 0
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
toString() {
|
|
35
|
+
return symbols[this.operator] + this.version
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = class SemVerError extends Error {
|
|
2
|
+
constructor(msg, code, fn = SemVerError) {
|
|
3
|
+
super(`${code}: ${msg}`)
|
|
4
|
+
this.code = code
|
|
5
|
+
|
|
6
|
+
if (Error.captureStackTrace) {
|
|
7
|
+
Error.captureStackTrace(this, fn)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
get name() {
|
|
12
|
+
return 'SemVerError'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static INVALID_VERSION(msg, fn = SemVerError.INVALID_VERSION) {
|
|
16
|
+
return new SemVerError(msg, 'INVALID_VERSION', fn)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static INVALID_RANGE(msg, fn = SemVerError.INVALID_RANGE) {
|
|
20
|
+
return new SemVerError(msg, 'INVALID_RANGE', fn)
|
|
21
|
+
}
|
|
22
|
+
}
|