diff --git a/.gitignore b/.gitignore index 25d819f..53326af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,74 +1,247 @@ -# Logs -logs +# Created by https://www.gitignore.io/api/vue,vim,git,node,code,nuxt,xcode,vuejs,linux,macos,kotlin,windows,android,angular,flutter,webstorm,firebase,reactnative,objective-c,androidstudio +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/settings.json +!.vscode/tasks.json +!/gradle/wrapper/gradle-wrapper.jar +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 +!gradle-wrapper.jar +$RECYCLE.BIN/ +**/android/**/GeneratedPluginRegistrant.java +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/doc/api/ +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.symlinks/ +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Runner/GeneratedPluginRegistrant.* +**/ios/ServiceDefinitions.json +**/xcshareddata/WorkspaceSettings.xcsettings +*-debug.log* +*-error.log* +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*.aab +*.ap_ +*.apk +*.class +*.ctxt +*.dSYM +*.dSYM.zip +*.dex +*.ear +*.hmap +*.iml +*.ipa +*.ipr +*.iws +*.jar +*.jks +*.keystore +*.lcov +*.lnk *.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids +*.mode1v3 +*.mode2v3 +*.moved-aside +*.nar +*.orig +*.pbxuser +*.perspectivev3 *.pid -*.seed *.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +*.rar +*.rs.bk +*.seed +*.stackdump +*.swp +*.tar.gz +*.tgz +*.tsbuildinfo +*.war +*.xccheckout +*.xcodeproj/* +*.xcscmblueprint +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt +*google-services.json +*secrets* +*~ +.AppleDB +.AppleDesktop +.AppleDouble +.DS_Store* +.DocumentRevisions-V100 +.LSOverride +.Spotlight-V100 +.TemporaryItems +.Trash-* +.Trashes +.VolumeIcon.icns +._* +.apdisk +.buckconfig.local +.buckd/ +.buckversion +.cache +.cargo-ok +.classpath +.com.apple.timemachine.donotpresent +.cproject +.dart_tool/ +.directory +.dynamodb/ +.env +.env.* +.eslintcache +.expo +.externalNativeBuild +.fakebuckversion +.firebase +.firebaserc +.flutter-plugins +.flutter-plugins +.fseventsd +.fuse_hidden* +.fusebox/ +.gradle/ +.gradletasknamecache .grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration +.idea +.idea_modules/ .lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history +.mtj.tmp/ +.navigation/ +.netrwhist +.next +.nfs* .node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file +.npm +.npmrc +.nuxt +.nyc_output +.packages +.project +.pub-cache/ +.pub/ +.rpt2_cache +.runtimeconfig.json +.sass-cache +.serverless/ +.settings/ +.signing/ +.tern-port +.vscode/* +.vuepress/dist .yarn-integrity +/*.gcno +Cargo.lock +Carthage/Build +DerivedData/ +Icon +Network Trash Folder +Release/ +Session.vim +Sessionx.vim +Temporary Items +Thumbs.db +Thumbs.db:encryptable +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]*.un~ +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] +[Dd]esktop.ini +__generated__ +atlassian-ide-plugin.xml +bin/ +bower_components +buck-out/ +build/ +captures/ +cmake-build-*/ +com_crashlytics_export_strings.xml +connect.lock +coverage/ +crashlytics-build.properties +crashlytics.properties +dist/ +docs/_book +ehthumbs.db +ehthumbs_vista.db +fabric.properties +fastlane/Preview.html +fastlane/readme.md +fastlane/report.xml +fastlane/screenshots +fastlane/screenshots/**/*.png +fastlane/test_output +freeline.py +freeline/ +freeline_project_description.json +gen-external-apklibs +gen/ +gradle-app.setting +hs_err_pid* +iOSInjectionProject/ +jspm_packages/ +lib-cov +lint/generated/ +lint/intermediates/ +lint/outputs/ +lint/tmp/ +local.properties +logs +node_modules +now-secrets.json +out/ +output.json +pids +proguard/ +release/ +report.*.json +tmp/ +vcs.xml +xcuserdata/ +# End -# dotenv environment variables file -.env - -# next.js build output -.next - -# Compiled lib -es5 -es6 - -# OS -.DS_Store - -# Temp file -*.swp -*~ -report.*.json diff --git a/.npmignore b/.npmignore index 7ec5283..c571d2e 100644 --- a/.npmignore +++ b/.npmignore @@ -1,14 +1,260 @@ -.ackrc +# Created by https://www.gitignore.io/api/vue,vim,git,node,code,nuxt,xcode,vuejs,linux,macos,kotlin,windows,android,angular,flutter,webstorm,firebase,reactnative,objective-c,androidstudio +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/settings.json +!.vscode/tasks.json +!/gradle/wrapper/gradle-wrapper.jar +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 +!gradle-wrapper.jar +$RECYCLE.BIN/ +**/android/**/GeneratedPluginRegistrant.java +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/doc/api/ +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.symlinks/ +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Runner/GeneratedPluginRegistrant.* +**/ios/ServiceDefinitions.json +**/xcshareddata/WorkspaceSettings.xcsettings +*-debug.log* +*-error.log* +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*.aab +*.ap_ +*.apk +*.class +*.ctxt +*.dSYM +*.dSYM.zip +*.dex +*.ear +*.hmap +*.iml +*.ipa +*.ipr +*.iws +*.jar +*.jks +*.keystore +*.lcov +*.lnk +*.log +*.mode1v3 +*.mode2v3 +*.moved-aside +*.nar +*.orig +*.pbxuser +*.perspectivev3 +*.pid +*.pid.lock +*.rar +*.rs.bk +*.seed +*.stackdump +*.swp +*.tar.gz +*.tgz +*.tsbuildinfo +*.war +*.xccheckout +*.xcodeproj/* +*.xcscmblueprint +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt +*google-services.json +*secrets* +*~ +.AppleDB +.AppleDesktop +.AppleDouble +.DS_Store* +.DocumentRevisions-V100 +.LSOverride +.Spotlight-V100 +.TemporaryItems +.Trash-* +.Trashes +.VolumeIcon.icns +._* +.apdisk +.buckconfig.local +.buckd/ +.buckversion +.cache +.cargo-ok +.classpath +.com.apple.timemachine.donotpresent +.cproject +.dart_tool/ +.directory +.dynamodb/ +.env +.env.* +.eslintcache +.expo +.externalNativeBuild +.fakebuckversion +.firebase +.firebaserc +.flutter-plugins +.flutter-plugins +.fseventsd +.fuse_hidden* +.fusebox/ +.gradle/ +.gradletasknamecache +.grunt +.idea +.idea_modules/ +.lock-wscript +.mtj.tmp/ +.navigation/ +.netrwhist +.next +.nfs* +.node_repl_history +.npm +.npmrc +.nuxt +.nyc_output +.packages +.project +.pub-cache/ +.pub/ +.rpt2_cache +.runtimeconfig.json +.sass-cache +.serverless/ +.settings/ +.signing/ +.tern-port +.vscode/* +.vuepress/dist +.yarn-integrity +/*.gcno +Cargo.lock +Carthage/Build +DerivedData/ +Icon +Network Trash Folder +Release/ +Session.vim +Sessionx.vim +Temporary Items +Thumbs.db +Thumbs.db:encryptable +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]*.un~ +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] +[Dd]esktop.ini +__generated__ +atlassian-ide-plugin.xml +bin/ +bower_components +buck-out/ +build/ +captures/ +cmake-build-*/ +com_crashlytics_export_strings.xml +connect.lock +coverage/ +crashlytics-build.properties +crashlytics.properties +dist/ +docs/_book +ehthumbs.db +ehthumbs_vista.db +fabric.properties +fastlane/Preview.html +fastlane/readme.md +fastlane/report.xml +fastlane/screenshots +fastlane/screenshots/**/*.png +fastlane/test_output +freeline.py +freeline/ +freeline_project_description.json +gen-external-apklibs +gen/ +gradle-app.setting +hs_err_pid* +iOSInjectionProject/ +jspm_packages/ +lib-cov +lint/generated/ +lint/intermediates/ +lint/outputs/ +lint/tmp/ +local.properties +logs +node_modules +now-secrets.json +out/ +output.json +pids +proguard/ +release/ +report.*.json +tmp/ +vcs.xml +xcuserdata/ +# End + +# Additional to .gitignore +!dist/ +!out/ +*.config.js +*.config.ts +*.md +.*ignore +.*rc .gitignore -.npmignore .travis.yml -coverage +now*.json src -jest.config.js -prettier.config.js -report.*.json -tsconfig.es5.json -tsconfig.es6.json -tsconfig.json -tsconfig.test.json +tsconfig*.json tslint.json diff --git a/.travis.yml b/.travis.yml index 14e9556..76c4d24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,5 @@ node_js: - "10" - "9" - "8" - - "7" - - "6" -after_success: yarn test:coverage:report +after_success: npm run test:coverage:report diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000..7c15085 --- /dev/null +++ b/.yarnrc @@ -0,0 +1,2 @@ +"--install.ignore-engines" true +ignore-engines true diff --git a/jest.config.js b/jest.config.js index f2acdbd..7614c73 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,15 +1,15 @@ module.exports = { globals: { 'ts-jest': { - tsConfig: 'tsconfig.test.json', + tsConfig: 'tsconfig.json', }, }, moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'], moduleNameMapper: { - '^_src/(.*)': '/src/$1', + '^src/(.*)': '/src/$1', }, testEnvironment: 'node', - testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', + testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(t|j)sx?$', transform: { '^.+\\.tsx?$': 'ts-jest', }, diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..89b72b2 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationDir": "lib", + "declarationMap": true, + "emitDecoratorMetadata": true, + "importHelpers": true, + "noEmit": false, + "noEmitHelpers": true, + "preserveConstEnums": true, + "removeComments": true, + "sourceMap": true + }, + "exclude": ["node_modules", "src/**/*.test.ts"] +} diff --git a/tsconfig.es5.json b/tsconfig.es5.json deleted file mode 100644 index d7b765f..0000000 --- a/tsconfig.es5.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "declarationDir": "es5", - "outDir": "es5", - "target": "es5" - } -} diff --git a/tsconfig.json b/tsconfig.json index 47b1e8f..59a3179 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,39 +1,37 @@ { "compilerOptions": { - "allowJs": false, - "allowSyntheticDefaultImports": false, "alwaysStrict": true, "baseUrl": ".", - "checkJs": false, - "declaration": true, - "declarationDir": "lib", "diagnostics": true, + "esModuleInterop": true, + "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, - "lib": ["dom", "es5", "es6", "es2015", "es7", "es2016", "es2017"], - "listEmittedFiles": true, - "listFiles": true, + "lib": ["esnext"], "module": "commonjs", "moduleResolution": "node", - "noEmit": false, + "noEmit": true, "noErrorTruncation": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, + "noStrictGenericChecks": false, "noUnusedLocals": true, "noUnusedParameters": true, - "outDir": "lib", "paths": { - "_src/*": ["src/*"] + "src/*": ["src/*"] }, - "removeComments": true, "resolveJsonModule": true, + "rootDir": "src", "skipLibCheck": true, - "sourceMap": true, "strict": true, - "target": "es6", - "typeRoots": ["node_modules/@types", "src/@types"] + "strictBindCallApply": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "suppressExcessPropertyErrors": false, + "suppressImplicitAnyIndexErrors": false, + "target": "esnext" }, - "include": ["node_modules/@types", "src/**/*"], - "exclude": ["node_modules", "src/**/*.test.ts"] + "include": ["src/**/*.ts"] } diff --git a/tsconfig.module.json b/tsconfig.module.json new file mode 100644 index 0000000..b3f74b0 --- /dev/null +++ b/tsconfig.module.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "outDir": "lib", + "declarationDir": "lib", + "tsBuildInfoFile": "lib/tsconfig.module.tsbuildinfo", + "lib": ["esnext"], + "target": "es2017", + "module": "es6" + } +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..a691a15 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "outDir": "dist/node", + "declarationDir": "dist/node", + "lib": ["es2017"], + "target": "es2017", + "module": "commonjs" + } +} diff --git a/tsconfig.test.json b/tsconfig.test.json deleted file mode 100644 index 327ce69..0000000 --- a/tsconfig.test.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "target": "es2016", - "lib": ["dom", "es2015", "es2016", "es2017"] - }, - "exclude": ["node_modules"] -}