Skip to content

Commit 8c0b7c8

Browse files
author
Ives van Hoorne
committed
Include package.json in bundle
1 parent 5584ba6 commit 8c0b7c8

File tree

7 files changed

+73
-18
lines changed

7 files changed

+73
-18
lines changed

packages/react-sandpack/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-smooshpack",
3-
"version": "0.0.31",
3+
"version": "0.0.32",
44
"description": "",
55
"keywords": [],
66
"license": "SEE LICENSE.MD IN ROOT",
@@ -87,7 +87,7 @@
8787
"react-broadcast": "^0.6.2",
8888
"react-codemirror2": "^4.0.1",
8989
"rollup-plugin-scss": "^0.4.0",
90-
"smooshpack": "^0.0.31"
90+
"smooshpack": "^0.0.32"
9191
},
9292
"peerDependencies": {
9393
"react": "^16.0.0"

packages/sandpack/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smooshpack",
3-
"version": "0.0.31",
3+
"version": "0.0.32",
44
"description": "",
55
"keywords": [],
66
"main": "dist/sandpack.umd.js",
@@ -23,7 +23,7 @@
2323
"scripts": {
2424
"lint": "tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
2525
"prebuild": "rimraf dist",
26-
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --mode file src",
26+
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --ignoreCompilerErrors --mode file src",
2727
"start": "rollup -c rollup.config.ts -w",
2828
"test:prod": "npm run lint && npm run test -- --coverage --no-cache",
2929
"deploy-docs": "ts-node tools/gh-pages-publish",
@@ -99,6 +99,7 @@
9999
"rimraf": "^2.6.2",
100100
"rollup": "^0.55.4",
101101
"rollup-plugin-commonjs": "^8.0.2",
102+
"rollup-plugin-json": "^2.3.0",
102103
"rollup-plugin-node-resolve": "^3.0.0",
103104
"rollup-plugin-sourcemaps": "^0.4.2",
104105
"rollup-plugin-typescript2": "^0.11.1",
@@ -108,7 +109,7 @@
108109
"tslint": "^5.8.0",
109110
"tslint-config-prettier": "^1.1.0",
110111
"tslint-config-standard": "^7.0.0",
111-
"typedoc": "^0.10.0",
112+
"typedoc": "^0.11.1",
112113
"typescript": "^2.6.2",
113114
"validate-commit-msg": "^2.12.2"
114115
}

packages/sandpack/rollup.config.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import resolve from 'rollup-plugin-node-resolve'
2-
import commonjs from 'rollup-plugin-commonjs'
3-
import sourceMaps from 'rollup-plugin-sourcemaps'
4-
import camelCase from 'lodash.camelcase'
5-
import typescript from 'rollup-plugin-typescript2'
1+
import resolve from 'rollup-plugin-node-resolve';
2+
import commonjs from 'rollup-plugin-commonjs';
3+
import json from 'rollup-plugin-json';
4+
import sourceMaps from 'rollup-plugin-sourcemaps';
5+
import camelCase from 'lodash.camelcase';
6+
import typescript from 'rollup-plugin-typescript2';
67

7-
const pkg = require('./package.json')
8+
const pkg = require('./package.json');
89

9-
const libraryName = 'sandpack'
10+
const libraryName = 'sandpack';
1011

1112
export default {
1213
input: `src/${libraryName}.ts`,
@@ -21,6 +22,7 @@ export default {
2122
include: 'src/**',
2223
},
2324
plugins: [
25+
json(),
2426
// Compile TypeScript files
2527
typescript({ useTsconfigDeclarationDir: true }),
2628
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
@@ -33,4 +35,4 @@ export default {
3335
// Resolve source maps to the original source
3436
sourceMaps(),
3537
],
36-
}
38+
};

packages/sandpack/src/version.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default require('../package.json').version;
1+
import { version } from '../package.json';
2+
3+
export default version;

packages/sandpack/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"emitDecoratorMetadata": true,
1313
"declarationDir": "dist/types",
1414
"outDir": "dist",
15-
"typeRoots": ["node_modules/@types"]
15+
"typeRoots": ["node_modules/@types", "typings"]
1616
},
17-
"include": ["src"]
17+
"include": ["src", "typings"]
1818
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module '*.json' {
2+
const value: any;
3+
export const version: string;
4+
export default value;
5+
}

