Skip to content

Commit

Permalink
fix: missing files for pnpm format
Browse files Browse the repository at this point in the history
  • Loading branch information
Artxe2 committed Sep 14, 2023
1 parent f1ab829 commit 7015f4b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
10 changes: 5 additions & 5 deletions packages/svelte/scripts/generate-dts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { createBundle } from 'dts-buddy';

// It may look weird, but the imports MUST be ending with index.js to be properly resolved in all TS modes
for (const name of ['action', 'animate', 'easing', 'motion', 'store', 'transition']) {
fs.writeFileSync(`${name}.d.ts`, 'import \'./types/index.js\';');
fs.writeFileSync(`${name}.d.ts`, "import './types/index.js';");
}

fs.writeFileSync('index.d.ts', 'import \'./types/index.js\';');
fs.writeFileSync('compiler.d.ts', 'import \'./types/index.js\';');
fs.writeFileSync('index.d.ts', "import './types/index.js';");
fs.writeFileSync('compiler.d.ts', "import './types/index.js';");

// TODO: some way to mark these as deprecated
fs.mkdirSync('./types/compiler', { recursive: true });
fs.writeFileSync('./types/compiler/preprocess.d.ts', 'import \'../index.js\';');
fs.writeFileSync('./types/compiler/interfaces.d.ts', 'import \'../index.js\';');
fs.writeFileSync('./types/compiler/preprocess.d.ts', "import '../index.js';");
fs.writeFileSync('./types/compiler/interfaces.d.ts', "import '../index.js';");

await createBundle({
output: 'types/index.d.ts',
Expand Down
4 changes: 3 additions & 1 deletion packages/svelte/src/compiler/compile/nodes/EachBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export default class EachBlock extends AbstractBlock {
this.has_animation = false;
[this.const_tags, this.children] = get_const_tags(info.children, component, this, this);
if (this.has_animation) {
this.children = this.children.filter((child) => !is_empty_node(child) && !is_comment_node(child));
this.children = this.children.filter(
(child) => !is_empty_node(child) && !is_comment_node(child)
);
if (this.children.length !== 1) {
const child = this.children.find(
(child) => !!(/** @type {import('./Element.js').default} */ (child).animation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ export default {

async test({ assert, target }) {
const first_span_list = target.children[0];
assert.htmlEqualWithOptions(first_span_list.innerHTML, expected, { withoutNormalizeHtml: true });
assert.htmlEqualWithOptions(first_span_list.innerHTML, expected, {
withoutNormalizeHtml: true
});

const second_span_list = target.children[1];
assert.htmlEqualWithOptions(second_span_list.innerHTML, expected, { withoutNormalizeHtml: true });
assert.htmlEqualWithOptions(second_span_list.innerHTML, expected, {
withoutNormalizeHtml: true
});
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ multiple leading newlines</textarea></div>`,
element_textarea_without_leading_newline.children[2].value,
' \nnewline after leading space'
);
assert.equal(element_textarea_with_multiple_leading_newline.value, '\n\nmultiple leading newlines');
assert.equal(
element_textarea_with_multiple_leading_newline.value,
'\n\nmultiple leading newlines'
);
assert.equal(
element_div_with_textarea_with_multiple_leading_newline.children[0].value,
'\n\nmultiple leading newlines'
Expand Down
5 changes: 4 additions & 1 deletion packages/svelte/test/sourcemaps/sourcemaps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ describe('sourcemaps', async () => {
JSON.stringify(preprocessed.map, null, 2)
);
}
fs.writeFileSync(`${output_base}.js`, `${js.code}\n//# sourceMappingURL=${output_name}.js.map`);
fs.writeFileSync(
`${output_base}.js`,
`${js.code}\n//# sourceMappingURL=${output_name}.js.map`
);
fs.writeFileSync(`${output_base}.js.map`, JSON.stringify(js.map, null, 2));
if (css.code) {
fs.writeFileSync(
Expand Down

0 comments on commit 7015f4b

Please sign in to comment.