@fluixi/cdn 0.1.0-alpha.0 → 1.0.0-alpha.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +8 -18
- package/dist/full.js +6 -0
- package/dist/full.json +15 -15
- package/dist/min.js +6 -0
- package/dist/min.json +10 -10
- package/dist/templates.js +6 -0
- package/dist/templates.json +3 -3
- package/package.json +9 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,34 +1,24 @@
|
|
|
1
1
|
# @fluixi/cdn
|
|
2
2
|
|
|
3
|
-
This package provides import maps
|
|
3
|
+
This package provides the import maps a page needs, already generated, and a script that installs one. It is designed for developers who want to load the framework from a script tag, with no bundler. It lists all the bare specifiers a browser needs to resolve, ensuring that every transitive subpath is included. These maps are pinned to the version of this package.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- `templates.json` — adds compiling `html`` in the page. Load it with `min.json`.
|
|
7
|
-
- `full.json` — everything a browser can use, in one file.
|
|
5
|
+
The maps are available in three versions: `min`, `templates`, and `full`. Each comes as a `.json` file to read or paste and a `.js` file to load. The `min` version includes `@fluixi/core`, `@fluixi/dom`, `@fluixi/utils`, and the graph behind them. It is enough to write components by hand, as `@fluixi/core` re-exports most of the DOM and reactive surface, so one import covers most of it. The `templates` version adds compiling `html`` in the page and must be loaded with `min`. The `full` version includes everything a browser can use, in one file.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
To use one of the maps, include the corresponding `.js` file before the first module script. For example:
|
|
10
8
|
|
|
11
9
|
```html
|
|
12
|
-
<script
|
|
13
|
-
{ "imports": { "…": "paste the contents of min.json here" } }
|
|
14
|
-
</script>
|
|
10
|
+
<script src="https://unpkg.com/@fluixi/cdn/dist/min.js"></script>
|
|
15
11
|
<script type="module">
|
|
16
12
|
import { render, signal } from '@fluixi/core';
|
|
17
13
|
</script>
|
|
18
14
|
```
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
If a page prefers to hold the map itself or build its markup from something other than a script tag, the `.json` file can be used with this block:
|
|
21
17
|
|
|
22
18
|
```html
|
|
23
|
-
<script type="
|
|
24
|
-
|
|
25
|
-
const tag = document.createElement('script');
|
|
26
|
-
tag.type = 'importmap';
|
|
27
|
-
tag.textContent = JSON.stringify(map);
|
|
28
|
-
document.head.appendChild(tag);
|
|
29
|
-
|
|
30
|
-
const { render, signal } = await import('@fluixi/core');
|
|
19
|
+
<script type="importmap">
|
|
20
|
+
{ "imports": { "…": "paste the contents of min.json here" } }
|
|
31
21
|
</script>
|
|
32
22
|
```
|
|
33
23
|
|
|
34
|
-
Several maps in one page need Chromium 133 or newer, and `full
|
|
24
|
+
An inline map is registered when its element is inserted, so the second file cannot merge into the first one's map and installs its own. Several maps in one page need Chromium 133 or newer, and `full` is the single-file way around that. The script says so if the browser turns its map down.
|
package/dist/full.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(){var d=document,w=function(m){if(typeof console!=='undefined')console.warn('[mappel] '+m)};
|
|
2
|
+
if(d.querySelector('script[type="module"]'))w('the import map is being added after a module script and will not be used — load this file first');
|
|
3
|
+
var s=d.createElement('script');s.type='importmap';s.setAttribute('data-mappel','');s.textContent="{\"imports\":{\"@fluixi/compiler/compile\":\"https://unpkg.com/@fluixi/compiler@1.0.0-alpha.99/dist/lower/compile-template.mjs\",\"@fluixi/core\":\"https://unpkg.com/@fluixi/core@1.0.0-alpha.99/dist/src/index.mjs\",\"@fluixi/dom\":\"https://unpkg.com/@fluixi/dom@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/head\":\"https://unpkg.com/@fluixi/head@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/reactive\":\"https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/index.mjs\",\"@fluixi/reactive/signal\":\"https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/signal/index.mjs\",\"@fluixi/reactive/version\":\"https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/version.generated.mjs\",\"@fluixi/router\":\"https://unpkg.com/@fluixi/router@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/template-parser\":\"https://unpkg.com/@fluixi/template-parser@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/template-runtime\":\"https://unpkg.com/@fluixi/template-runtime@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/utils\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/utils/array\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/array/index.mjs\",\"@fluixi/utils/functions\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/functions/index.mjs\",\"@fluixi/utils/object\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/object/index.mjs\",\"@fluixi/utils/primitive\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/primitive/index.mjs\"}}";
|
|
4
|
+
s.addEventListener('error',function(){w('the browser rejected this import map — a page with several maps needs Chromium 133+, so use the combined map instead')});
|
|
5
|
+
(d.head||d.documentElement).appendChild(s);
|
|
6
|
+
(self.__mappel||(self.__mappel=[])).push(JSON.parse(s.textContent))})();
|
package/dist/full.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"imports": {
|
|
3
|
-
"@fluixi/compiler/compile": "https://unpkg.com/@fluixi/compiler@1.0.0-alpha.
|
|
4
|
-
"@fluixi/core": "https://unpkg.com/@fluixi/core@1.0.0-alpha.
|
|
5
|
-
"@fluixi/dom": "https://unpkg.com/@fluixi/dom@1.0.0-alpha.
|
|
6
|
-
"@fluixi/head": "https://unpkg.com/@fluixi/head@1.0.0-alpha.
|
|
7
|
-
"@fluixi/reactive": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.
|
|
8
|
-
"@fluixi/reactive/signal": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.
|
|
9
|
-
"@fluixi/reactive/version": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.
|
|
10
|
-
"@fluixi/router": "https://unpkg.com/@fluixi/router@0.
|
|
11
|
-
"@fluixi/template-parser": "https://unpkg.com/@fluixi/template-parser@
|
|
12
|
-
"@fluixi/template-runtime": "https://unpkg.com/@fluixi/template-runtime@
|
|
13
|
-
"@fluixi/utils": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
14
|
-
"@fluixi/utils/array": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
15
|
-
"@fluixi/utils/functions": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
16
|
-
"@fluixi/utils/object": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
17
|
-
"@fluixi/utils/primitive": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
3
|
+
"@fluixi/compiler/compile": "https://unpkg.com/@fluixi/compiler@1.0.0-alpha.99/dist/lower/compile-template.mjs",
|
|
4
|
+
"@fluixi/core": "https://unpkg.com/@fluixi/core@1.0.0-alpha.99/dist/src/index.mjs",
|
|
5
|
+
"@fluixi/dom": "https://unpkg.com/@fluixi/dom@1.0.0-alpha.99/dist/index.mjs",
|
|
6
|
+
"@fluixi/head": "https://unpkg.com/@fluixi/head@1.0.0-alpha.99/dist/index.mjs",
|
|
7
|
+
"@fluixi/reactive": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/index.mjs",
|
|
8
|
+
"@fluixi/reactive/signal": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/signal/index.mjs",
|
|
9
|
+
"@fluixi/reactive/version": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/version.generated.mjs",
|
|
10
|
+
"@fluixi/router": "https://unpkg.com/@fluixi/router@1.0.0-alpha.99/dist/index.mjs",
|
|
11
|
+
"@fluixi/template-parser": "https://unpkg.com/@fluixi/template-parser@1.0.0-alpha.99/dist/index.mjs",
|
|
12
|
+
"@fluixi/template-runtime": "https://unpkg.com/@fluixi/template-runtime@1.0.0-alpha.99/dist/index.mjs",
|
|
13
|
+
"@fluixi/utils": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/index.mjs",
|
|
14
|
+
"@fluixi/utils/array": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/array/index.mjs",
|
|
15
|
+
"@fluixi/utils/functions": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/functions/index.mjs",
|
|
16
|
+
"@fluixi/utils/object": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/object/index.mjs",
|
|
17
|
+
"@fluixi/utils/primitive": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/primitive/index.mjs"
|
|
18
18
|
}
|
|
19
19
|
}
|
package/dist/min.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(){var d=document,w=function(m){if(typeof console!=='undefined')console.warn('[mappel] '+m)};
|
|
2
|
+
if(d.querySelector('script[type="module"]'))w('the import map is being added after a module script and will not be used — load this file first');
|
|
3
|
+
var s=d.createElement('script');s.type='importmap';s.setAttribute('data-mappel','');s.textContent="{\"imports\":{\"@fluixi/core\":\"https://unpkg.com/@fluixi/core@1.0.0-alpha.99/dist/src/index.mjs\",\"@fluixi/dom\":\"https://unpkg.com/@fluixi/dom@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/reactive\":\"https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/index.mjs\",\"@fluixi/reactive/signal\":\"https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/signal/index.mjs\",\"@fluixi/reactive/version\":\"https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/version.generated.mjs\",\"@fluixi/utils\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/utils/array\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/array/index.mjs\",\"@fluixi/utils/functions\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/functions/index.mjs\",\"@fluixi/utils/object\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/object/index.mjs\",\"@fluixi/utils/primitive\":\"https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/primitive/index.mjs\"}}";
|
|
4
|
+
s.addEventListener('error',function(){w('the browser rejected this import map — a page with several maps needs Chromium 133+, so use the combined map instead')});
|
|
5
|
+
(d.head||d.documentElement).appendChild(s);
|
|
6
|
+
(self.__mappel||(self.__mappel=[])).push(JSON.parse(s.textContent))})();
|
package/dist/min.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"imports": {
|
|
3
|
-
"@fluixi/core": "https://unpkg.com/@fluixi/core@1.0.0-alpha.
|
|
4
|
-
"@fluixi/dom": "https://unpkg.com/@fluixi/dom@1.0.0-alpha.
|
|
5
|
-
"@fluixi/reactive": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.
|
|
6
|
-
"@fluixi/reactive/signal": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.
|
|
7
|
-
"@fluixi/reactive/version": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.
|
|
8
|
-
"@fluixi/utils": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
9
|
-
"@fluixi/utils/array": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
10
|
-
"@fluixi/utils/functions": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
11
|
-
"@fluixi/utils/object": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
12
|
-
"@fluixi/utils/primitive": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.
|
|
3
|
+
"@fluixi/core": "https://unpkg.com/@fluixi/core@1.0.0-alpha.99/dist/src/index.mjs",
|
|
4
|
+
"@fluixi/dom": "https://unpkg.com/@fluixi/dom@1.0.0-alpha.99/dist/index.mjs",
|
|
5
|
+
"@fluixi/reactive": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/index.mjs",
|
|
6
|
+
"@fluixi/reactive/signal": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/lib/signal/index.mjs",
|
|
7
|
+
"@fluixi/reactive/version": "https://unpkg.com/@fluixi/reactive@1.0.0-alpha.99/dist/version.generated.mjs",
|
|
8
|
+
"@fluixi/utils": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/index.mjs",
|
|
9
|
+
"@fluixi/utils/array": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/array/index.mjs",
|
|
10
|
+
"@fluixi/utils/functions": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/functions/index.mjs",
|
|
11
|
+
"@fluixi/utils/object": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/object/index.mjs",
|
|
12
|
+
"@fluixi/utils/primitive": "https://unpkg.com/@fluixi/utils@1.0.0-alpha.99/dist/lib/primitive/index.mjs"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(){var d=document,w=function(m){if(typeof console!=='undefined')console.warn('[mappel] '+m)};
|
|
2
|
+
if(d.querySelector('script[type="module"]'))w('the import map is being added after a module script and will not be used — load this file first');
|
|
3
|
+
var s=d.createElement('script');s.type='importmap';s.setAttribute('data-mappel','');s.textContent="{\"imports\":{\"@fluixi/compiler/compile\":\"https://unpkg.com/@fluixi/compiler@1.0.0-alpha.99/dist/lower/compile-template.mjs\",\"@fluixi/template-parser\":\"https://unpkg.com/@fluixi/template-parser@1.0.0-alpha.99/dist/index.mjs\",\"@fluixi/template-runtime\":\"https://unpkg.com/@fluixi/template-runtime@1.0.0-alpha.99/dist/index.mjs\"}}";
|
|
4
|
+
s.addEventListener('error',function(){w('the browser rejected this import map — a page with several maps needs Chromium 133+, so use the combined map instead')});
|
|
5
|
+
(d.head||d.documentElement).appendChild(s);
|
|
6
|
+
(self.__mappel||(self.__mappel=[])).push(JSON.parse(s.textContent))})();
|
package/dist/templates.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"imports": {
|
|
3
|
-
"@fluixi/compiler/compile": "https://unpkg.com/@fluixi/compiler@1.0.0-alpha.
|
|
4
|
-
"@fluixi/template-parser": "https://unpkg.com/@fluixi/template-parser@
|
|
5
|
-
"@fluixi/template-runtime": "https://unpkg.com/@fluixi/template-runtime@
|
|
3
|
+
"@fluixi/compiler/compile": "https://unpkg.com/@fluixi/compiler@1.0.0-alpha.99/dist/lower/compile-template.mjs",
|
|
4
|
+
"@fluixi/template-parser": "https://unpkg.com/@fluixi/template-parser@1.0.0-alpha.99/dist/index.mjs",
|
|
5
|
+
"@fluixi/template-runtime": "https://unpkg.com/@fluixi/template-runtime@1.0.0-alpha.99/dist/index.mjs"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluixi/cdn",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.99",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"author": "Ibrahima Touré",
|
|
5
6
|
"private": false,
|
|
6
7
|
"description": "pre-generated import maps for loading the framework from a CDN: the minimum for writing components by hand, the addition that compiles html`` in the page, and everything",
|
|
7
8
|
"publishConfig": {
|
|
@@ -18,10 +19,14 @@
|
|
|
18
19
|
"./package.json": "./package.json",
|
|
19
20
|
"./min.json": "./dist/min.json",
|
|
20
21
|
"./templates.json": "./dist/templates.json",
|
|
21
|
-
"./full.json": "./dist/full.json"
|
|
22
|
+
"./full.json": "./dist/full.json",
|
|
23
|
+
"./min.js": "./dist/min.js",
|
|
24
|
+
"./templates.js": "./dist/templates.js",
|
|
25
|
+
"./full.js": "./dist/full.js"
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
|
-
"
|
|
28
|
+
"mappel": "^0.3.0",
|
|
29
|
+
"@fluixi/template-runtime": "1.0.0-alpha.99"
|
|
25
30
|
},
|
|
26
31
|
"repository": {
|
|
27
32
|
"type": "git",
|
|
@@ -29,6 +34,6 @@
|
|
|
29
34
|
"directory": "packages/cdn"
|
|
30
35
|
},
|
|
31
36
|
"scripts": {
|
|
32
|
-
"build": "
|
|
37
|
+
"build": "mappel"
|
|
33
38
|
}
|
|
34
39
|
}
|