Skip to content

Commit

Permalink
Distribute package as source
Browse files Browse the repository at this point in the history
This library is not meant for writing end user applications or even for
being used directly when writing tests. It is not meant to be loaded
directly by browsers.

Consumers of this package are assumed to use their own bundlers, should
they need to bundle code for use in browsers or workers.

Therefore, it is safe to distribute the package as source files and not
bundle them up.

This allows us to remove the bundler and its transitive dependencies,
which reduces the maintenance burden of managing the library.
  • Loading branch information
mroderick committed Jan 13, 2021
1 parent aa6815e commit 04e0faa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ node_modules
.idea
site/
coverage/
dist/
.nyc_output/
out
types/
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Christian Johansen",
"license": "BSD-3-Clause",
"main": "./lib/samsam",
"types": "./dist/samsam.d.ts",
"types": "./types/samsam.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/sinonjs/samsam.git"
Expand All @@ -16,10 +16,7 @@
},
"scripts": {
"benchmark": "node lib/deep-equal-benchmark.js",
"build": "npm run build:dist-folder && npm run build:bundle && npm run build:type-defs",
"build:bundle": "rollup -c",
"build:dist-folder": "mkdirp dist",
"build:type-defs": "tsc",
"build": "rm -rf types && tsc",
"jsdoc": "jsdoc -c jsdoc.conf.json",
"lint": "eslint .",
"prepublishOnly": "npm run build && mkdocs gh-deploy -r upstream || mkdocs gh-deploy -r origin",
Expand All @@ -37,10 +34,10 @@
"jsdom-global": false
},
"files": [
"dist/",
"docs/",
"lib/",
"!lib/**/*.test.js"
"!lib/**/*.test.js",
"types/"
],
"dependencies": {
"@sinonjs/commons": "^1.6.0",
Expand Down
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"include": [
"dist/*.js"
"lib/*.js"
],
"exclude" : [
"lib/*.test.js"
],
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"allowJs": true
"allowJs": true,
"outDir": "types"
}
}

0 comments on commit 04e0faa

Please sign in to comment.