vitral 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +324 -2
- package/dist/angular.d.ts +27 -0
- package/dist/angular.js +70 -0
- package/dist/chunk-IZK6ITIJ.js +96 -0
- package/dist/chunk-TTL52BF2.js +547 -0
- package/dist/element.d.ts +30 -0
- package/dist/element.js +11 -0
- package/dist/index.d.ts +191 -0
- package/dist/index.js +36 -0
- package/dist/preact.d.ts +22 -0
- package/dist/preact.js +43 -0
- package/dist/react.d.ts +32 -0
- package/dist/react.js +117 -0
- package/dist/solid.d.ts +24 -0
- package/dist/solid.js +60 -0
- package/dist/svelte.d.ts +27 -0
- package/dist/svelte.js +36 -0
- package/dist/testing.d.ts +28 -0
- package/dist/testing.js +47 -0
- package/dist/vite.d.ts +24 -0
- package/dist/vite.js +96 -0
- package/dist/vue.d.ts +61 -0
- package/dist/vue.js +125 -0
- package/package.json +195 -3
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
interface VitralViteOptions {
|
|
4
|
+
/** Arquivo que exporta o remote (default export de reactRemote/vueRemote/defineRemote). */
|
|
5
|
+
entry: string;
|
|
6
|
+
/** Nome do remote no manifesto. Padrão: `name` do package.json. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Versão no manifesto. Padrão: `version` do package.json. */
|
|
9
|
+
version?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Dependências que NÃO entram no bundle e vêm do import map do host
|
|
12
|
+
* (ex.: ['react', 'react-dom', 'react-dom/client']). Padrão: nenhuma, cada
|
|
13
|
+
* remote leva suas dependências e nunca há conflito de versão.
|
|
14
|
+
*/
|
|
15
|
+
shared?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Prefixa todo o CSS do remote para valer só dentro dele (inclusive o
|
|
18
|
+
* preflight/tema do Tailwind). Padrão: true.
|
|
19
|
+
*/
|
|
20
|
+
scopeCss?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function vitral(options: VitralViteOptions): Plugin;
|
|
23
|
+
|
|
24
|
+
export { type VitralViteOptions, vitral as default, vitral };
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// src/vite.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { readFileSync, rmSync, writeFileSync } from "fs";
|
|
4
|
+
import { join, resolve } from "path";
|
|
5
|
+
|
|
6
|
+
// src/css-scope.ts
|
|
7
|
+
import postcss from "postcss";
|
|
8
|
+
var GLOBAL = /^(?::root|:host(?:\([^)]*\))?|html|body)(?![\w-])/;
|
|
9
|
+
function scopeSelector(selector, scope) {
|
|
10
|
+
const s = selector.trim();
|
|
11
|
+
const m = s.match(GLOBAL);
|
|
12
|
+
if (m) {
|
|
13
|
+
return scope + s.slice(m[0].length);
|
|
14
|
+
}
|
|
15
|
+
if (s === "*") return `${scope}, ${scope} *`;
|
|
16
|
+
return `${scope} ${s}`;
|
|
17
|
+
}
|
|
18
|
+
function scopeCss(css, scopeName) {
|
|
19
|
+
const scope = `[data-vitral-scope="${scopeName}"]`;
|
|
20
|
+
const root = postcss.parse(css);
|
|
21
|
+
root.walkRules((rule) => {
|
|
22
|
+
let p = rule.parent;
|
|
23
|
+
while (p && p.type !== "root") {
|
|
24
|
+
if (p.type === "atrule" && /keyframes$/i.test(p.name)) return;
|
|
25
|
+
if (p.type === "rule") return;
|
|
26
|
+
p = p.parent;
|
|
27
|
+
}
|
|
28
|
+
rule.selectors = rule.selectors.map((sel) => scopeSelector(sel, scope));
|
|
29
|
+
});
|
|
30
|
+
return root.toString();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// src/vite.ts
|
|
34
|
+
function vitral(options) {
|
|
35
|
+
let outDir = "dist";
|
|
36
|
+
let root = process.cwd();
|
|
37
|
+
let pkg = {};
|
|
38
|
+
const scopeName = () => (options.name ?? pkg.name ?? "remote").replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
39
|
+
return {
|
|
40
|
+
name: "vitral",
|
|
41
|
+
config(_, { mode }) {
|
|
42
|
+
const rolldown = "rolldownVersion" in this.meta;
|
|
43
|
+
const output = rolldown ? { codeSplitting: false } : { inlineDynamicImports: true };
|
|
44
|
+
return {
|
|
45
|
+
// Código de biblioteca não tem process.env; React e Vue precisam disso.
|
|
46
|
+
define: { "process.env.NODE_ENV": JSON.stringify(mode === "development" ? "development" : "production") },
|
|
47
|
+
server: { cors: true },
|
|
48
|
+
preview: { cors: true },
|
|
49
|
+
build: {
|
|
50
|
+
// Nomes com hash: cache eterno no CDN. Só o vitral.json muda a cada deploy.
|
|
51
|
+
lib: { entry: options.entry, formats: ["es"], fileName: () => "remote-[hash].js", cssFileName: "remote" },
|
|
52
|
+
// Um arquivo só: necessário para verificar o hash SRI no host.
|
|
53
|
+
rollupOptions: { external: options.shared ?? [], output },
|
|
54
|
+
cssCodeSplit: false
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
configResolved(c) {
|
|
59
|
+
root = c.root;
|
|
60
|
+
outDir = resolve(c.root, c.build.outDir);
|
|
61
|
+
try {
|
|
62
|
+
pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
writeBundle(_, bundle) {
|
|
67
|
+
const files = Object.values(bundle);
|
|
68
|
+
const entry = files.find((f) => f.type === "chunk" && f.isEntry);
|
|
69
|
+
if (!entry) return;
|
|
70
|
+
const css = files.filter((f) => f.type === "asset" && f.fileName.endsWith(".css")).map((f) => {
|
|
71
|
+
const from = join(outDir, f.fileName);
|
|
72
|
+
let text = readFileSync(from, "utf8");
|
|
73
|
+
if (options.scopeCss !== false) text = scopeCss(text, scopeName());
|
|
74
|
+
const hash = createHash("sha256").update(text).digest("base64url").slice(0, 8);
|
|
75
|
+
const name = f.fileName.replace(/\.css$/, `-${hash}.css`);
|
|
76
|
+
writeFileSync(join(outDir, name), text);
|
|
77
|
+
if (name !== f.fileName) rmSync(from);
|
|
78
|
+
return name;
|
|
79
|
+
});
|
|
80
|
+
const code = readFileSync(join(outDir, entry.fileName));
|
|
81
|
+
const manifest = {
|
|
82
|
+
name: options.name ?? pkg.name ?? "remote",
|
|
83
|
+
version: options.version ?? pkg.version,
|
|
84
|
+
entry: entry.fileName,
|
|
85
|
+
css,
|
|
86
|
+
integrity: "sha384-" + createHash("sha384").update(code).digest("base64"),
|
|
87
|
+
...options.scopeCss === false ? {} : { scope: scopeName() }
|
|
88
|
+
};
|
|
89
|
+
writeFileSync(join(outDir, "vitral.json"), JSON.stringify(manifest, null, 2) + "\n");
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
vitral as default,
|
|
95
|
+
vitral
|
|
96
|
+
};
|
package/dist/vue.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { PropType, App, ShallowRef, Component } from 'vue';
|
|
3
|
+
import { Props, Isolation, RemoteContext, RemoteModule } from './index.js';
|
|
4
|
+
export { events } from './index.js';
|
|
5
|
+
|
|
6
|
+
interface VueRemoteOptions {
|
|
7
|
+
/** Instale plugins (router, pinia, i18n…) no app do remote. */
|
|
8
|
+
setup?: (app: App, ctx: RemoteContext) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Transforma um componente Vue em um remote. */
|
|
11
|
+
declare function vueRemote<P extends Props>(component: Component, options?: VueRemoteOptions): RemoteModule<P>;
|
|
12
|
+
/** Dentro de um remote: dá acesso ao contexto (nome, eventos, baseUrl). */
|
|
13
|
+
declare function useVitral(): RemoteContext | null;
|
|
14
|
+
/** Assina um evento do barramento global enquanto o componente existir. */
|
|
15
|
+
declare function useEvent<T = unknown>(type: string, handler: (payload: T) => void): void;
|
|
16
|
+
/** Ref com o último valor emitido em `type`. */
|
|
17
|
+
declare function useEventValue<T = unknown>(type: string): ShallowRef<T | undefined>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Renderiza um remote. No servidor (Nuxt SSR) renderiza só o slot `fallback`;
|
|
21
|
+
* o remote monta no cliente.
|
|
22
|
+
*
|
|
23
|
+
* Slots: `fallback` (carregando) e `error` ({ error, retry }).
|
|
24
|
+
*/
|
|
25
|
+
declare const VitralRemote: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
26
|
+
name: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
props: {
|
|
31
|
+
type: PropType<Props>;
|
|
32
|
+
default: () => {};
|
|
33
|
+
};
|
|
34
|
+
isolate: {
|
|
35
|
+
type: PropType<Isolation>;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("error" | "ready")[], "error" | "ready", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
41
|
+
name: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
props: {
|
|
46
|
+
type: PropType<Props>;
|
|
47
|
+
default: () => {};
|
|
48
|
+
};
|
|
49
|
+
isolate: {
|
|
50
|
+
type: PropType<Isolation>;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{
|
|
54
|
+
onError?: ((...args: any[]) => any) | undefined;
|
|
55
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
}>, {
|
|
57
|
+
props: Props;
|
|
58
|
+
isolate: Isolation;
|
|
59
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
60
|
+
|
|
61
|
+
export { VitralRemote, type VueRemoteOptions, useEvent, useEventValue, useVitral, vueRemote };
|
package/dist/vue.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineRemote,
|
|
3
|
+
events,
|
|
4
|
+
mountRemote
|
|
5
|
+
} from "./chunk-TTL52BF2.js";
|
|
6
|
+
|
|
7
|
+
// src/vue.ts
|
|
8
|
+
import {
|
|
9
|
+
createApp,
|
|
10
|
+
defineComponent,
|
|
11
|
+
h,
|
|
12
|
+
inject,
|
|
13
|
+
onBeforeUnmount,
|
|
14
|
+
onMounted,
|
|
15
|
+
ref,
|
|
16
|
+
shallowReactive,
|
|
17
|
+
shallowRef,
|
|
18
|
+
watch
|
|
19
|
+
} from "vue";
|
|
20
|
+
var VitralKey = /* @__PURE__ */ Symbol("vitral");
|
|
21
|
+
function vueRemote(component, options = {}) {
|
|
22
|
+
return defineRemote({
|
|
23
|
+
mount(el, props, ctx) {
|
|
24
|
+
const state = shallowReactive({ ...props });
|
|
25
|
+
const app = createApp({ render: () => h(component, state) });
|
|
26
|
+
app.provide(VitralKey, ctx);
|
|
27
|
+
app.config.errorHandler = (e) => ctx.reportError(e);
|
|
28
|
+
options.setup?.(app, ctx);
|
|
29
|
+
app.mount(el);
|
|
30
|
+
return {
|
|
31
|
+
update(next) {
|
|
32
|
+
for (const k of Object.keys(state)) if (!(k in next)) delete state[k];
|
|
33
|
+
Object.assign(state, next);
|
|
34
|
+
},
|
|
35
|
+
unmount: () => app.unmount()
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function useVitral() {
|
|
41
|
+
return inject(VitralKey, null);
|
|
42
|
+
}
|
|
43
|
+
function useEvent(type, handler) {
|
|
44
|
+
let off;
|
|
45
|
+
onMounted(() => off = events.on(type, handler));
|
|
46
|
+
onBeforeUnmount(() => off?.());
|
|
47
|
+
}
|
|
48
|
+
function useEventValue(type) {
|
|
49
|
+
const value = shallowRef(events.last(type));
|
|
50
|
+
useEvent(type, (v) => value.value = v);
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
var VitralRemote = defineComponent({
|
|
54
|
+
name: "VitralRemote",
|
|
55
|
+
props: {
|
|
56
|
+
name: { type: String, required: true },
|
|
57
|
+
props: { type: Object, default: () => ({}) },
|
|
58
|
+
isolate: { type: String, default: void 0 }
|
|
59
|
+
},
|
|
60
|
+
emits: ["error", "ready"],
|
|
61
|
+
setup(p, { slots, emit }) {
|
|
62
|
+
const slot = ref(null);
|
|
63
|
+
const status = ref("loading");
|
|
64
|
+
const error = shallowRef(null);
|
|
65
|
+
const attempt = ref(0);
|
|
66
|
+
let handle = null;
|
|
67
|
+
let token = 0;
|
|
68
|
+
function fail(e, my) {
|
|
69
|
+
if (my !== token) return;
|
|
70
|
+
error.value = e;
|
|
71
|
+
status.value = "error";
|
|
72
|
+
emit("error", e);
|
|
73
|
+
if (!slots.error) console.error(e);
|
|
74
|
+
}
|
|
75
|
+
async function mount() {
|
|
76
|
+
const my = ++token;
|
|
77
|
+
handle?.unmount();
|
|
78
|
+
handle = null;
|
|
79
|
+
status.value = "loading";
|
|
80
|
+
try {
|
|
81
|
+
const onError = (e) => fail(e, my);
|
|
82
|
+
const initial = p.props;
|
|
83
|
+
const h2 = await mountRemote(slot.value, p.name, { ...initial }, { isolate: p.isolate, onError });
|
|
84
|
+
if (my !== token) return h2.unmount();
|
|
85
|
+
handle = h2;
|
|
86
|
+
if (p.props !== initial) h2.update?.({ ...p.props });
|
|
87
|
+
status.value = "ready";
|
|
88
|
+
emit("ready");
|
|
89
|
+
} catch (e) {
|
|
90
|
+
fail(e, my);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
onMounted(mount);
|
|
94
|
+
watch(() => [p.name, p.isolate, attempt.value], mount, { flush: "post" });
|
|
95
|
+
watch(
|
|
96
|
+
() => p.props,
|
|
97
|
+
(next) => handle?.update?.({ ...next }),
|
|
98
|
+
{ deep: true }
|
|
99
|
+
);
|
|
100
|
+
onBeforeUnmount(() => {
|
|
101
|
+
token++;
|
|
102
|
+
handle?.unmount();
|
|
103
|
+
handle = null;
|
|
104
|
+
});
|
|
105
|
+
const retry = () => attempt.value++;
|
|
106
|
+
return () => h("div", { "data-vitral": p.name, "data-vitral-status": status.value }, [
|
|
107
|
+
status.value === "loading" ? slots.fallback?.() : null,
|
|
108
|
+
status.value === "error" ? slots.error?.({ error: error.value, retry }) : null,
|
|
109
|
+
// O Vue nunca coloca filhos neste div: ele pertence ao remote.
|
|
110
|
+
h("div", {
|
|
111
|
+
key: `${p.name}:${p.isolate}:${attempt.value}`,
|
|
112
|
+
ref: slot,
|
|
113
|
+
style: status.value === "error" ? "display:none" : void 0
|
|
114
|
+
})
|
|
115
|
+
]);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
VitralRemote,
|
|
120
|
+
events,
|
|
121
|
+
useEvent,
|
|
122
|
+
useEventValue,
|
|
123
|
+
useVitral,
|
|
124
|
+
vueRemote
|
|
125
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,198 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitral",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Micro-frontends sem burocracia: um contrato mount/unmount, carregamento em runtime e adaptadores para React, Next, Vue, Nuxt, Angular, Svelte, Solid, Preact, Lit e JS/TS puro.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"micro-frontend",
|
|
7
|
+
"microfrontends",
|
|
8
|
+
"module-federation",
|
|
9
|
+
"single-spa",
|
|
10
|
+
"react",
|
|
11
|
+
"nextjs",
|
|
12
|
+
"vue",
|
|
13
|
+
"nuxt",
|
|
14
|
+
"angular",
|
|
15
|
+
"svelte",
|
|
16
|
+
"solid",
|
|
17
|
+
"preact",
|
|
18
|
+
"lit",
|
|
19
|
+
"web-components",
|
|
20
|
+
"vite"
|
|
21
|
+
],
|
|
22
|
+
"homepage": "https://github.com/joaogabriel15/vitral#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/joaogabriel15/vitral/issues"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/joaogabriel15/vitral.git",
|
|
29
|
+
"directory": "packages/vitral"
|
|
30
|
+
},
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"author": "João (https://github.com/joaogabriel15)",
|
|
33
|
+
"type": "module",
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"import": "./dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./element": {
|
|
49
|
+
"types": "./dist/element.d.ts",
|
|
50
|
+
"import": "./dist/element.js"
|
|
51
|
+
},
|
|
52
|
+
"./react": {
|
|
53
|
+
"types": "./dist/react.d.ts",
|
|
54
|
+
"import": "./dist/react.js"
|
|
55
|
+
},
|
|
56
|
+
"./vue": {
|
|
57
|
+
"types": "./dist/vue.d.ts",
|
|
58
|
+
"import": "./dist/vue.js"
|
|
59
|
+
},
|
|
60
|
+
"./svelte": {
|
|
61
|
+
"types": "./dist/svelte.d.ts",
|
|
62
|
+
"import": "./dist/svelte.js"
|
|
63
|
+
},
|
|
64
|
+
"./preact": {
|
|
65
|
+
"types": "./dist/preact.d.ts",
|
|
66
|
+
"import": "./dist/preact.js"
|
|
67
|
+
},
|
|
68
|
+
"./solid": {
|
|
69
|
+
"types": "./dist/solid.d.ts",
|
|
70
|
+
"import": "./dist/solid.js"
|
|
71
|
+
},
|
|
72
|
+
"./angular": {
|
|
73
|
+
"types": "./dist/angular.d.ts",
|
|
74
|
+
"import": "./dist/angular.js"
|
|
75
|
+
},
|
|
76
|
+
"./vite": {
|
|
77
|
+
"types": "./dist/vite.d.ts",
|
|
78
|
+
"import": "./dist/vite.js"
|
|
79
|
+
},
|
|
80
|
+
"./testing": {
|
|
81
|
+
"types": "./dist/testing.d.ts",
|
|
82
|
+
"import": "./dist/testing.js"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"publishConfig": {
|
|
86
|
+
"access": "public",
|
|
87
|
+
"provenance": true
|
|
88
|
+
},
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"postcss": "^8.5.30"
|
|
91
|
+
},
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"@angular/core": ">=17",
|
|
94
|
+
"@angular/platform-browser": ">=17",
|
|
95
|
+
"preact": ">=10",
|
|
96
|
+
"react": ">=18",
|
|
97
|
+
"react-dom": ">=18",
|
|
98
|
+
"solid-js": ">=1.8",
|
|
99
|
+
"svelte": ">=5",
|
|
100
|
+
"vite": ">=5",
|
|
101
|
+
"vue": ">=3.3"
|
|
102
|
+
},
|
|
103
|
+
"peerDependenciesMeta": {
|
|
104
|
+
"react": {
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
"react-dom": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"vue": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
113
|
+
"svelte": {
|
|
114
|
+
"optional": true
|
|
115
|
+
},
|
|
116
|
+
"preact": {
|
|
117
|
+
"optional": true
|
|
118
|
+
},
|
|
119
|
+
"solid-js": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"@angular/core": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"@angular/platform-browser": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
128
|
+
"vite": {
|
|
129
|
+
"optional": true
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"devDependencies": {
|
|
133
|
+
"@angular/common": "^22.2.2",
|
|
134
|
+
"@angular/compiler": "^22.2.2",
|
|
135
|
+
"@angular/core": "^22.2.2",
|
|
136
|
+
"@angular/platform-browser": "^22.2.2",
|
|
137
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
138
|
+
"@size-limit/preset-small-lib": "^11.2.0",
|
|
139
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
140
|
+
"@testing-library/dom": "^10.4.2",
|
|
141
|
+
"@types/node": "^22.20.5",
|
|
142
|
+
"@types/react": "^19.0.0",
|
|
143
|
+
"@types/react-dom": "^19.0.0",
|
|
144
|
+
"happy-dom": "^20.0.0",
|
|
145
|
+
"preact": "^10.29.8",
|
|
146
|
+
"publint": "^0.3.25",
|
|
147
|
+
"react": "^19.0.0",
|
|
148
|
+
"react-dom": "^19.0.0",
|
|
149
|
+
"rxjs": "^7.8.2",
|
|
150
|
+
"size-limit": "^11.2.0",
|
|
151
|
+
"solid-js": "^1.9.17",
|
|
152
|
+
"svelte": "^5.57.2",
|
|
153
|
+
"tsup": "^8.5.0",
|
|
154
|
+
"typescript": "~5.9.0",
|
|
155
|
+
"vite": "^8.0.0",
|
|
156
|
+
"vitest": "^4.0.0",
|
|
157
|
+
"vue": "^3.5.0"
|
|
158
|
+
},
|
|
159
|
+
"size-limit": [
|
|
160
|
+
{
|
|
161
|
+
"name": "núcleo",
|
|
162
|
+
"path": "dist/index.js",
|
|
163
|
+
"limit": "5 kB"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "react",
|
|
167
|
+
"path": "dist/react.js",
|
|
168
|
+
"import": "{ Remote, reactRemote }",
|
|
169
|
+
"ignore": [
|
|
170
|
+
"react",
|
|
171
|
+
"react-dom"
|
|
172
|
+
],
|
|
173
|
+
"limit": "6 kB"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "vue",
|
|
177
|
+
"path": "dist/vue.js",
|
|
178
|
+
"import": "{ VitralRemote, vueRemote }",
|
|
179
|
+
"ignore": [
|
|
180
|
+
"vue"
|
|
181
|
+
],
|
|
182
|
+
"limit": "6 kB"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "element",
|
|
186
|
+
"path": "dist/element.js",
|
|
187
|
+
"import": "{ defineVitralElement }",
|
|
188
|
+
"limit": "6 kB"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"scripts": {
|
|
192
|
+
"build": "tsup",
|
|
193
|
+
"test": "vitest run",
|
|
194
|
+
"typecheck": "tsc --noEmit",
|
|
195
|
+
"lint:pkg": "publint --strict && attw --pack --profile esm-only",
|
|
196
|
+
"size": "size-limit"
|
|
197
|
+
}
|
|
6
198
|
}
|