jspm 3.3.0 → 3.3.2

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.
Files changed (5) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +26 -26
  3. package/dist/cli.js +44 -32
  4. package/jspm.js +10 -10
  5. package/package.json +33 -33
package/LICENSE CHANGED
@@ -1,202 +1,202 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
202
  limitations under the License.
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- <div align="center">
2
- <img style="display: inline-block; width: 100px; vertical-align: middle; margin-top: -1em;" src="https://jspm.org/jspm.png"/>
3
- <h1 style="display: inline-block">JSPM CLI</h1>
4
- <p><strong>JSPM CLI is the package management of the JSPM project, supporting import map package management.</strong></p>
5
- <a href="https://jspm.org/getting-started">Getting Started</a> | <a href="https://jspm.org/docs/jspm-cli">Documentation</a> | <a href="https://jspm.org/faq">FAQ</a>
6
- <br />
7
- <hr style="width:50%"/>
8
- </div>
9
- <br />
10
-
11
- * Resolution against `node_modules` for local development workflows.
12
- * Versioned, locked dependency management against the local `package.json`.
13
- * Tracing and installing the full dependency tree of an application.
14
- * Complete NPM-like module resolution that supports conditional environments and package entry points.
15
- * Support for a wide range of CDNs, such as `jspm.io`, `jsDeliver`, `esm.sh` and `unpkg`.
16
- * Import map extraction/injection into HTML files, with module preloading and integrity attributes.
17
-
18
- See the [documentation](https://jspm.org/docs/jspm-cli) and [getting started](https://jspm.org/getting-started) guide on jspm.org.
19
-
20
- ## Contributing
21
-
22
- Build and test workflows use [Chomp](https://chompbuild.com).
23
-
24
- ## License
25
-
26
- Apache-2.0
1
+ <div align="center">
2
+ <img style="display: inline-block; width: 100px; vertical-align: middle; margin-top: -1em;" src="https://jspm.org/jspm.png"/>
3
+ <h1 style="display: inline-block">JSPM CLI</h1>
4
+ <p><strong>JSPM CLI is the package management of the JSPM project, supporting import map package management.</strong></p>
5
+ <a href="https://jspm.org/getting-started">Getting Started</a> | <a href="https://jspm.org/docs/jspm-cli">Documentation</a> | <a href="https://jspm.org/faq">FAQ</a>
6
+ <br />
7
+ <hr style="width:50%"/>
8
+ </div>
9
+ <br />
10
+
11
+ * Resolution against `node_modules` for local development workflows.
12
+ * Versioned, locked dependency management against the local `package.json`.
13
+ * Tracing and installing the full dependency tree of an application.
14
+ * Complete NPM-like module resolution that supports conditional environments and package entry points.
15
+ * Support for a wide range of CDNs, such as `jspm.io`, `jsDeliver`, `esm.sh` and `unpkg`.
16
+ * Import map extraction/injection into HTML files, with module preloading and integrity attributes.
17
+
18
+ See the [documentation](https://jspm.org/docs/jspm-cli) and [getting started](https://jspm.org/getting-started) guide on jspm.org.
19
+
20
+ ## Contributing
21
+
22
+ Build and test workflows use [Chomp](https://chompbuild.com).
23
+
24
+ ## License
25
+
26
+ Apache-2.0
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ var __esm = (fn, res) => function __init() {
4
4
  };
5
5
 
6
6
  // node_modules/rollup/dist/es/shared/node-entry.js
7
- import { resolve, basename, extname, dirname, relative as relative$1 } from "node:path";
7
+ import { resolve, basename, extname as extname2, dirname, relative as relative$1 } from "node:path";
8
8
  import require$$0$1, { win32, posix, isAbsolute as isAbsolute$1, resolve as resolve$1 } from "path";
9
9
  import process$1, { env as env$1 } from "node:process";
10
10
  import { performance } from "node:perf_hooks";
@@ -243,7 +243,7 @@ function normalize(path4) {
243
243
  }
244
244
  function getAliasName(id) {
245
245
  const base2 = basename(id);
246
- return base2.slice(0, Math.max(0, base2.length - extname(id).length));
246
+ return base2.slice(0, Math.max(0, base2.length - extname2(id).length));
247
247
  }
248
248
  function relativeId(id) {
249
249
  if (!isAbsolute(id))
@@ -701,7 +701,7 @@ function logInvalidFormatForTopLevelAwait(id, format) {
701
701
  };
702
702
  }
703
703
  function logMissingExport(binding, importingModule, exporter) {
704
- const isJson = extname(exporter) === ".json";
704
+ const isJson = extname2(exporter) === ".json";
705
705
  return {
706
706
  binding,
707
707
  code: MISSING_EXPORT,
@@ -2671,7 +2671,7 @@ function renderNamePattern(pattern, patternName, replacements) {
2671
2671
  function makeUnique(name, { [lowercaseBundleKeys]: reservedLowercaseBundleKeys }) {
2672
2672
  if (!reservedLowercaseBundleKeys.has(name.toLowerCase()))
2673
2673
  return name;
2674
- const extension = extname(name);
2674
+ const extension = extname2(name);
2675
2675
  name = name.slice(0, Math.max(0, name.length - extension.length));
2676
2676
  let uniqueName, uniqueIndex = 1;
2677
2677
  while (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + extension).toLowerCase()))
@@ -4100,10 +4100,10 @@ function getSourceHash(source) {
4100
4100
  function generateAssetFileName(name, source, sourceHash, outputOptions, bundle) {
4101
4101
  const emittedName = outputOptions.sanitizeFileName(name || "asset");
4102
4102
  return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === "function" ? outputOptions.assetFileNames({ name, source, type: "asset" }) : outputOptions.assetFileNames, "output.assetFileNames", {
4103
- ext: () => extname(emittedName).slice(1),
4104
- extname: () => extname(emittedName),
4103
+ ext: () => extname2(emittedName).slice(1),
4104
+ extname: () => extname2(emittedName),
4105
4105
  hash: (size) => sourceHash.slice(0, Math.max(0, size || defaultHashSize)),
4106
- name: () => emittedName.slice(0, Math.max(0, emittedName.length - extname(emittedName).length))
4106
+ name: () => emittedName.slice(0, Math.max(0, emittedName.length - extname2(emittedName).length))
4107
4107
  }), bundle);
4108
4108
  }
4109
4109
  function reserveFileNameInBundle(fileName, { bundle }, log2) {
@@ -15052,7 +15052,7 @@ var init_node_entry = __esm({
15052
15052
  }
15053
15053
  basename() {
15054
15054
  const base2 = basename(this.id);
15055
- const extension = extname(this.id);
15055
+ const extension = extname2(this.id);
15056
15056
  return makeLegal(extension ? base2.slice(0, -extension.length) : base2);
15057
15057
  }
15058
15058
  bindReferences() {
@@ -16565,7 +16565,7 @@ ${next}` : out;
16565
16565
  return predefinedChunkName;
16566
16566
  const { preserveModulesRoot, sanitizeFileName: sanitizeFileName2 } = this.outputOptions;
16567
16567
  const sanitizedId = sanitizeFileName2(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0]));
16568
- const extensionName = extname(sanitizedId);
16568
+ const extensionName = extname2(sanitizedId);
16569
16569
  const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName) ? sanitizedId.slice(0, -extensionName.length) : sanitizedId;
16570
16570
  if (isAbsolute(idWithoutExtension)) {
16571
16571
  return preserveModulesRoot && resolve(idWithoutExtension).startsWith(preserveModulesRoot) ? idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, "") : relative(this.inputBase, idWithoutExtension);
@@ -24334,7 +24334,7 @@ var cac = (name = "") => new CAC(name);
24334
24334
  var dist_default = cac;
24335
24335
 
24336
24336
  // package.json
24337
- var version = "3.3.0";
24337
+ var version = "3.3.2";
24338
24338
 
24339
24339
  // src/clearCache.ts
24340
24340
  import c from "picocolors";
@@ -24414,12 +24414,16 @@ function createLogger() {
24414
24414
 
24415
24415
  // src/utils.ts
24416
24416
  import fs2 from "node:fs/promises";
24417
+ import { accessSync } from "node:fs";
24417
24418
  import path from "node:path";
24418
24419
  import { pathToFileURL } from "node:url";
24419
24420
  import { Generator, analyzeHtml } from "@jspm/generator";
24420
24421
  import ora from "ora";
24421
24422
  import c3 from "picocolors";
24422
- var defaultInputPath = "./importmap.json";
24423
+ var defaultMapPath = "importmap.json";
24424
+ function isJsExtension(ext) {
24425
+ return ext === ".js" || ext === ".mjs" || ext === ".cjs" || ext === ".ts" || ext === ".mts" || ext === ".cts" || ext === ".jsx" || ext === ".tsx";
24426
+ }
24423
24427
  var defaultHtmlTemplate = `<!DOCTYPE html>
24424
24428
  <html>
24425
24429
  <head>
@@ -24479,7 +24483,7 @@ async function writeHtmlOutput(mapFile, generator, pins, env2, flags, silent = f
24479
24483
  `JSPM does not have permission to write to ${mapFile}.`
24480
24484
  );
24481
24485
  const mapFileRel = path.relative(process.cwd(), mapFile);
24482
- if (!await exists(mapFile)) {
24486
+ if (!exists(mapFile)) {
24483
24487
  !silent && console.warn(
24484
24488
  `${c3.cyan(
24485
24489
  "Note:"
@@ -24526,6 +24530,9 @@ async function writeJsonOutput(mapFile, generator, pins, env2, flags, silent = f
24526
24530
  );
24527
24531
  try {
24528
24532
  const existing = JSON.parse(await fs2.readFile(mapFile, "utf8"));
24533
+ delete existing.imports;
24534
+ delete existing.scopes;
24535
+ delete existing.integrity;
24529
24536
  map = Object.assign({}, existing, map);
24530
24537
  } catch {
24531
24538
  }
@@ -24559,12 +24566,12 @@ async function getGenerator(flags, setEnv = true) {
24559
24566
  // TODO: only for --local flag
24560
24567
  });
24561
24568
  }
24562
- async function getInput(flags) {
24563
- const mapFile = getInputPath(flags);
24564
- if (!await exists(mapFile))
24569
+ async function getInput(flags, fallbackDefaultMap = defaultMapPath) {
24570
+ const mapFile = getInputPath(flags, fallbackDefaultMap);
24571
+ if (!exists(mapFile))
24565
24572
  return void 0;
24566
- if (!await canRead(mapFile)) {
24567
- if (mapFile === defaultInputPath)
24573
+ if (!canRead(mapFile)) {
24574
+ if (mapFile === defaultMapPath)
24568
24575
  return void 0;
24569
24576
  else
24570
24577
  throw new JspmError(`JSPM does not have permission to read ${mapFile}.`);
@@ -24593,13 +24600,16 @@ async function getInputMap(flags) {
24593
24600
  }
24594
24601
  return inputMap || {};
24595
24602
  }
24596
- function getInputPath(flags) {
24597
- return path.resolve(process.cwd(), flags?.map || defaultInputPath);
24603
+ function getInputPath(flags, fallbackDefaultMap = defaultMapPath) {
24604
+ return path.resolve(
24605
+ process.cwd(),
24606
+ flags?.map || (exists(defaultMapPath) ? defaultMapPath : fallbackDefaultMap)
24607
+ );
24598
24608
  }
24599
24609
  function getOutputPath(flags) {
24600
24610
  return path.resolve(
24601
24611
  process.cwd(),
24602
- flags.output || flags.map || defaultInputPath
24612
+ flags.output || flags.map || defaultMapPath
24603
24613
  );
24604
24614
  }
24605
24615
  function getOutputMapUrl(flags) {
@@ -24737,27 +24747,27 @@ function startSpinner(text) {
24737
24747
  function stopSpinner() {
24738
24748
  spinner.stop();
24739
24749
  }
24740
- async function exists(file) {
24750
+ function exists(file) {
24741
24751
  try {
24742
- await fs2.access(file);
24752
+ accessSync(file);
24743
24753
  return true;
24744
24754
  } catch (e) {
24745
24755
  return false;
24746
24756
  }
24747
24757
  }
24748
- async function canRead(file) {
24758
+ function canRead(file) {
24749
24759
  try {
24750
- await fs2.access(file, (fs2.constants || fs2).R_OK);
24760
+ accessSync(file, (fs2.constants || fs2).R_OK);
24751
24761
  return true;
24752
24762
  } catch (e) {
24753
24763
  return false;
24754
24764
  }
24755
24765
  }
24756
- async function canWrite(file) {
24766
+ function canWrite(file) {
24757
24767
  try {
24758
- if (!await exists(file))
24768
+ if (!exists(file))
24759
24769
  return true;
24760
- await fs2.access(file, (fs2.constants || fs2).W_OK);
24770
+ accessSync(file, (fs2.constants || fs2).W_OK);
24761
24771
  return true;
24762
24772
  } catch (e) {
24763
24773
  return false;
@@ -24833,21 +24843,23 @@ async function install(packages, flags) {
24833
24843
 
24834
24844
  // src/link.ts
24835
24845
  import * as fs3 from "node:fs/promises";
24846
+ import { extname } from "node:path";
24836
24847
  import { pathToFileURL as pathToFileURL2 } from "url";
24837
24848
  import c5 from "picocolors";
24838
24849
  async function link(modules, flags) {
24839
24850
  const log2 = withType("link/link");
24840
24851
  log2(`Linking modules: ${modules.join(", ")}`);
24841
24852
  log2(`Flags: ${JSON.stringify(flags)}`);
24853
+ const fallbackMap = !modules[0] || isJsExtension(extname(modules[0])) ? void 0 : modules[0];
24842
24854
  const env2 = await getEnv(flags);
24843
- const inputMapPath = getInputPath(flags);
24855
+ const inputMapPath = getInputPath(flags, fallbackMap);
24844
24856
  const outputMapPath = getOutputPath(flags);
24845
24857
  const generator = await getGenerator(flags);
24846
24858
  const inlinePins = [];
24847
24859
  const resolvedModules = (await Promise.all(
24848
24860
  modules.map((spec) => resolveModule(spec, inlinePins, generator))
24849
24861
  )).filter((m) => !!m);
24850
- const input = await getInput(flags);
24862
+ const input = await getInput(flags, fallbackMap);
24851
24863
  const pins = inlinePins.concat(resolvedModules.map((p) => p.target));
24852
24864
  let allPins = pins;
24853
24865
  if (input) {
@@ -25103,8 +25115,8 @@ async function build(entry, options) {
25103
25115
  var cli = dist_default(c8.yellow("jspm"));
25104
25116
  var mapOpt = [
25105
25117
  "-m, --map <file>",
25106
- "File containing initial import map",
25107
- { default: "importmap.json" }
25118
+ "File containing initial import map (defaults to importmap.json, or the input HTML if linking)",
25119
+ {}
25108
25120
  ];
25109
25121
  var envOpt = [
25110
25122
  "-e, --env <environments>",
@@ -25190,7 +25202,7 @@ cli.command("link [...modules]", "link modules").alias("trace").option(...mapOpt
25190
25202
  `
25191
25203
  ).example(
25192
25204
  (name) => `Link an HTML file and update its import map including preload and integrity tags
25193
- $ ${name} link --map index.html --integrity --preload dynamic
25205
+ $ ${name} link --map index.html --integrity --preload
25194
25206
  `
25195
25207
  ).usage(
25196
25208
  `link [flags] [...modules]
package/jspm.js CHANGED
@@ -1,10 +1,10 @@
1
- #!/usr/bin/env node
2
- import c from "picocolors";
3
- import { cli } from './dist/cli.js';
4
-
5
- try {
6
- cli.parse();
7
- } catch (e) {
8
- if (e.constructor.name === "CACError")
9
- console.error(`${c.red("Err:")} ${e.message}\n`);
10
- }
1
+ #!/usr/bin/env node
2
+ import c from "picocolors";
3
+ import { cli } from './dist/cli.js';
4
+
5
+ try {
6
+ cli.parse();
7
+ } catch (e) {
8
+ if (e.constructor.name === "CACError")
9
+ console.error(`${c.red("Err:")} ${e.message}\n`);
10
+ }
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "name": "jspm",
3
- "type": "module",
4
- "version": "3.3.0",
5
- "description": "Import Map Package Manager",
6
- "license": "Apache-2.0",
7
- "bin": {
8
- "jspm": "./jspm.js"
9
- },
10
- "files": [
11
- "dist",
12
- "jspm.js"
13
- ],
14
- "dependencies": {
15
- "@jspm/generator": "^2.1.2",
16
- "cac": "^6.7.14",
17
- "ora": "^6.3.0",
18
- "picocolors": "^1.0.0",
19
- "rollup": "^3.29.2"
20
- },
21
- "devDependencies": {
22
- "@antfu/eslint-config": "^0.34.2",
23
- "@babel/core": "^7.24.7",
24
- "@types/node": "^18.15.11",
25
- "esbuild": "^0.16.17",
26
- "eslint": "^8.38.0",
27
- "eslint-config-prettier": "^8.8.0",
28
- "prettier": "^2.8.7",
29
- "tinyspy": "^1.1.1",
30
- "tsx": "^4.16.2",
31
- "typescript": "^4.9.5"
32
- }
33
- }
1
+ {
2
+ "name": "jspm",
3
+ "type": "module",
4
+ "version": "3.3.2",
5
+ "description": "Import Map Package Manager",
6
+ "license": "Apache-2.0",
7
+ "bin": {
8
+ "jspm": "./jspm.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "jspm.js"
13
+ ],
14
+ "dependencies": {
15
+ "@jspm/generator": "^2.1.2",
16
+ "cac": "^6.7.14",
17
+ "ora": "^6.3.0",
18
+ "picocolors": "^1.0.0",
19
+ "rollup": "^3.29.2"
20
+ },
21
+ "devDependencies": {
22
+ "@antfu/eslint-config": "^0.34.2",
23
+ "@babel/core": "^7.24.7",
24
+ "@types/node": "^18.15.11",
25
+ "esbuild": "^0.16.17",
26
+ "eslint": "^8.38.0",
27
+ "eslint-config-prettier": "^8.8.0",
28
+ "prettier": "^2.8.7",
29
+ "tinyspy": "^1.1.1",
30
+ "tsx": "^4.16.2",
31
+ "typescript": "^4.9.5"
32
+ }
33
+ }