Skip to content

Commit

Permalink
Merge branch 'master' into IlyaSemenov-gh-2843
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 16, 2019
2 parents d364786 + a332b64 commit 1ad555c
Show file tree
Hide file tree
Showing 51 changed files with 239 additions and 392 deletions.
9 changes: 0 additions & 9 deletions .flowconfig

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
node_modules
*.map
/src/compiler/compile/internal-exports.ts
/compiler.d.ts
/compiler.*js
/index.*js
/internal
Expand Down
1 change: 0 additions & 1 deletion compiler.d.ts

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"engines": {
"node": ">= 8"
},
"types": "types/runtime",
"types": "types/runtime/index.d.ts",
"scripts": {
"test": "mocha --opts mocha.opts",
"test:unit": "mocha --require sucrase/register --recursive src/**/__test__.ts",
Expand All @@ -35,10 +35,8 @@
"dev": "rollup -cw",
"pretest": "npm run build",
"posttest": "agadoo internal/index.mjs",
"prepublishOnly": "export PUBLISH=true && npm test && npm run create-stubs",
"create-stubs": "node scripts/create-stubs.js",
"tsd": "tsc -p . --emitDeclarationOnly",
"typecheck": "tsc -p . --noEmit",
"prepublishOnly": "PUBLISH=true npm test",
"tsd": "tsc -p src/compiler --emitDeclarationOnly && tsc -p src/runtime --emitDeclarationOnly",
"lint": "eslint \"{src,test}/**/*.{ts,js}\""
},
"repository": {
Expand All @@ -59,7 +57,7 @@
"homepage": "https://github.com/sveltejs/svelte#README",
"devDependencies": {
"@types/mocha": "^5.2.0",
"@types/node": "^10.5.5",
"@types/node": "=8",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"acorn": "^6.1.1",
Expand Down
22 changes: 17 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const ts_plugin = is_publish

const external = id => id.startsWith('svelte/');

fs.writeFileSync(`./compiler.d.ts`, `export * from './types/compiler/index';`);

export default [
/* runtime */
{
Expand Down Expand Up @@ -59,12 +61,22 @@ export default [
external,
plugins: [
ts_plugin,
dir === 'internal' && {
generateBundle(options, bundle) {
const mod = bundle['index.mjs'];
if (mod) {
fs.writeFileSync('src/compiler/compile/internal-exports.ts', `// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
{
writeBundle(bundle) {
if (dir === 'internal') {
const mod = bundle['index.mjs'];
if (mod) {
fs.writeFileSync('src/compiler/compile/internal-exports.ts', `// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`);
}
}

fs.writeFileSync(`${dir}/package.json`, JSON.stringify({
main: './index',
module: './index.mjs',
types: './index.d.ts'
}, null, ' '));

fs.writeFileSync(`${dir}/index.d.ts`, `export * from '../types/runtime/${dir}/index';`);
}
}
]
Expand Down
12 changes: 0 additions & 12 deletions scripts/create-stubs.js

This file was deleted.

6 changes: 4 additions & 2 deletions site/content/examples/19-7guis/05-7guis-crud/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
}
function remove() {
people = [...people.slice(0, i), ...people.slice(i + 1)];
// Remove selected person from the source array (people), not the filtered array
const index = people.indexOf(selected);
people = [...people.slice(0, index), ...people.slice(index + 1)];
first = last = '';
i = Math.min(i, people.length - 1);
i = Math.min(i, filteredPeople.length - 2);
}
function reset_inputs(person) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { comicSans, link } from './styles.js';
import Hero from './Hero.html';
import Hero from './Hero.svelte';
</script>

<Hero/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { css } from 'emotion/dist/emotion.umd.min.js';
import emotion from 'emotion/dist/emotion.umd.min.js';

const { css } = emotion;

const brand = '#74D900';

Expand Down Expand Up @@ -30,4 +32,4 @@ export const link = css`
text-decoration: none;
background: ${brand};
}
`;
`;
5 changes: 0 additions & 5 deletions site/cypress/fixtures/example.json

This file was deleted.

19 changes: 0 additions & 19 deletions site/cypress/integration/spec.js

This file was deleted.

17 changes: 0 additions & 17 deletions site/cypress/plugins/index.js

This file was deleted.

25 changes: 0 additions & 25 deletions site/cypress/support/commands.js

This file was deleted.

20 changes: 0 additions & 20 deletions site/cypress/support/index.js

This file was deleted.

6 changes: 3 additions & 3 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
"copy-workers": "rm -rf static/workers && cp -r node_modules/@sveltejs/svelte-repl/workers static",
"migrate": "node-pg-migrate -r dotenv/config",
"sapper": "npm run copy-workers && sapper build --legacy",
"update_shimport": "cp node_modules/shimport/index.js __sapper__/build/client/shimport@0.0.14.js",
"update": "node scripts/update_template.js && node scripts/get-contributors.js",
"start": "node __sapper__/build",
"cy:run": "cypress run",
"cy:open": "cypress open",
"test": "run-p --race dev cy:run",
"testsrc": "mocha -r esm test/**",
"test": "mocha -r esm test/**",
"deploy": "make deploy"
},
"dependencies": {
Expand All @@ -39,7 +35,7 @@
"@babel/runtime": "^7.4.4",
"@sindresorhus/slugify": "^0.9.1",
"@sveltejs/site-kit": "^1.0.4",
"@sveltejs/svelte-repl": "^0.1.7",
"@sveltejs/svelte-repl": "^0.1.8",
"degit": "^2.1.3",
"dotenv": "^8.0.0",
"eslint-plugin-svelte3": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/compile/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assign } from '../../runtime/internal/index';
import { assign } from '../../runtime/internal/utils';
import Stats from '../Stats';
import parse from '../parse/index';
import render_dom from './render-dom/index';
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/compile/nodes/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ export default class Element extends Node {
} else if (
name === 'text' ||
name === 'html'
){
) {
const contenteditable = this.attributes.find(
(attribute: Attribute) => attribute.name === 'contenteditable'
);
Expand All @@ -626,7 +626,7 @@ export default class Element extends Node {
message: `'contenteditable' attribute cannot be dynamic if element uses two-way binding`
});
}
} else if (name !== 'this') {
} else if (name !== 'this') {
component.error(binding, {
code: `invalid-binding`,
message: `'${binding.name}' is not a valid binding`
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/compile/nodes/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class Text extends Node {
super(component, parent, scope, info);
this.data = info.data;

if (!component.component_options.preserveWhitespace && !/\S/.test(info.data)) {
if (!component.component_options.preserveWhitespace && !/[\S\u00A0]/.test(info.data)) {
let node = parent;
while (node) {
if (node.type === 'Element' && node.name === 'pre') {
Expand Down
Loading

0 comments on commit 1ad555c

Please sign in to comment.