diff --git a/.gitignore b/.gitignore index 4ef8da6e..dda69ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,9 @@ /dist /tmp /out-tsc -src/**/*.js -src/**/*.map -src/**/*.d.ts +lib/**/*.js +lib/**/*.map +lib/**/*.d.ts # dependencies /node_modules diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 7dc18b0c..00000000 --- a/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -config/ -src/ -coverage/ -*.iml -.travis.yml -.eslintrc -tsconfig.json -tslint.conf -yarn-error.log -karma.conf.js -lib/**/*.js.map -local.log -tslint.json diff --git a/karma.conf.js b/karma.conf.js index 3b39e7cf..c2371583 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -5,12 +5,12 @@ const path = require('path'); module.exports = config => { config.set({ - basePath: '.', + basePath: 'lib', frameworks: [ 'jasmine' ], files: [ - {pattern: 'src/**/*.spec.ts'} + {pattern: '**/*.spec.ts'} ], preprocessors: { '**/*.ts': 'webpack', @@ -18,7 +18,6 @@ module.exports = config => { webpack: { mode: 'development', - entry: './src/index.ts', resolve: { extensions: ['.tsx', '.ts', '.js'] }, @@ -27,14 +26,12 @@ module.exports = config => { rules: [ { test: /\.ts$/, - use: 'ts-loader', - include: path.resolve('src') + use: 'ts-loader' }, { test: /\.ts$/, use: {loader: 'istanbul-instrumenter-loader'}, enforce: 'post', - include: path.resolve('src'), exclude: /\.spec\.ts$/ } @@ -109,5 +106,8 @@ module.exports = config => { browsers: ['Chrome'], colors: true, singleRun: false, + + browserNoActivityTimeout: 60000, + browserDisconnectTolerance: 3 }); }; diff --git a/src/index.spec.ts b/lib/index.spec.ts similarity index 100% rename from src/index.spec.ts rename to lib/index.spec.ts diff --git a/src/index.ts b/lib/index.ts similarity index 100% rename from src/index.ts rename to lib/index.ts diff --git a/src/tsconfig.dist.json b/lib/tsconfig.dist.json similarity index 74% rename from src/tsconfig.dist.json rename to lib/tsconfig.dist.json index f15a9235..0553cf1b 100644 --- a/src/tsconfig.dist.json +++ b/lib/tsconfig.dist.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "outDir": "../dist", - "sourceMap": false, + "sourceMap": true, "declaration": true }, "exclude": [ diff --git a/src/tsconfig.spec.json b/lib/tsconfig.spec.json similarity index 71% rename from src/tsconfig.spec.json rename to lib/tsconfig.spec.json index 65c48071..f99895d2 100644 --- a/src/tsconfig.spec.json +++ b/lib/tsconfig.spec.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "sourceMap": true, - "declaration": true + "sourceMap": false }, "include": [ "**/*.spec.ts", diff --git a/package.json b/package.json index 149dfac9..93c66822 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,12 @@ "name": "music-metadata-browser", "version": "1.4.0", "description": "Browserifed version of music-metadata", - "main": "dist/index.js", - "typings": "dist/index", + "main": "lib/index.js", + "typings": "lib/index", + "files": [ + "lib/**/*.js", + "lib/**/*.d.ts" + ], "repository": "https://github.com/Borewit/music-metadata-browser.git", "author": { "name": "Borewit", @@ -53,12 +57,12 @@ "url": "https://github.com/Borewit/music-metadata-browser/issues" }, "scripts": { - "clean": "del-cli dist/** src/**/*.js src/**/*.js.map src/**/*.d.ts coverage", - "compile-dist": "tsc -p src/tsconfig.dist.json", - "compile-test": "tsc -p src/tsconfig.spec.json", + "clean": "del-cli lib/**/*.js lib/**/*.js.map lib/**/*.d.ts coverage", + "compile-lib": "tsc -p lib/tsconfig.dist.json", + "compile-test": "tsc -p lib/tsconfig.spec.json", "prepublishOnly": "yarn run build", - "build": "npm run compile-dist", - "tslint": "tslint 'src/**/*.ts' --exclude 'src/**/*.d.ts'", + "build": "npm run compile-lib && npm run compile-test", + "tslint": "tslint 'lib/**/*.ts' --exclude 'lib/**/*.d.ts'", "eslint": "eslint karma.conf.js", "lint": "npm run tslint && npm run eslint", "test": "karma start --single-run", diff --git a/tsconfig.json b/tsconfig.json index 03edd689..c06fc482 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,6 @@ { "compileOnSave": false, "compilerOptions": { - "sourceMap": true, - "declaration": false, "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true,