forked from jspm/jspm.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
498 lines (420 loc) · 16.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
<!doctype html>
<html>
<title>jspm.io - Frictionless Browser Package Management</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<script src="https://jspm.io/[email protected]"></script>
<style type="text/css">
code {
padding: 5px;
}
code.javascript, code.html {
padding: 0px;
}
code .comment, code .comment .keyword {
color: #494;
font-weight: 100;
}
code .string, code .string .comment {
color: #BE1717;
}
code .keyword {
font-weight: bold;
color: #767;
}
@font-face {
font-family: 'Advent Pro';
src: url('fonts/advent-Lt1.eot');
src: local('☺'), url('fonts/advent-Lt1.woff') format('woff'), url('fonts/advent-Lt1.ttf') format('truetype'), url('fonts/advent-Lt1.svg') format('svg');
font-weight: normal;
font-style: normal;
}
body {
margin: 20px;
margin-top: 100px;
padding: 0;
background-image: url(bgtexture.jpg);
background-repeat: repeat;
background-color: #eee;
}
h1, h2, h3, h4, h5, h6, p, li, a {
font-family: 'Myriad Pro', 'Myriad Set Pro', Myriad, 'Helvetica Neue', Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
font-weight: 400;
}
h1, h2, h3, h4 {
-webkit-font-smoothing: antialiased;
font-weight: 200;
}
code {
-webkit-font-smoothing: antialiased;
}
.cdn-icon, .cli-icon, .loader-icon {
background-image: url(icons.png);
width: 46px;
height: 46px;
margin-bottom: -64px;
}
.loader-icon {
background-position: 0 -107px;
}
.loader-icon + h4 {
margin-left: 55px;
}
.cdn-icon + h4 {
margin-left: 55px;
}
.cli-icon +h4 {
margin-left: 55px;
}
.cli-icon {
background-position: -18px -58px;
background-repeat: no-repeat;
margin-left: 16px;
}
.cdn-icon {
background-position: 0 -153px;
}
.logobox {
background-image: url(icons.png);
width: 46px;
height: 46px;
margin-bottom: -55px;
margin-left: auto;
margin-right: auto;
padding-left: 180px;
background-repeat: no-repeat;
margin-top: 50px;
}
strong {
color: #666;
}
h1.logo {
font-family: 'Advent Pro', 'Myriad Pro', sans-serif;
color: #7F7F7F;
font-size: 60px;
margin: 0;
margin-bottom: 40px;
text-align: center;
text-shadow: 1px 1px 1px #fff;
}
h1.logo span {
color: #CE882C;
}
h1 {
color: #C0781A;
text-shadow: 1px 1px 1px #fff;
text-align: center;
}
h2 {
font-size: 22px;
text-shadow: 1px 1px 1px #fff;
color: #555;
text-align: center;
}
h3 {
font-size: 28px;
color: #444;
text-shadow: 1px 1px 1px #fff;
}
h4 {
font-size: 22px;
color: #666;
text-shadow: 1px 1px 1px #fff;
}
.content {
margin-top: 50px;
width: 600px;
margin-left: auto;
margin-right: auto;
text-align: justify;
margin-bottom: 200px;
}
.content p, .content li {
line-height: 26px;
color: #333;
text-shadow: 1px 1px 1px #fff;
}
.content pre {
background-color: #f5f5f5;
padding: 10px;
margin-top: 30px;
margin-bottom: 30px;
font-size: 12px;
line-height: 16px;
border: 1px solid #C5C5C5;
border-radius: 7px;
color: #444;
white-space: pre-wrap;
}
.content a {
color: #333;
text-shadow: 1px 1px 1px #fff;
}
.content a:hover {
color: #C0781A;
}
.content a[id] {
display: block;
height: 20px;
}
.loading {
margin-top: 80px;
text-align: center;
width: 28px;
height: 25px;
margin-left: auto;
margin-right: auto;
background-color: #E2E2E2;
border: 1px solid #aaa;
padding: 10px;
border-radius: 8px;
}
.cog {
width: 24px;
height: 30px;
background-image: url(cog.gif);
background-repeat: no-repeat;
margin-left: auto;
margin-right: auto;
}
.signup-group {
margin-bottom: 40px;
width: 301px;
margin-left: auto;
margin-right: auto;
position: relative;
}
input.signup {
border: 1px solid #555;
font-size: 12px;
width: 210px;
color: #888;
padding: 10px;
border: 1px solid #C1C1C1;
text-shadow: 1px 1px 1px #fff;
font-style: italic;
position: absolute;
left: 0px;
top: 0px;
margin: 0;
}
.signup-group input.signup-submit {
border: 1px solid #C1C1C1;
background-color: #E2E2E2;
font-size: 12px;
color: #666;
height: 37px;
width: 70px;
padding: 0;
position: absolute;
top: 0px;
right: 0px;
cursor: pointer;
background-repeat: no-repeat;
}
.signup-group input.signup-submit:hover {
background-color: #eee;
}
.signup-group input.signup-submit:active {
background-color: #ddd;
}
.contents {
position: fixed;
top: 100px;
left: 0px;
}
.contents a {
height: 40px;
line-height: 40px;
padding-left: 20px;
padding-right: 20px;
font-size: 16px;
border-bottom: 1px dashed #999;
display: block;
color: #777;
text-decoration:none;
text-shadow: 1px 1px 1px #fff;
}
.contents a:active {
background-color: #ddd;
}
.contents a:hover {
background-color: #ddd;
}
a.button {
width: 178px;
height: 40px;
text-align: center;
float: left;
margin-left: 10px;
margin-right: 10px;
line-height: 42px;
color: #666;
text-decoration: none;
text-shadow: 1px 1px 1px #fff;
background-color: #ddd;
border: 1px solid #aaa;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
a.button:hover {
color: #444;
}
@media screen and (max-width: 640px),
screen and (max-device-width: 640px) {
.content {
width: 100%;
}
.contents {
display: none;
}
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40327700-1', 'jspm.io');
ga('send', 'pageview');
</script>
<body>
<a id="intro"></a>
<div class="logobox"></div>
<h1 class="logo"> <span>jspm</span>.io</h1>
<h2 class="tagline">Frictionless browser package management</h2>
<div class="content">
<div class="loading">
<div class="cog"></div>
</div>
</div>
<!-- <div class="contents">
<a href="#introduction">Introduction</a>
<a href="#examples">Examples</a>
<a href="#feedbackroadmap">Feedback & Roadmap</a>
</div> -->
<markdown style="display: none;">
* jspm is a package manager for the [SystemJS universal module loader](https://github.com/systemjs/systemjs), built on top of the dynamic [ES6 module loader](https://github.com/ModuleLoader/es6-module-loader)
* Load any module format (ES6, AMD, CommonJS and globals) directly from any registry such as `npm` and `GitHub` with flat versioned dependency management. Any custom registry endpoints can be created through the Registry API.
* For development, load modules as separate files with ES6 and plugins compiled in the browser.
* For production (or development too), optimize into a bundle, layered bundles or a self-executing bundle with a single command.
<br>
<!-- <a class="button" href="#guides">Guides</a>
<a class="button" href="#introduction">Introduction</a>
<a class="button" href="#project-overview">Project Overview</a>
<div style="clear:both;"></div>
<br>-->
<a name="guides"></a>
# Guides
* jspm 0.16 stable - [Getting Started guide in the documentation](http://jspm.io/docs/getting-started.html)
* jspm 0.17 beta (unstable) - [Beta overview and guide](http://jspm.io/0.17-beta-guide/index.html)
* [Choose ES6 Modules Today](http://developer.telerik.com/featured/choose-es6-modules-today/) article with screencasts by [Cody Lindley](http://codylindley.com/)
* [ES6 Modules & React with SystemJS](https://www.youtube.com/watch?v=NpMnRifyGyw) live coding presentation by [Jack Franklin](https://twitter.com/Jack_Franklin)
<div style="text-align: center;">
<iframe width="560" height="315" src="http://www.youtube.com/embed/NpMnRifyGyw" frameborder="0" allowfullscreen></iframe>
</div>
* [JavaScript in 2015](http://glenmaddern.com/articles/javascript-in-2015) article and screencast by [Glen Maddern](https://twitter.com/glenmaddern)
<div style="text-align: center;">
<iframe width="560" height="315" src="http://www.youtube.com/embed/iukBMY4apvI" frameborder="0" allowfullscreen></iframe>
</div>
* [JavaScript Modules and Dependencies with jspm](http://javascriptplayground.com/blog/2014/11/js-modules-jspm-systemjs/) tutorial by [Jack Franklin](https://twitter.com/Jack_Franklin)
* [Package Management for ES6 Modules](https://www.youtube.com/watch?v=szJjsduHBQQ) JSConf 2014 presentation introducing jspm by [Guy Bedford](https://twitter.com/guybedford)
<div style="text-align: center;">
<iframe width="560" height="315" src="http://www.youtube.com/embed/szJjsduHBQQ" frameborder="0" allowfullscreen></iframe>
</div>
<br>
<!-- <a name="introduction"></a>
# Introduction
jspm is a package manager for the [SystemJS universal module loader](https://github.com/systemjs/systemjs), built on top of the dynamic [ES6 module loader](https://github.com/ModuleLoader/es6-module-loader)
Load any module format (ES6, AMD, CommonJS and globals) directly from endpoints such as `npm` and `github` with flat versioned dependency management.
For production, use the jspm CLI tool to download packages locally, lock down versions and build into a bundle.
In development, load modules directly from CDN for frictionless experimentation, switching into production on the same code with a single configuration change.
<br> -->
<a name="project-overview"></a>
# Project Overview
<div class="loader-icon"></div>
#### SystemJS
jspm package management is designed around the [SystemJS dynamic ES6 loader](https://github.com/systemjs/systemjs).
* RequireJS-style module loader with similar configuration and [plugin system](https://github.com/systemjs/systemjs#plugins).
* Built on top of the [ES6 Module Loader polyfill](https://github.com/ModuleLoader/es6-module-loader), making it standards-compliant and future-friendly.
[Read more at the SystemJS project page on GitHub](https://github.com/systemjs/systemjs)
_Note that SystemJS is built on top of a draft module loader specification that is subject to change._
<br>
<div class="cli-icon"></div>
#### jspm CLI
* Uses flat version management to download into version-suffixed folders (eg `jspm_packages/npm/[email protected]`).
* Shares versions between dependencies, upgrading or downgrading dependency resolutions within their supported ranges to minimize forks during install.
* Because the installer understands the loader, modular code [including loader plugins](https://github.com/systemjs/systemjs#plugins), works with a single install and a single require.
[Read the CLI documentation on Github](https://github.com/jspm/jspm-cli)
**Registries**
jspm is designed to support any number of independent registries.
* All packages are universally named to a registry with the syntax `registry:package@version`.
* When importing external modules, we refer to them with an alias like `jquery`, which maps to the universal name in the background.
* Each package has its own map, allowing `jquery` to refer to different things for different packages and supporting multi-versions.
The following registries are currently supported:
* **npm:**
* Most packages on npm will work naturally with full version management, with no further configuration necessary.
* The NodeJS builtins are provided by the same libraries used in Browserify.
* **GitHub:**
* Packages on GitHub get their versions from semver tag names (with or without a `v` prefix).
* When a GitHub release for a given tag is provided, the release archive will be used instead of the repo.
* GitHub packages will benefit from jspm configuration being provided through the package.json or an override.
**Registry**
The [jspm registry](https://github.com/jspm/registry) provides a convenience mapping from shortcut names into full registry names.
This allows for easier installation - `jspm install jquery` over `jspm install github:components/jquery`, and provides the default aliasing.
It also indicates packages which are jspm-compatible and makes it clear where the primary package source for jspm is (GitHub or npm).
[Browse the registry](http://kasperlewau.github.io/registry)
**Version Management**
jspm CLI implements shortest-path fork reduction during installs, while ensuring targets are at their latest patch versions to reduce bugs.
The version solution is created within the project configuration file, and can be checked-in to version control to lock dependencies.
**Package Configuration**
[jspm extends the package.json spec](https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm) with some new properties to understand how to treat packages.
Configuration options include the main entry point, module format, files and ignore rules, map config and dependencies (when combined with a registry property).
To provide configuration for existing libraries on GitHub or npm without access to the underlying repo, the jspm registry provides a [package.json override service](https://github.com/jspm/registry#packagejson-overrides).
<br>
<div class="cdn-icon"></div>
#### CDNs
The added benefit of using a flat versioned folder structure for dependencies is that packages can be hosted easily on a shared CDN for dynamic loading.
Since jspm assigns packages universal names, it is possible for registry CDNs to be provided that can be used by all users.
An experimental CDN serving the jspm registry, GitHub and npm registries is provided through jspm.io. To use it for development include:
```
<script src="https://jspm.io/[email protected]"></script>
```
in a page. Since sources are sent minified over HTTP/2, [depCache injection](http://jspm.io/docs/production-workflows.html#creating-a-dependency-cache) can even make this approach suitable for production.
The CDN can also be tested from this page - try opening up the browser console and using `System.import`. Some examples are included below.
**Loading NodeJS core browserify libraries**
```javascript
System.import('buffer').then(function(buffer) {
console.log(new buffer.Buffer('base64 encoded').toString('base64'));
});
```
**Loading from npm**
```javascript
System.import('npm:lodash').then(function(_) {
console.log(_.max([1, 2, 3, 4]));
});
```
**Loading jQuery**
```javascript
System.import('jquery').then(function($) {
$(window).scrollTop(0);
});
```
</markdown>
<a href="https://github.com/jspm/jspm-cli"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<script>
System['import']('[email protected]').then(function(showdown) {
var converter = new showdown.Converter();
document.querySelector('.content').innerHTML = converter.makeHtml(document.querySelector('markdown').textContent);
Array.prototype.forEach.call(document.querySelectorAll('code.javascript'), function(code) {
code.innerHTML = code.innerHTML
.replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
.replace(/('[^']*')/gm, '<span class="string">$1</span>')
.replace(/([^#\d])(\d+)/gm, '$1<span class="number">$2</span>')
.replace(/([^\.])(for|function|new|throw|return|var|if|else|true|false|this|import|export class|export|from)\b/gm, '$1<span class="keyword">$2</span>');
});
});
</script>
</body>