[chore] Fix CI (#8160)

* ci build

* fix test

* add test for #7938
pull/8175/head
Yuichiro Yamashita 2 years ago committed by GitHub
parent 26c0d3f17d
commit e1a1c7fa87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,8 +3,12 @@
const { execSync } = require('child_process');
const { readFileSync, writeFileSync } = require('fs');
execSync('tsc -p src/compiler --emitDeclarationOnly && tsc -p src/runtime --emitDeclarationOnly');
try {
execSync('tsc -p src/compiler --emitDeclarationOnly && tsc -p src/runtime --emitDeclarationOnly');
} catch (err) {
console.error(err.stderr.toString());
throw err;
}
// We need to add these types to the .d.ts files here because if we add them before building, the build will fail,
// because the TS->JS transformation doesn't know these exports are types and produces code that fails at runtime.
// We can't use `export type` syntax either because the TS version we're on doesn't have this feature yet.

@ -198,7 +198,7 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
delay,
duration,
easing,
css: (t, u) => `
css: (_, u) => `
stroke-dasharray: ${len};
stroke-dashoffset: ${u * len};
`

@ -39,16 +39,16 @@ function create_dynamic_element(ctx) {
return {
c() {
svelte_element1 = element("a");
svelte_element0 = element("span");
svelte_element1 = element(a);
svelte_element0 = element(span);
if ((/-/).test("span")) {
if ((/-/).test(span)) {
set_custom_element_data_map(svelte_element0, svelte_element0_data);
} else {
set_attributes(svelte_element0, svelte_element0_data);
}
if ((/-/).test("a")) {
if ((/-/).test(a)) {
set_custom_element_data_map(svelte_element1, svelte_element1_data);
} else {
set_attributes(svelte_element1, svelte_element1_data);
@ -72,7 +72,7 @@ function create_dynamic_element(ctx) {
p(ctx, dirty) {
svelte_element0_data = get_spread_update(svelte_element0_levels, [{ class: "inner" }]);
if ((/-/).test("span")) {
if ((/-/).test(span)) {
set_custom_element_data_map(svelte_element0, svelte_element0_data);
} else {
set_attributes(svelte_element0, svelte_element0_data);
@ -80,7 +80,7 @@ function create_dynamic_element(ctx) {
svelte_element1_data = get_spread_update(svelte_element1_levels, [{ class: "outer" }]);
if ((/-/).test("a")) {
if ((/-/).test(a)) {
set_custom_element_data_map(svelte_element1, svelte_element1_data);
} else {
set_attributes(svelte_element1, svelte_element1_data);
@ -95,9 +95,9 @@ function create_dynamic_element(ctx) {
}
function create_fragment(ctx) {
let previous_tag = "a";
let previous_tag = a;
let svelte_element_anchor;
let svelte_element = "a" && create_dynamic_element(ctx);
let svelte_element = a && create_dynamic_element(ctx);
return {
c() {
@ -109,12 +109,12 @@ function create_fragment(ctx) {
insert(target, svelte_element_anchor, anchor);
},
p(ctx, [dirty]) {
if ("a") {
if (a) {
if (!previous_tag) {
svelte_element = create_dynamic_element(ctx);
svelte_element.c();
svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor);
} else if (safe_not_equal(previous_tag, "a")) {
} else if (safe_not_equal(previous_tag, a)) {
svelte_element.d(1);
svelte_element = create_dynamic_element(ctx);
svelte_element.c();
@ -127,7 +127,7 @@ function create_fragment(ctx) {
svelte_element = null;
}
previous_tag = "a";
previous_tag = a;
},
i: noop,
o: noop,
@ -138,6 +138,9 @@ function create_fragment(ctx) {
};
}
const a = 'a';
const span = 'span';
function instance($$self) {
function keydown_handler(event) {
bubble.call(this, $$self, event);

@ -1,3 +1,8 @@
<svelte:element class="outer" this="a" on:keydown on:keyup>
<svelte:element class="inner" this="span" on:keydown on:keyup></svelte:element>
</svelte:element>
<script>
const a = 'a';
const span = 'span';
</script>
<svelte:element this={a} class='outer' on:keydown on:keyup>
<svelte:element this={span} class='inner' on:keydown on:keyup />
</svelte:element>

@ -0,0 +1,41 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
attr,
detach,
element,
init,
insert,
noop,
safe_not_equal
} from "svelte/internal";
function create_fragment(ctx) {
let a;
return {
c() {
a = element("a");
a.innerHTML = `<span class="inner"></span>`;
attr(a, "class", "outer");
},
m(target, anchor) {
insert(target, a, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(a);
}
};
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
}
}
export default Component;

@ -0,0 +1,3 @@
<svelte:element this='a' class='outer'>
<svelte:element this='span' class='inner' />
</svelte:element>
Loading…
Cancel
Save