Skip to content

Commit

Permalink
Merge branch 'master' into gh-2612
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Jun 18, 2019
2 parents 59f04c9 + 5e81280 commit 3a384f0
Show file tree
Hide file tree
Showing 57 changed files with 572 additions and 649 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.

12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"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 ./**/__test__.ts",
"test:unit": "mocha --require sucrase/register --recursive src/**/__test__.ts",
"quicktest": "mocha --opts mocha.opts",
"precoverage": "c8 mocha --opts mocha.coverage.opts",
"coverage": "c8 report --reporter=text-lcov > coverage.lcov && c8 report --reporter=html",
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.

Loading

0 comments on commit 3a384f0

Please sign in to comment.