yarn.lock

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,12 @@
556556
dependencies:
557557
"@types/node" "*"
558558

559+
560+
version "5.0.1"
561+
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.1.tgz#cd856fbbdd6af2c11f26f8928fd8644c9e9616c9"
562+
dependencies:
563+
"@types/node" "*"
564+
559565
"@types/fs-extra@^3.0.0":
560566
version "3.0.3"
561567
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.3.tgz#1d66eb670ebf657e57c0fda014df340c19d8aa0c"
@@ -615,7 +621,7 @@
615621
dependencies:
616622
"@types/lodash" "*"
617623

618-
"@types/lodash@*":
624+
"@types/lodash@*", "@types/[email protected]":
619625
version "4.14.104"
620626
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80"
621627

@@ -699,6 +705,13 @@
699705
"@types/glob" "*"
700706
"@types/node" "*"
701707

708+
709+
version "0.7.8"
710+
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.8.tgz#4b4d6ee7926e58d7bca448a50ba442fd9f6715bd"
711+
dependencies:
712+
"@types/glob" "*"
713+
"@types/node" "*"
714+
702715
"@types/shelljs@^0.7.0":
703716
version "0.7.6"
704717
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.6.tgz#4ac7ca01c191ba65b8e2bf50543c5560084d8d27"
@@ -12044,6 +12057,10 @@ marked@^0.3.12, marked@^0.3.9:
1204412057
version "0.3.17"
1204512058
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.17.tgz#607f06668b3c6b1246b28f13da76116ac1aa2d2b"
1204612059

12060+
marked@^0.3.17:
12061+
version "0.3.19"
12062+
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
12063+
1204712064
marked@^0.3.5:
1204812065
version "0.3.6"
1204912066
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7"
@@ -16330,6 +16347,12 @@ rollup-plugin-commonjs@^8.0.2:
1633016347
resolve "^1.4.0"
1633116348
rollup-pluginutils "^2.0.1"
1633216349

16350+
rollup-plugin-json@^2.3.0:
16351+
version "2.3.0"
16352+
resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-2.3.0.tgz#3c07a452c1b5391be28006fbfff3644056ce0add"
16353+
dependencies:
16354+
rollup-pluginutils "^2.0.1"
16355+
1633316356
rollup-plugin-node-resolve@^3.0.0:
1633416357
version "3.0.0"
1633516358
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0"
@@ -18589,6 +18612,28 @@ typedoc@^0.10.0:
1858918612
typedoc-default-themes "^0.5.0"
1859018613
typescript "2.7.1"
1859118614

18615+
typedoc@^0.11.1:
18616+
version "0.11.1"
18617+
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.11.1.tgz#9f033887fd2218c769e1045feb88a1efed9f12c9"
18618+
dependencies:
18619+
"@types/fs-extra" "5.0.1"
18620+
"@types/handlebars" "4.0.36"
18621+
"@types/highlight.js" "9.12.2"
18622+
"@types/lodash" "4.14.104"
18623+
"@types/marked" "0.3.0"
18624+
"@types/minimatch" "3.0.3"
18625+
"@types/shelljs" "0.7.8"
18626+
fs-extra "^5.0.0"
18627+
handlebars "^4.0.6"
18628+
highlight.js "^9.0.0"
18629+
lodash "^4.17.5"
18630+
marked "^0.3.17"
18631+
minimatch "^3.0.0"
18632+
progress "^2.0.0"
18633+
shelljs "^0.8.1"
18634+
typedoc-default-themes "^0.5.0"
18635+
typescript "2.7.2"
18636+
1859218637
typedoc@^0.7.1:
1859318638
version "0.7.2"
1859418639
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.7.2.tgz#d9859422b2d7ea604bc4f217e901f82aa1ab2c46"
@@ -18611,7 +18656,7 @@ typedoc@^0.7.1:
1861118656
typedoc-default-themes "^0.5.0"
1861218657
typescript "2.3.4"
1861318658

18614-
typescript@*, typescript@^2.3.4, typescript@^2.4.2, typescript@^2.6.2:
18659+
typescript@*, typescript@2.7.2, typescript@^2.3.4, typescript@^2.4.2, typescript@^2.6.2:
1861518660
version "2.7.2"
1861618661
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
1861718662

0 commit comments

Comments
 (0)