├── .gitignore
├── LICENSE
├── README.md
├── config
├── activewidgets.js
├── angular-1.js
├── angular.js
├── aurelia.js
├── core.js
├── ember.js
├── lodash.js
├── rxjs.js
├── vue.js
└── zone.js
├── docs
├── CNAME
├── _config.yml
├── _layouts
│ └── default.html
├── allow-file-access.md
├── assets
│ └── css
│ │ └── style.scss
├── code.gif
└── index.md
├── examples
├── angular-1
│ └── es5
│ │ └── hello.html
├── angular
│ ├── es5
│ │ ├── hello
│ │ │ ├── app
│ │ │ │ ├── app.component.html
│ │ │ │ ├── app.component.js
│ │ │ │ └── app.module.js
│ │ │ ├── hello.html
│ │ │ └── main.js
│ │ └── x-module
│ │ │ └── hello.html
│ ├── es6
│ │ ├── hello
│ │ │ ├── app
│ │ │ │ ├── app.component.html
│ │ │ │ ├── app.component.js
│ │ │ │ └── app.module.js
│ │ │ ├── hello.html
│ │ │ └── main.js
│ │ └── x-module
│ │ │ └── hello.html
│ └── ts
│ │ ├── hello
│ │ ├── app
│ │ │ ├── app.component.html
│ │ │ ├── app.component.ts
│ │ │ └── app.module.ts
│ │ ├── hello.html
│ │ └── main.ts
│ │ ├── realworld
│ │ ├── github.html
│ │ └── local.html
│ │ └── x-module
│ │ └── hello.html
├── aurelia
│ └── es5
│ │ ├── hello
│ │ ├── hello.html
│ │ └── src
│ │ │ ├── app.html
│ │ │ ├── app.js
│ │ │ └── main.js
│ │ └── x-module
│ │ └── hello.html
├── common
│ ├── es5
│ │ └── index
│ │ │ ├── folder
│ │ │ └── index.js
│ │ │ ├── hello.html
│ │ │ └── main.js
│ └── es6
│ │ └── index
│ │ ├── folder
│ │ └── index.js
│ │ ├── hello.html
│ │ └── main.js
├── ember
│ └── es5
│ │ └── hello.html
├── handlebars
│ └── es5
│ │ ├── hello
│ │ ├── hello.hbs
│ │ ├── hello.html
│ │ ├── hello.js
│ │ └── hello.json
│ │ └── x-module
│ │ └── hello.html
├── inferno
│ └── es6
│ │ └── hello.html
├── jquery
│ ├── es5
│ │ └── hello.html
│ └── es6
│ │ └── hello.html
├── lodash
│ ├── es5
│ │ ├── hello
│ │ │ ├── hello.html
│ │ │ ├── hello.js
│ │ │ ├── hello.json
│ │ │ └── hello.tpl
│ │ └── x-module
│ │ │ └── hello.html
│ └── es6
│ │ ├── hello
│ │ ├── hello.html
│ │ ├── hello.js
│ │ ├── hello.json
│ │ └── hello.tpl
│ │ └── x-module
│ │ └── hello.html
├── react
│ └── es6
│ │ └── hello.html
└── vue
│ ├── es5
│ ├── hello
│ │ ├── app.vue
│ │ ├── hello.html
│ │ └── main.js
│ └── x-module
│ │ └── hello.html
│ ├── es6
│ ├── hello
│ │ ├── app.vue
│ │ ├── hello.html
│ │ └── main.js
│ ├── sfc-class
│ │ ├── app.vue
│ │ ├── hello.html
│ │ └── main.js
│ └── x-module
│ │ └── hello.html
│ └── ts
│ ├── hello
│ ├── app.vue
│ ├── hello.html
│ └── main.ts
│ ├── sfc-class
│ ├── app.vue
│ ├── hello.html
│ └── main.ts
│ └── x-module
│ └── hello.html
├── gulpfile.js
├── package.json
├── plugins
├── babel.js
├── cached.js
├── cdnjs.js
├── files.js
├── handlebars.js
├── index.js
├── js.js
├── json.js
├── package.js
├── preload.js
├── roots.js
├── scan.js
├── text.js
├── typescript.js
├── vue.js
└── x-modules.js
├── src
├── browsersync.js
├── config.js
├── idb.js
├── libs.js
├── min.js
└── worker.js
└── test
├── e2e
├── basics.js
└── realworld.js
└── wdio.local.js
/.gitignore:
--------------------------------------------------------------------------------
1 | /dist
2 | /node_modules
3 | /screenshots
4 | /server.js
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 ActiveWidgets
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | [](http://getlibs.com/)
3 | [](http://getlibs.com/)
4 | [](http://getlibs.com/)
5 |
6 | # https://unpkg.com/getlibs
7 |
8 | An in-browser [module loader](https://github.com/systemjs/systemjs) configured to get external dependencies directly from CDN. Includes babel/typescript. For quick prototyping, code sharing, teaching/learning - a super simple web dev environment without node/webpack/etc.
9 |
10 | 
11 |
12 | ## All front-end libraries
13 |
14 | Angular, React, Vue, Bootstrap, Handlebars, jQuery are included. Plus all packages from [cdnjs.com](https://cdnjs.com/) and all of NPM (via [unpkg.com](https://unpkg.com/)). Most front-end libraries should work out of the box - just use `import`/`require()`. If a popular library does not load, tell us and we'll try to solve it with some library-specific config.
15 |
16 | ## Write modern javascript (or typescript)
17 |
18 | Use latest language features or JSX and the code will be transpiled in-browser via babel or typescript (if required). To make it fast the transpiler will start in a worker thread and only process the modified code. Unless you change many files at once or open the project for the first time, the transpiling should be barely noticeable as it runs in parallel with loading and initializing the UI framework.
19 |
20 | ## No server/build required
21 |
22 | No need for a build process or even a web server. Just [use static files](#running-from-filesystem), open in a browser and hit refresh :-). Or run [Browsersync](https://www.browsersync.io/) in watch mode for auto-reload.
23 |
24 | ATTENTION! This is all good for dev environment only. Before going to production, you still need to setup webpack/rollup/eslint/karma/whatever and run a proper build. It is not a good idea to transpile your code in-browser in production (unless it is only required for a small number of older browsers - but we are not there yet :-).
25 |
26 | ## Installation
27 |
28 | There is nothing to install, just include a link to `getlibs` script on CDN -
29 |
30 | ```html
31 |
32 | ```
33 |
34 | ## Usage
35 |
36 | Organize your code as separate modules and call `System.import()` to load the app.
37 | ```html
38 |
41 | ```
42 |
43 | Or use `` to put everything into `index.html`
44 |
45 | ##### ES5/require()
46 | ```js
47 | var compile = require('lodash/template'),
48 | template = require('./hello.tpl'),
49 | data = require('./hello.json'),
50 | render = compile(template);
51 |
52 | document.getElementById('app').innerHTML = render(data);
53 | ```
54 |
55 | [Full Source]
56 | [Open in browser]
57 |
58 |
59 | ##### ES6/import
60 | ```js
61 | import React from 'react';
62 | import ReactDOM from 'react-dom';
63 | const msg = 'Hello World!';
64 |
65 | ReactDOM.render(
{msg} , document.getElementById('app'));
66 | ```
67 |
68 | [Full Source]
69 | [Open in browser]
70 |
71 |
72 | ##### Typescript
73 | ```ts
74 | import {Component} from '@angular/core';
75 |
76 | @Component({
77 | selector: '#app',
78 | templateUrl: './app.component.html'
79 | })
80 |
81 | export class AppComponent {
82 | msg = 'Hello World!';
83 | }
84 | ```
85 |
86 | [Full Source]
87 | [Open in browser]
88 |
89 | ## Running from filesystem
90 |
91 | You will get cross origin errors if you open the examples in chrome directly from the filesystem. To allow file access in chrome lauch it with `--allow-file-access-from-files` flag ([more info](https://stackoverflow.com/questions/18586921/how-to-launch-html-using-chrome-at-allow-file-access-from-files-mode)).
92 |
93 | ## How it works
94 |
95 | `getlibs` is based on [SystemJS](https://github.com/systemjs/systemjs) module loader. Instead of typical setup where it looks for external packages in `node_modules` directory, `getlibs` is configured to load libraries directly from NPM (via [unpkg.com](https://unpkg.com/)) or [cdnjs.com](https://cdnjs.com/), if available.
96 |
97 | ## About
98 |
99 | [SystemJS](https://github.com/systemjs/systemjs) is a module loader developed by [Guy Bedford](https://github.com/guybedford).
100 |
101 | `getlibs` is a bundle of SystemJS with a custom config - maintained by [ActiveWidgets](http://www.activewidgets.com/).
102 |
103 | [](http://www.activewidgets.com/)
104 |
--------------------------------------------------------------------------------
/config/activewidgets.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 | 'activewidgets': {main: 'dist/ax.js'}
6 | },
7 |
8 | map: {
9 | 'activewidgets': 'https://cdn.activewidgets.com/'
10 | }
11 | });
12 |
--------------------------------------------------------------------------------
/config/angular-1.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 | 'angular': {exports: 'angular'}
6 | }
7 |
8 | });
9 |
--------------------------------------------------------------------------------
/config/angular.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 | '@angular/core': {main: 'bundles/core.umd.min.js', meta: {'*.js': {deps: ['core-js', 'zone.js', 'rxjs']}}},
6 | '@angular/common': {main: 'bundles/common.umd.min.js'},
7 | '@angular/compiler': {main: 'bundles/compiler.umd.min.js'},
8 | '@angular/platform-browser': {main: 'bundles/platform-browser.umd.min.js'},
9 | '@angular/platform-browser-dynamic': {main: 'bundles/platform-browser-dynamic.umd.min.js'},
10 | '@angular/forms': {main: 'bundles/forms.umd.min.js'},
11 | '@angular/http': {main: 'bundles/http.umd.min.js'},
12 | '@angular/router': {main: 'bundles/router.umd.min.js'}
13 | }
14 |
15 | });
16 |
--------------------------------------------------------------------------------
/config/aurelia.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | bundles: {
5 | 'aurelia-core': [
6 | 'aurelia-binding',
7 | 'aurelia-bootstrapper',
8 | 'aurelia-dependency-injection',
9 | 'aurelia-event-aggregator',
10 | 'aurelia-framework',
11 | 'aurelia-loader',
12 | 'aurelia-loader-default',
13 | 'aurelia-logging',
14 | 'aurelia-logging-console',
15 | 'aurelia-metadata',
16 | 'aurelia-pal',
17 | 'aurelia-pal-browser',
18 | 'aurelia-path',
19 | 'aurelia-polyfills',
20 | 'aurelia-task-queue',
21 | 'aurelia-templating',
22 | 'aurelia-templating-binding',
23 | 'aurelia-templating-resources'
24 | ],
25 |
26 | 'aurelia-routing': [
27 | 'aurelia-history',
28 | 'aurelia-history-browser',
29 | 'aurelia-route-recognizer',
30 | 'aurelia-router',
31 | 'aurelia-templating-router'
32 | ]
33 | },
34 |
35 | map: {
36 | 'aurelia-core': 'https://rawgit.com/aurelia/aurelia/master/scripts/aurelia-core.min.js',
37 | 'aurelia-routing': 'https://rawgit.com/aurelia/aurelia/master/scripts/aurelia-routing.min.js'
38 | }
39 | });
40 |
41 |
--------------------------------------------------------------------------------
/config/core.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 |
6 | 'core-js': {main: 'core.min.js', meta: {
7 | 'core.min.js': {loader: 'cdn'},
8 | 'core.js': {loader: 'cdn'},
9 | '*': {loader: 'pkg'}
10 | }}
11 | }
12 |
13 | });
14 |
--------------------------------------------------------------------------------
/config/ember.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 | 'ember-source': {main: 'dist/ember.min.js', meta: {'*.js': {format: 'global', deps: ['jquery', './ember-template-compiler']}}}
6 | },
7 |
8 | map: {
9 | 'ember': 'ember-source'
10 | }
11 | });
12 |
13 |
--------------------------------------------------------------------------------
/config/lodash.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 |
6 | 'lodash': {main: 'lodash.min.js', defaultExtension: 'js', meta: {
7 | 'lodash.min.js': {loader: 'cdn'},
8 | 'lodash.js': {loader: 'cdn'},
9 | '*': {loader: 'pkg/*'}
10 | }}
11 | }
12 |
13 | });
14 |
--------------------------------------------------------------------------------
/config/rxjs.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | packages: {
5 |
6 | 'rxjs': {main: 'Rx.min.js', meta: {
7 | 'observable/*': {loader: 'pkg/Observable'},
8 | 'operator/*': {loader: 'pkg/Observable.prototype'},
9 | 'Rx.min.js': {loader: 'cdn'},
10 | 'Rx.js': {loader: 'cdn'},
11 | '*': {loader: 'pkg'}
12 | }}
13 | },
14 |
15 | map: {
16 | 'rxjs': '@reactivex/rxjs',
17 | 'rxjs/Rx': '@reactivex/rxjs',
18 | '@reactivex/rxjs': '@reactivex/rxjs'
19 | }
20 | });
21 |
--------------------------------------------------------------------------------
/config/vue.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | map: {
5 | 'vue-class-component': 'vue-class-component/dist/vue-class-component.min.js'
6 | }
7 | });
8 |
9 |
--------------------------------------------------------------------------------
/config/zone.js:
--------------------------------------------------------------------------------
1 |
2 | config({
3 |
4 | map: {
5 | 'zone.js/dist/zone': 'zone.js'
6 | }
7 | });
8 |
--------------------------------------------------------------------------------
/docs/CNAME:
--------------------------------------------------------------------------------
1 | getlibs.com
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
2 | title: unpkg.com/getlibs
3 | description: Modern javascript. All front-end libraries. No server/build.
4 | google_analytics: UA-35823479-2
5 |
--------------------------------------------------------------------------------
/docs/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {% if page.title %}{{ page.title }} | {% endif %}{{ site.title | default: site.github.repository_name }} by {{ site.github.owner_name }}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
24 |
25 |
26 | {{ content }}
27 |
28 |
34 |
35 |
36 | {% if site.google_analytics %}
37 |
46 | {% endif %}
47 |
48 |
--------------------------------------------------------------------------------
/docs/allow-file-access.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Allow file access
3 | ---
4 |
5 | ## Running from filesystem
6 |
7 | You will get cross origin errors if you open the examples in chrome directly from the filesystem. To allow file access in chrome lauch it with `--allow-file-access-from-files` flag ([more info](https://stackoverflow.com/questions/18586921/how-to-launch-html-using-chrome-at-allow-file-access-from-files-mode)).
8 |
9 |
--------------------------------------------------------------------------------
/docs/assets/css/style.scss:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 | @import "{{ site.theme }}";
5 |
6 | .page-header {
7 | color: #fff;
8 | text-align: center;
9 | background-color: #333;
10 | background-image: linear-gradient(120deg, #555, #111);
11 | }
12 |
13 | .main-content h1,
14 | .main-content h2,
15 | .main-content h3,
16 | .main-content h4,
17 | .main-content h5,
18 | .main-content h6 {
19 | margin-top: 2rem;
20 | margin-bottom: 1rem;
21 | font-weight: bold;
22 | color: #666;
23 | }
24 |
--------------------------------------------------------------------------------
/docs/code.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/activewidgets/getlibs/e59f03930e54a169d937a96d781236d4f5881075/docs/code.gif
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Modern javascript. All front-end libraries. No server/build.
3 | description: the simplest way to start a new project.
4 | ---
5 |
6 | [](https://www.npmjs.com/package/getlibs)
7 | [](https://www.npmjs.com/package/getlibs)
8 | [](https://www.npmjs.com/package/getlibs)
9 |
10 | An in-browser [module loader](https://github.com/systemjs/systemjs) configured to get external dependencies directly from CDN. Includes babel/typescript. For quick prototyping, code sharing, teaching/learning - a super simple web dev environment without node/webpack/etc.
11 |
12 | 
13 |
14 | ## All front-end libraries
15 |
16 | Angular, React, Vue, Bootstrap, Handlebars, jQuery are included. Plus all packages from [cdnjs.com](https://cdnjs.com/) and all of NPM (via [unpkg.com](https://unpkg.com/)). Most front-end libraries should work out of the box - just use `import`/`require()`. If a popular library does not load, tell us and we'll try to solve it with some library-specific config.
17 |
18 | ## Write modern javascript (or typescript)
19 |
20 | Use latest language features or JSX and the code will be transpiled in-browser via babel or typescript (if required). To make it fast the transpiler will start in a worker thread and only process the modified code. Unless you change many files at once or open the project for the first time, the transpiling should be barely noticeable as it runs in parallel with loading and initializing the UI framework.
21 |
22 | ## No server/build required
23 |
24 | No need for a build process or even a web server. Just [use static files](#running-from-filesystem), open in a browser and hit refresh :-). Or run [Browsersync](https://www.browsersync.io/) in watch mode for auto-reload.
25 |
26 | ATTENTION! This is all good for dev environment only. Before going to production, you still need to setup webpack/rollup/eslint/karma/whatever and run a proper build. It is not a good idea to transpile your code in-browser in production (unless it is only required for a small number of older browsers - but we are not there yet :-).
27 |
28 | ## Installation
29 |
30 | There is nothing to install, just include a link to `getlibs` script on CDN -
31 |
32 | ```html
33 |
34 | ```
35 |
36 | ## Usage
37 |
38 | Organize your code as separate modules and call `System.import()` to load the app.
39 | ```html
40 |
43 | ```
44 |
45 | Or use `` to put everything into `index.html`
46 |
47 | ##### ES5/require()
48 | ```js
49 | var compile = require('lodash/template'),
50 | template = require('./hello.tpl'),
51 | data = require('./hello.json'),
52 | render = compile(template);
53 |
54 | document.getElementById('app').innerHTML = render(data);
55 | ```
56 |
57 | [Full Source]
58 | [Open in browser]
59 |
60 |
61 | ##### ES6/import
62 | ```js
63 | import React from 'react';
64 | import ReactDOM from 'react-dom';
65 | const msg = 'Hello World!';
66 |
67 | ReactDOM.render({msg} , document.getElementById('app'));
68 | ```
69 |
70 | [Full Source]
71 | [Open in browser]
72 |
73 |
74 | ##### Typescript
75 | ```ts
76 | import {Component} from '@angular/core';
77 |
78 | @Component({
79 | selector: '#app',
80 | templateUrl: './app.component.html'
81 | })
82 |
83 | export class AppComponent {
84 | msg = 'Hello World!';
85 | }
86 | ```
87 |
88 | [Full Source]
89 | [Open in browser]
90 |
91 | ## Running from filesystem
92 |
93 | You will get cross origin errors if you open the examples in chrome directly from the filesystem. To allow file access in chrome lauch it with `--allow-file-access-from-files` flag ([more info](https://stackoverflow.com/questions/18586921/how-to-launch-html-using-chrome-at-allow-file-access-from-files-mode)).
94 |
95 | ## How it works
96 |
97 | `getlibs` is based on [SystemJS](https://github.com/systemjs/systemjs) module loader. Instead of typical setup where it looks for external packages in `node_modules` directory, `getlibs` is configured to load libraries directly from NPM (via [unpkg.com](https://unpkg.com/)) or [cdnjs.com](https://cdnjs.com/), if available.
98 |
99 | ## About
100 |
101 | [SystemJS](https://github.com/systemjs/systemjs) is a module loader developed by [Guy Bedford](https://github.com/guybedford).
102 |
103 | `getlibs` is a bundle of SystemJS with a custom config - maintained by [ActiveWidgets](http://www.activewidgets.com/).
104 |
105 | [](http://www.activewidgets.com/)
106 |
--------------------------------------------------------------------------------
/examples/angular-1/es5/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Loading..
9 |
10 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/examples/angular/es5/hello/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | {{msg}}
3 |
--------------------------------------------------------------------------------
/examples/angular/es5/hello/app/app.component.js:
--------------------------------------------------------------------------------
1 |
2 | var Component = require('@angular/core').Component;
3 |
4 | function AppComponent(){
5 | this.msg = 'Hello World!';
6 | }
7 |
8 | AppComponent.annotations = [new Component({
9 | selector: '#app',
10 | templateUrl: './app.component.html'
11 | })];
12 |
13 | exports.AppComponent = AppComponent;
--------------------------------------------------------------------------------
/examples/angular/es5/hello/app/app.module.js:
--------------------------------------------------------------------------------
1 |
2 | var NgModule = require('@angular/core').NgModule,
3 | BrowserModule = require('@angular/platform-browser').BrowserModule,
4 | AppComponent = require('./app.component').AppComponent;
5 |
6 |
7 | function AppModule(){}
8 |
9 | AppModule.annotations = [new NgModule({
10 | imports: [BrowserModule],
11 | declarations: [AppComponent],
12 | bootstrap: [AppComponent]
13 | })];
14 |
15 | exports.AppModule = AppModule;
--------------------------------------------------------------------------------
/examples/angular/es5/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/angular/es5/hello/main.js:
--------------------------------------------------------------------------------
1 |
2 | var platformBrowserDynamic = require('@angular/platform-browser-dynamic').platformBrowserDynamic,
3 | AppModule = require('app/app.module').AppModule;
4 |
5 | platformBrowserDynamic().bootstrapModule(AppModule);
6 |
--------------------------------------------------------------------------------
/examples/angular/es5/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
39 |
40 |
--------------------------------------------------------------------------------
/examples/angular/es6/hello/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | {{msg}}
3 |
--------------------------------------------------------------------------------
/examples/angular/es6/hello/app/app.component.js:
--------------------------------------------------------------------------------
1 |
2 | import {Component} from '@angular/core';
3 |
4 | export class AppComponent {
5 | constructor(){
6 | this.msg = 'Hello World!';
7 | }
8 | }
9 |
10 | AppComponent.annotations = [new Component({
11 | selector: '#app',
12 | templateUrl: './app.component.html'
13 | })];
14 |
--------------------------------------------------------------------------------
/examples/angular/es6/hello/app/app.module.js:
--------------------------------------------------------------------------------
1 |
2 | import {NgModule} from '@angular/core';
3 | import {BrowserModule} from '@angular/platform-browser';
4 | import {AppComponent} from './app.component';
5 |
6 |
7 | export class AppModule{}
8 |
9 | AppModule.annotations = [new NgModule({
10 | imports: [BrowserModule],
11 | declarations: [AppComponent],
12 | bootstrap: [AppComponent]
13 | })];
14 |
--------------------------------------------------------------------------------
/examples/angular/es6/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/angular/es6/hello/main.js:
--------------------------------------------------------------------------------
1 |
2 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
3 | import {AppModule} from 'app/app.module';
4 |
5 | platformBrowserDynamic().bootstrapModule(AppModule);
6 |
--------------------------------------------------------------------------------
/examples/angular/es6/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/examples/angular/ts/hello/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | {{msg}}
3 |
--------------------------------------------------------------------------------
/examples/angular/ts/hello/app/app.component.ts:
--------------------------------------------------------------------------------
1 |
2 | import {Component} from '@angular/core';
3 |
4 | @Component({
5 | selector: '#app',
6 | templateUrl: './app.component.html'
7 | })
8 |
9 | export class AppComponent {
10 | msg = 'Hello World!';
11 | }
12 |
--------------------------------------------------------------------------------
/examples/angular/ts/hello/app/app.module.ts:
--------------------------------------------------------------------------------
1 |
2 | import {NgModule} from '@angular/core';
3 | import {BrowserModule} from '@angular/platform-browser';
4 | import {AppComponent} from './app.component';
5 |
6 | @NgModule({
7 | imports: [BrowserModule],
8 | declarations: [AppComponent],
9 | bootstrap: [AppComponent]
10 | })
11 |
12 | export class AppModule{}
13 |
--------------------------------------------------------------------------------
/examples/angular/ts/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/angular/ts/hello/main.ts:
--------------------------------------------------------------------------------
1 |
2 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
3 | import {AppModule} from 'app/app.module';
4 |
5 | platformBrowserDynamic().bootstrapModule(AppModule);
6 |
--------------------------------------------------------------------------------
/examples/angular/ts/realworld/github.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Conduit
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Loading from github source, this may take some time ...
15 |
16 |
17 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/angular/ts/realworld/local.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Conduit
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Loading...
15 |
16 |
17 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/angular/ts/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/examples/aurelia/es5/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/aurelia/es5/hello/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | ${msg}
4 |
5 |
--------------------------------------------------------------------------------
/examples/aurelia/es5/hello/src/app.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = function(){
3 | this.msg = 'Hello World!';
4 | };
5 |
--------------------------------------------------------------------------------
/examples/aurelia/es5/hello/src/main.js:
--------------------------------------------------------------------------------
1 |
2 | function configure(aurelia){
3 | aurelia.use.basicConfiguration();
4 | aurelia.start().then(function(){
5 | aurelia.setRoot('src/app', document.getElementById('app'));
6 | });
7 | };
8 |
9 | require('aurelia-bootstrapper').bootstrap(configure);
10 |
--------------------------------------------------------------------------------
/examples/aurelia/es5/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
14 |
15 |
22 |
23 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/examples/common/es5/index/folder/index.js:
--------------------------------------------------------------------------------
1 |
2 | var $ = require('jquery');
3 | $('#app').html('Hello World! ');
4 |
--------------------------------------------------------------------------------
/examples/common/es5/index/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/common/es5/index/main.js:
--------------------------------------------------------------------------------
1 |
2 | require('./folder');
3 |
--------------------------------------------------------------------------------
/examples/common/es6/index/folder/index.js:
--------------------------------------------------------------------------------
1 |
2 | import $ from 'jquery';
3 | $('#app').html('Hello World! ');
4 |
--------------------------------------------------------------------------------
/examples/common/es6/index/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/common/es6/index/main.js:
--------------------------------------------------------------------------------
1 |
2 | import './folder';
3 |
--------------------------------------------------------------------------------
/examples/ember/es5/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
26 |
27 |
--------------------------------------------------------------------------------
/examples/handlebars/es5/hello/hello.hbs:
--------------------------------------------------------------------------------
1 |
2 | {{msg}}
3 |
4 |
--------------------------------------------------------------------------------
/examples/handlebars/es5/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/handlebars/es5/hello/hello.js:
--------------------------------------------------------------------------------
1 |
2 | var data = require('./hello.json'),
3 | template = require('./hello.hbs'),
4 | $ = require('jquery');
5 |
6 | $('#app').html(template(data));
--------------------------------------------------------------------------------
/examples/handlebars/es5/hello/hello.json:
--------------------------------------------------------------------------------
1 | {
2 | "msg": "Hello World!"
3 | }
4 |
--------------------------------------------------------------------------------
/examples/handlebars/es5/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
18 |
19 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/examples/inferno/es6/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/jquery/es5/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/jquery/es6/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/lodash/es5/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/lodash/es5/hello/hello.js:
--------------------------------------------------------------------------------
1 |
2 | var compile = require('lodash/template'),
3 | template = require('./hello.tpl'),
4 | data = require('./hello.json'),
5 | render = compile(template);
6 |
7 | document.getElementById('app').innerHTML = render(data);
8 |
--------------------------------------------------------------------------------
/examples/lodash/es5/hello/hello.json:
--------------------------------------------------------------------------------
1 | {
2 | "msg": "Hello World!"
3 | }
--------------------------------------------------------------------------------
/examples/lodash/es5/hello/hello.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= msg %>
4 |
5 |
--------------------------------------------------------------------------------
/examples/lodash/es5/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/lodash/es6/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/lodash/es6/hello/hello.js:
--------------------------------------------------------------------------------
1 |
2 | import compile from 'lodash/template';
3 | import template from './hello.tpl';
4 | import data from './hello.json';
5 |
6 | let render = compile(template);
7 |
8 | document.getElementById('app').innerHTML = render(data);
9 |
--------------------------------------------------------------------------------
/examples/lodash/es6/hello/hello.json:
--------------------------------------------------------------------------------
1 | {
2 | "msg": "Hello World!"
3 | }
--------------------------------------------------------------------------------
/examples/lodash/es6/hello/hello.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= msg %>
4 |
5 |
--------------------------------------------------------------------------------
/examples/lodash/es6/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/react/es6/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/vue/es5/hello/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{msg}}
5 |
6 |
7 |
8 |
20 |
--------------------------------------------------------------------------------
/examples/vue/es5/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/es5/hello/main.js:
--------------------------------------------------------------------------------
1 |
2 | var Vue = require('vue'),
3 | app = require('./app.vue');
4 |
5 | new Vue(app).$mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/vue/es5/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/examples/vue/es6/hello/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{msg}}
5 |
6 |
7 |
8 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/vue/es6/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/es6/hello/main.js:
--------------------------------------------------------------------------------
1 |
2 | import Vue from 'vue';
3 | import app from './app.vue';
4 |
5 | new Vue(app).$mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/vue/es6/sfc-class/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{msg}}
5 |
6 |
7 |
8 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/vue/es6/sfc-class/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/es6/sfc-class/main.js:
--------------------------------------------------------------------------------
1 |
2 | import Vue from 'vue';
3 | import App from './app.vue';
4 |
5 | new App().$mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/vue/es6/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/examples/vue/ts/hello/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{msg}}
5 |
6 |
7 |
8 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/vue/ts/hello/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/ts/hello/main.ts:
--------------------------------------------------------------------------------
1 |
2 | import Vue from 'vue';
3 | import app from './app.vue';
4 |
5 | new Vue(app).$mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/vue/ts/sfc-class/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{msg}}
5 |
6 |
7 |
8 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/vue/ts/sfc-class/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/vue/ts/sfc-class/main.ts:
--------------------------------------------------------------------------------
1 |
2 | import Vue from 'vue';
3 | import App from './app.vue';
4 |
5 | new App().$mount('#app');
6 |
--------------------------------------------------------------------------------
/examples/vue/ts/x-module/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Loading..
8 |
9 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 |
2 | var fs = require('fs'),
3 | eslint = require('gulp-eslint'),
4 | gulp = require('gulp'),
5 | concat = require('gulp-concat'),
6 | header = require('gulp-header'),
7 | footer = require('gulp-footer'),
8 | sourcemaps = require('gulp-sourcemaps'),
9 | uglify = require('gulp-uglify'),
10 | version = require('./package.json').version;
11 |
12 | var files = [];
13 |
14 | String(fs.readFileSync('src/min.js', {encoding:'utf8'})).split('\n').forEach(function(line){
15 | if (line.match(/\$import\(.(.+).\);/)){
16 | files.push(RegExp.$1);
17 | }
18 | });
19 |
20 |
21 | var cfg = {
22 | includeContent: true,
23 | destPath: './dist',
24 | sourceMappingURLPrefix: 'https://unpkg.com/getlibs@' + version + '/dist'
25 | };
26 |
27 |
28 | gulp.task('lint', function(){
29 | return gulp.src(files, {base: './'})
30 | .pipe(eslint())
31 | .pipe(eslint.format('unix'))
32 | .pipe(eslint.failAfterError());
33 | });
34 |
35 |
36 | gulp.task('source', ['lint'], function() {
37 |
38 | return gulp.src(files, {base: './'})
39 | .pipe(sourcemaps.init())
40 | .pipe(concat('src.js'))
41 | .pipe(header('(function(){\n'))
42 | .pipe(footer('\n})()'))
43 | .pipe(sourcemaps.write('', cfg))
44 | .pipe(gulp.dest('./dist'));
45 | });
46 |
47 |
48 | gulp.task('minified', ['lint'], function() {
49 |
50 | return gulp.src(files, {base: './'})
51 | .pipe(sourcemaps.init())
52 | .pipe(uglify())
53 | .pipe(concat('min.js'))
54 | .pipe(header('(function(){'))
55 | .pipe(footer('})()'))
56 | .pipe(sourcemaps.write('', cfg))
57 | .pipe(gulp.dest('./dist'));
58 | });
59 |
60 |
61 | gulp.task('default', ['source', 'minified']);
62 |
63 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "getlibs",
3 | "version": "0.1.1",
4 | "description": "An in-browser module loader configured to get external dependencies directly from CDN. Includes babel/typescript. For quick prototyping, code sharing, teaching/learning - a super simple web dev environment without node/webpack/etc.",
5 | "main": "dist/src.js",
6 | "unpkg": "dist/min.js",
7 | "files": [
8 | "dist",
9 | "plugins"
10 | ],
11 | "scripts": {
12 | "test": "gulp && wdio test/wdio.local.js",
13 | "build": "gulp"
14 | },
15 | "devDependencies": {
16 | "ang2-conduit": "git+https://github.com/gothinkster/angular-realworld-example-app.git",
17 | "chai": "^3.5.0",
18 | "es6-promise": "^4.1.0",
19 | "express": "^4.0.0",
20 | "gulp": "^3.9.1",
21 | "gulp-concat": "^2.6.1",
22 | "gulp-eslint": "^3.0.1",
23 | "gulp-footer": "^1.0.5",
24 | "gulp-header": "^1.8.8",
25 | "gulp-sourcemaps": "^2.4.0",
26 | "gulp-uglify": "^2.0.0",
27 | "systemjs": "^0.20.12",
28 | "wdio-dot-reporter": "0.0.8",
29 | "wdio-mocha-framework": "^0.5.10",
30 | "wdio-sauce-service": "^0.4.0",
31 | "wdio-spec-reporter": "^0.1.0",
32 | "wdio-static-server-service": "^1.0.1",
33 | "webdriverio": "^4.8.0"
34 | },
35 | "repository": {
36 | "type": "git",
37 | "url": "git+https://github.com/activewidgets/getlibs.git"
38 | },
39 | "keywords": [
40 | "systemjs",
41 | "unpkg",
42 | "cdnjs",
43 | "babel",
44 | "typescript",
45 | "javascript",
46 | "angular",
47 | "react",
48 | "vue"
49 | ],
50 | "author": "webmaster@activewidgets.com",
51 | "license": "MIT",
52 | "bugs": {
53 | "url": "https://github.com/activewidgets/getlibs/issues"
54 | },
55 | "eslintConfig": {
56 | "extends": "eslint:recommended",
57 | "globals": {
58 | "Promise": true,
59 | "System": true,
60 | "SystemJS": true,
61 | "define": true,
62 | "config": true
63 | },
64 | "env": {
65 | "browser": true
66 | }
67 | },
68 | "homepage": "http://getlibs.com"
69 | }
70 |
--------------------------------------------------------------------------------
/plugins/babel.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/babel', ['../src/worker'], function(WebWorker){
3 |
4 | function transpiler(){
5 |
6 | self.translate = function(address, source, options) {
7 |
8 | options.ast = false;
9 | options.filename = address;
10 | options.sourceFileName = address;
11 |
12 | /* global Babel */
13 | return Babel.transform(source, options);
14 | };
15 | }
16 |
17 |
18 | var worker = new WebWorker(['babel-standalone', transpiler]),
19 | options = SystemJS.babelOptions;
20 |
21 |
22 | function translate(load){
23 | return worker.call('translate', load.address, load.source, options).then(function(result){
24 | load.metadata.sourceMap = result.map;
25 | return result.code;
26 | });
27 | }
28 |
29 |
30 | return {
31 | translate: translate
32 | };
33 | });
--------------------------------------------------------------------------------
/plugins/cached.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/cached', ['../src/idb'], function(db){
3 |
4 | function wrap(load, translate){
5 |
6 | var loader = this,
7 | source = load.source,
8 | address = load.address;
9 |
10 |
11 | function save(result){
12 |
13 | var item = {
14 | input: source,
15 | result: result,
16 | sourceMap: load.metadata.sourceMap
17 | };
18 |
19 | return db.set(address, item).then(function(){
20 | return result;
21 | });
22 | }
23 |
24 |
25 | function compare(item){
26 |
27 | if (item && item.input == source){
28 | load.metadata.sourceMap = item.sourceMap;
29 | return item.result;
30 | }
31 |
32 | return translate.call(loader, load).then(save);
33 | }
34 |
35 |
36 | return db.get(address).then(compare);
37 | }
38 |
39 | return {
40 | wrap: wrap
41 | };
42 | });
43 |
--------------------------------------------------------------------------------
/plugins/cdnjs.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/loader/cdnjs', [], function(){
3 |
4 | var init = System.import('https://api.cdnjs.com/libraries!json').then(function(response){
5 |
6 | var libs = {}, map = {"angular.js": "angular", "10up-sanitize.css":"sanitize.css","accounting.js":"accounting","alertify.js":"alertify","AlertifyJS":"alertifyjs","alexandernst-angular-multi-select":"angular-multi-select","angular-autofields":"angular-autoFields-bootstrap","audio5js":"audio5","aui":"@atlassian/aui","babel-core":"babel-browser","backbone-localstorage.js":"backbone.localstorage","backbone.collectionView":"bb-collection-view","backbone.js":"backbone","backbone.validation":"backbone-validation","bacon.js":"baconjs","baffle.js":"baffle","basis.js":"basis-library","bespoke.js":"bespoke","bokeh":"bokehjs","breezejs":"breeze-client","camanjs":"caman","can.js":"can","cannon.js":"cannon","cash":"cash-dom","Chart.js":"chart.js","ClientJS":"clientjs","clipboard.js":"clipboard","Colors.js":"colors.js","cookie.js":"cookie_js","Cookies.js":"cookies-js","css-loader":"pure-css-loader","custom-elements-builder":"ceb","custom-elements":"@webcomponents/custom-elements","dancer.js":"dancer","danialfarid-angular-file-upload":"ng-file-upload","danielgindi-jquery-backstretch":"jquery.backstretch","data.js":"data_js","datepicker":"@fengyuanchen/datepicker","dio":"dio.js","dropbox.js":"dropbox","Dropify":"dropify","dygraph":"dygraphs","elasticsearch":"elasticsearch-browser","eModal":"emodal","Faker":"faker","file-uploader":"fine-uploader","FileSaver.js":"file-saver","forge":"node-forge","graingert-wow":"wow.js","Han":"han-css","handlebars.js":"handlebars","headroom":"headroom.js","hola-video.js":"@hola.org/video.js","ICanHaz.js":"icanhaz","idbwrapper":"idb-wrapper","ifvisible":"ifvisible.js","ion.checkradio":"ion-checkradio","javascript-hooker":"hooker","jquery-browser":"jquery.browser","jquery-easing":"jquery.easing","jquery-jgrowl":"jgrowl","jQuery-linkify":"linkifyjs","jquery-minicolors":"@claviska/jquery-minicolors","jquery-noty":"noty","jquery.imagesloaded":"imagesloaded","jquery.isotope":"isotope-layout","jquery.lazyloadxt":"lazyloadxt","jQuery.Marquee":"jquery.marquee","jQuery.my":"jquerymy","jquery.simpleWeather":"simpleweather","jquery.tabslet.js":"tabslet","jquery.textcomplete":"jquery-textcomplete","jquery.ui-contextmenu":"ui-contextmenu","jquery.wookmark":"wookmark","jqueryui-touch-punch":"jquery-ui-touch-punch","js-xss":"xss","jsdiff":"diff","json-formatter":"jsonformatter","kineticjs":"kinetic","knockout-validation":"knockout.validation","leaflet-locatecontrol":"leaflet.locatecontrol","leaflet.draw":"leaflet-draw","less.js":"less","line-chart":"n3-charts","lunr.js":"lunr","machina.js":"machina","markdown.js":"markdown","mindb":"min","MinPubSub":"minpubsub","mistic100-Bootstrap-Confirmation":"bootstrap-confirmation2","moment.js":"moment","multi-select":"multiselect","MutationObserver.js":"mutationobserver-shim","mycolorway-simple-hotkeys":"simple-hotkeys","ngOfficeUiFabric":"ng-office-ui-fabric","nod":"nod-validate","normalize":"normalize.css","notify.js":"notifyjs","numeral.js":"numeral","oauth-io":"oauthio-web","odometer.js":"odometer","ol3":"openlayers","onsen":"onsenui","p2.js":"p2","p5.js":"p5","parsley.js":"parsleyjs","pdf.js":"pdfjs-dist","pegasus":"@typicode/pegasus","perliedman-leaflet-control-geocoder":"leaflet-control-geocoder","pickadate.js":"pickadate","plastiq":"angular-moment","plottable.js":"plottable","portal":"portal-client","postal.js":"postal","Primer":"primer-css","prism":"prismjs","proj4js":"proj4","pure":"purecss","q.js":"q","qunit":"qunitjs","ramjet.js":"ramjet","remoteStorage":"remotestoragejs","Repaintless.css":"repaintless","retina.js":"retinajs","roll":"rolljs","rxjs":"@reactivex/rxjs","scion":"scxml","script.js":"scriptjs","ScrollMagic":"scrollmagic","should.js":"should","Shuffle":"shufflejs","sigma.js":"sigma","simple-gallery-js":"simpleGallery.js","smoothscroll":"smoothscroll-for-websites","socket.io":"socket.io-client","sprintf":"sprintf-js","stacktrace.js":"stacktrace-js","stomp.js":"stompjs","string.js":"string","Swiper":"swiper","tabletop.js":"tabletop","teleject-hisrc":"hisrc","tinycolor":"tinycolor2","tracking.js":"tracking","Turf.js":"@turf/turf","twitter-bootstrap":"bootstrap","twix.js":"twix","UAParser.js":"ua-parser-js","Uniform.js":"jquery.uniform","Vidage":"vidage","weather":"weather.js","whitestorm.js":"whs","wordcloud2.js":"wordcloud","xls":"xlsjs","yasqe":"yasgui-yasqe","yasr":"yasgui-yasr","Zebra_datepicker":"zebra_datepicker"};
7 |
8 | response.results.forEach(function(item){
9 | libs[map[item.name] || item.name] = item;
10 | });
11 |
12 | return libs;
13 | });
14 |
15 |
16 | var exceptions = ['@angular/', 'inferno/'],
17 | baseURL = SystemJS.baseURL;
18 |
19 |
20 | function notcdnjs(url){
21 | return url.indexOf(baseURL) != 0 || exceptions.some(function(item){
22 | return url.indexOf(baseURL + item) == 0;
23 | });
24 | }
25 |
26 |
27 | function build(base){
28 |
29 | var plugin = {};
30 |
31 | Object.keys(base).forEach(function(i){
32 | plugin[i] = base[i];
33 | });
34 |
35 | plugin.fetch = function(load, fetch){
36 |
37 | var loader = this;
38 |
39 | if (notcdnjs(load.address)){
40 | return base.fetch.call(loader, load, fetch);
41 | }
42 |
43 | return init.then(function(libs){
44 |
45 | var name = load.address.substr(baseURL.length).replace(/^([^@\/]+|@[^\/]+\/[^\/]+)(.*)$/, '$1'),
46 | file = RegExp.$2,
47 | item = libs[name];
48 |
49 | if (!item){
50 | return base.fetch.call(loader, load, fetch);
51 | }
52 |
53 | var redirect = item.latest;
54 |
55 | if (file){
56 |
57 | if (!file.match(/\.\w+$/)){
58 | file += '.min.js';
59 | }
60 |
61 | redirect = item.latest.replace(/^(.+\/ajax\/libs\/[^\/]+\/[^\/]+)\/.+$/, '$1') + file;
62 | }
63 |
64 | load.source = 'module.exports = require(' + JSON.stringify(redirect) + ')';
65 |
66 |
67 | var map = System.preload.map,
68 | prev = map[load.address];
69 |
70 | if (prev) {
71 | map[redirect] = prev;
72 | }
73 |
74 | return load.source;
75 | });
76 | }
77 |
78 | return plugin;
79 | }
80 |
81 |
82 | function skip(){
83 | return ''
84 | }
85 |
86 |
87 | function instantiate(load){
88 |
89 | var path = load.address.substr(SystemJS.baseURL.length + 4);
90 | path = (path == '@@') ? 'getlibs/plugins/preload' : path;
91 | return System.import(path).then(build);
92 | }
93 |
94 |
95 | return {
96 | fetch: skip,
97 | instantiate: instantiate
98 | };
99 | });
100 |
101 |
102 | (function(){
103 |
104 | config({
105 | meta: {
106 | 'https://unpkg.com/*': {loader: 'cdn'},
107 | 'https://cdnjs.cloudflare.com/*.js': {loader: 'cdn'},
108 | 'getlibs/*': {loader: ''}
109 | }
110 | });
111 |
112 | var path, meta = {}, current = SystemJS.meta;
113 |
114 | for(path in current){
115 | if (path.indexOf('*.') == 0 && current[path].loader) {
116 | meta['https://unpkg.com/' + path] = {loader: 'cdn/' + current[path].loader};
117 | }
118 | }
119 |
120 | meta['https://unpkg.com/*.js'] = {loader: 'cdn'};
121 |
122 | config({
123 | meta: meta
124 | });
125 |
126 | })();
--------------------------------------------------------------------------------
/plugins/files.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/files', [], function(){
3 |
4 |
5 | function fileAccessWarning(){
6 | /* eslint no-console: "off" */
7 | console.warn("Allow file access when running directly from files: http://getlibs.com/allow-file-access.html");
8 |
9 | var e = document.createElement('div');
10 | e.innerHTML = '' +
11 | 'getlibs error: file access not allowed (
more info )' +
12 | '
';
13 | document.body.appendChild(e);
14 | }
15 |
16 |
17 | var loadingFromFiles = (location.protocol == 'file:'),
18 | fileAccessAllowed;
19 |
20 |
21 |
22 | function fetch(load, fallback){
23 |
24 | function ok(source){
25 |
26 | if (loadingFromFiles && load.address.indexOf('file:') == 0){
27 | fileAccessAllowed = true;
28 | }
29 |
30 | return source;
31 | }
32 |
33 | function fail(err){
34 |
35 | if (loadingFromFiles && !fileAccessAllowed){
36 | setTimeout(fileAccessWarning, 100);
37 | throw new Error('No access to files or wrong path: ' + load.address);
38 | }
39 |
40 | throw err;
41 | }
42 |
43 |
44 | return Promise.resolve(fallback(load)).then(ok, fail);
45 | }
46 |
47 |
48 | return {
49 | fetch: fetch
50 | };
51 | });
52 |
53 |
--------------------------------------------------------------------------------
/plugins/handlebars.js:
--------------------------------------------------------------------------------
1 |
2 | define('hbs', ['handlebars'], function(Handlebars){
3 |
4 | function translate(load){
5 |
6 | var precompiled = Handlebars.precompile(load.source),
7 | output = 'var Handlebars = require("handlebars"); \n module.exports = Handlebars.template(' + precompiled +');';
8 |
9 | load.source = output;
10 | return output;
11 | }
12 |
13 | return {
14 | translate: translate
15 | };
16 | });
17 |
--------------------------------------------------------------------------------
/plugins/index.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/index', [], function(){
3 |
4 | function fetch(load, fallback){
5 |
6 | function retry(err){
7 |
8 | if (String(err.message).indexOf('No access to files') == 0){
9 | throw err;
10 | }
11 |
12 | var address = load.address,
13 | index = address.replace(/\.(ts|js)$/, '/index.$1'),
14 | ext = RegExp.$1,
15 | path = JSON.stringify(index),
16 | source = (ext == 'ts') ?
17 | 'export * from ' + path :
18 | 'module.exports = require(' + path + ')';
19 |
20 | if (address.match(/\.(ts|js)$/) && !address.match(/index\.(ts|js)$/)){
21 | return source;
22 | }
23 |
24 | throw err;
25 | }
26 |
27 |
28 | return Promise.resolve(fallback(load)).catch(retry);
29 | }
30 |
31 |
32 | return {
33 | fetch: fetch
34 | };
35 | });
36 |
37 |
--------------------------------------------------------------------------------
/plugins/js.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/js', [], function(){
3 | return {};
4 | });
--------------------------------------------------------------------------------
/plugins/json.js:
--------------------------------------------------------------------------------
1 |
2 | define('json', [], function(){
3 | return {
4 | instantiate: function(load) {
5 | return JSON.parse(load.source);
6 | }
7 | };
8 | });
9 |
--------------------------------------------------------------------------------
/plugins/package.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/loader/package', [], function(){
3 |
4 | function fetch(){
5 | return ''
6 | }
7 |
8 | var packages = SystemJS.packages;
9 |
10 | function package(address){
11 |
12 | var i, name, parts = address.split('/');
13 |
14 | for(i=parts.length; i>2; --i){
15 | name = parts.slice(0, i).join('/');
16 | if (name in packages){
17 | return name;
18 | }
19 | }
20 | }
21 |
22 |
23 | function property(address, loadAddress){
24 |
25 | return function(value){
26 |
27 | var path = address.replace(/^.*\//, '');
28 |
29 | if (path == '@@'){
30 | return value;
31 | }
32 |
33 | if (path == '*'){
34 | path = loadAddress.replace(/^.+\/(\w+)\.js$/, '$1');
35 | }
36 |
37 | path && path.split('.').forEach(function(name){
38 | value = value[name];
39 | });
40 |
41 | return value;
42 | };
43 | }
44 |
45 | function instantiate(plugin){
46 | return {
47 | fetch: fetch,
48 | instantiate: function(load){
49 | return System.import(package(load.address)).then(property(plugin.address, load.address));
50 | }
51 | };
52 | }
53 |
54 | return {
55 | fetch: fetch,
56 | instantiate: instantiate
57 | }
58 | });
59 |
--------------------------------------------------------------------------------
/plugins/preload.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/preload', [], function(){
3 |
4 | var map = System.preload.map;
5 |
6 | var defer = function(fn){
7 | var channel = new MessageChannel();
8 | channel.port1.onmessage = fn;
9 | channel.port2.postMessage(0);
10 | };
11 |
12 | if (!window.MessageChannel){
13 | defer = setTimeout;
14 | }
15 |
16 | function timeout(value){
17 | return new Promise(function(resolve){
18 | defer(function(){
19 | resolve(value);
20 | }, 0);
21 | });
22 | }
23 |
24 |
25 | function fetch(load, defaultFetch){
26 |
27 | var prev = map[load.address],
28 | result = defaultFetch(load);
29 |
30 | if (!prev) {
31 | return result;
32 | }
33 |
34 | return System.import(prev).then(timeout).then(function(){
35 | return result;
36 | });
37 | }
38 |
39 |
40 | return {
41 | fetch: fetch
42 | };
43 | });
44 |
45 |
46 | System.preload = function(items){
47 |
48 | var i, prev, item, map = System.preload.map;
49 |
50 | for(i=0; i= 0){
14 |
15 | angularPreloaded = true;
16 |
17 | System.preload([
18 | 'core-js',
19 | 'zone.js',
20 | 'rxjs',
21 | '@angular/core',
22 | '@angular/common',
23 | '@angular/platform-browser',
24 | '@angular/compiler',
25 | '@angular/platform-browser-dynamic'
26 | ]);
27 | }
28 |
29 | function absoluteUrl(match, before, url, after){
30 | return before + System.resolveSync(url, load.address) + after;
31 | }
32 |
33 | function styleUrls(match, before, urls, after){
34 | return before + urls.replace(reUrl, absoluteUrl) + after;
35 | }
36 |
37 | if (source.indexOf('moduleId') == -1) {
38 | load.source = source.replace(reTemplateUrl, absoluteUrl).replace(reStyleUrls, styleUrls);
39 | }
40 | }
41 |
42 |
43 | function scan(load){
44 |
45 | var source = String(load.source);
46 |
47 | if (source.indexOf('@angular') >= 0) {
48 | angular(load);
49 | }
50 | }
51 |
52 |
53 | var baseURL = SystemJS.baseURL;
54 |
55 | function translate(load){
56 |
57 | if (String(load.address).substr(0, baseURL.length) != baseURL){
58 | scan(load);
59 | }
60 | }
61 |
62 |
63 | return {
64 | translate: translate
65 | };
66 | });
67 |
68 |
--------------------------------------------------------------------------------
/plugins/text.js:
--------------------------------------------------------------------------------
1 |
2 | define('text', [], function(){
3 | return {
4 | instantiate: function(load) {
5 | return load.source;
6 | }
7 | };
8 | });
9 |
--------------------------------------------------------------------------------
/plugins/typescript.js:
--------------------------------------------------------------------------------
1 |
2 | define('getlibs/plugins/typescript', ['../src/worker'], function(WebWorker){
3 |
4 | function transpiler(){
5 |
6 | self.translate = function(address, source, options) {
7 |
8 | /* global ts */
9 | var result = ts.transpileModule(source, {
10 | compilerOptions: options,
11 | reportDiagnostics: true,
12 | moduleName: address,
13 | fileName: address
14 | });
15 |
16 | result.diagnostics.forEach(function(item){
17 | item.file = null;
18 | });
19 |
20 | return result;
21 | };
22 | }
23 |
24 |
25 | var worker = new WebWorker(['typescript', transpiler]),
26 | options = SystemJS.typescriptOptions;
27 |
28 |
29 | function error(items, address, source){
30 |
31 | var item = items[0],
32 | parts = source.substr(0, item.start).split('\n'),
33 | line = parts.length,
34 | message = item.messageText + ' (line: ' + line + ')\n\n' +
35 | source.split('\n')[line-1] + '\n' +
36 | parts[line-1].replace(/\S/g, ' ') + '^';
37 |
38 | return new Error(message);
39 | }
40 |
41 |
42 | function translate(load){
43 | return worker.call('translate', load.address, load.source, options).then(function(result){
44 |
45 | if (result.diagnostics.length){
46 | throw error(result.diagnostics, load.address, load.source);
47 | }
48 |
49 | load.metadata.sourceMap = JSON.parse(result.sourceMapText);
50 | return result.outputText.replace(/^\/\/# sourceMappingURL=.+/m, '');
51 | });
52 | }
53 |
54 |
55 | return {
56 | translate: translate
57 | };
58 | });
--------------------------------------------------------------------------------
/plugins/vue.js:
--------------------------------------------------------------------------------
1 |
2 | define('vue-loader', ['vue-content'], function(content){
3 |
4 | function translate(load){
5 |
6 | var address = load.address,
7 | ext = SystemJS.resolveSync('./aaaa', address).match(/\.ts$/) ? '-ts' : '-js';
8 |
9 | content[address] = load.source;
10 |
11 | var source = 'module.exports = require("vue-builder")(';
12 |
13 | source += 'require(' + JSON.stringify(address + ext) + '),\n';
14 | source += 'require(' + JSON.stringify(address + '-html') + '),\n';
15 | source += 'require(' + JSON.stringify(address + '-css') + '))\n';
16 |
17 | return source;
18 | }
19 |
20 |
21 | return {
22 | translate: translate
23 | };
24 | });
25 |
26 |
27 | define('vue-builder', [], function(){
28 | return function(component, template){
29 |
30 | component = component || {};
31 | component = component.default || component;
32 |
33 | var options = component.options || component;
34 | options.template = template || '';
35 |
36 | return component;
37 | };
38 | });
39 |
40 |
41 | define('vue-js', ['vue-content'], function(content){
42 |
43 | function fetch(load){
44 |
45 | var address = load.address.replace(/-.s$/, ''),
46 | text = content[address],
47 | source = '';
48 |
49 | if (String(text).match(/