├── .github
└── workflows
│ └── publish.yml
├── .gitignore
├── .prettierrc
├── LICENSE
├── README.md
├── package.json
├── src
└── index.ts
├── tsconfig.json
├── tslint.json
└── yarn.lock
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Node.js Package
2 | on:
3 | push:
4 | tags:
5 | - '*'
6 | jobs:
7 | build:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/checkout@v2
11 | - uses: actions/setup-node@v1
12 | with:
13 | node-version: '12.x'
14 | registry-url: 'https://registry.npmjs.org'
15 | scope: '@panelbear'
16 | - run: yarn install
17 | - run: yarn build
18 | - run: yarn publish --access public
19 | env:
20 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # Next.js build output
79 | .next
80 |
81 | # Nuxt.js build / generate output
82 | .nuxt
83 | dist
84 |
85 | # Gatsby files
86 | .cache/
87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
88 | # https://nextjs.org/blog/next-9-1#public-directory-support
89 | # public
90 |
91 | # vuepress build output
92 | .vuepress/dist
93 |
94 | # Serverless directories
95 | .serverless/
96 |
97 | # FuseBox cache
98 | .fusebox/
99 |
100 | # DynamoDB Local files
101 | .dynamodb/
102 |
103 | # TernJS port file
104 | .tern-port
105 |
106 | # Editor stuff
107 | .idea
108 | .vscode
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "trailingComma": "all",
4 | "singleQuote": true
5 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Panelbear client (browser)
2 |
3 | A simple JavaScript library for [Panelbear Analytics](https://panelbear.com).
4 |
5 | ## Highlights
6 |
7 | - Just a thin wrapper around the Panelbear analytics script.
8 | - Integrates with most JS frameworks.
9 | - Typed (Typescript).
10 |
11 | ## Quickstart
12 |
13 | ### Install
14 |
15 | Run the following command to install in your project:
16 |
17 | ```
18 | npm install @panelbear/panelbear-js
19 | ```
20 |
21 | Or with yarn:
22 |
23 | ```
24 | yarn add @panelbear/panelbear-js
25 | ```
26 |
27 | ### Basic usage
28 |
29 | You can now import, and use the Panelbear client on your project.
30 |
31 | ```javascript
32 | import * as Panelbear from '@panelbear/panelbear-js';
33 |
34 | // Load the Panelbear tracker once in your app
35 | Panelbear.load('YOUR_SITE_ID');
36 |
37 | // This is how you record page views
38 | Panelbear.trackPageview();
39 |
40 | // You can also trigger custom events
41 | Panelbear.track('NewsletterSignup');
42 | ```
43 |
44 | ## Framework integrations
45 |
46 | - [Next.js](https://www.npmjs.com/package/@panelbear/panelbear-nextjs)
47 | - [Vuepress](https://www.npmjs.com/package/@panelbear/vuepress-plugin-panelbear)
48 | - [Gatsby](https://www.npmjs.com/package/gatsby-plugin-panelbear)
49 |
50 | ## Changelog
51 |
52 | ### 1.3.3
53 |
54 | - Handle error on bind queue to window when element with same name exists (eg. `
`).
55 |
56 | ### 1.3.2
57 |
58 | - Update docs.
59 |
60 | ### 1.3.1
61 |
62 | - Export config interface and event schema.
63 |
64 | ### 1.3.0
65 |
66 | - Update PanelbearConfig interface available fields.
67 | - Upgrade package dependencies.
68 | - Add interface docs.
69 |
70 | ### 1.2.0
71 |
72 | - Allow scriptSrc config option to load Panelbear script from own domain.
73 |
74 | ### 1.1.0
75 |
76 | - By default, load tracker with `autoTrack` set to `false`.
77 |
78 | ### 1.0.2
79 |
80 | - Initial open source release.
81 |
82 | ## Security Disclosure
83 |
84 | If you discover any issue regarding security, please disclose the information responsibly by following the instructions [here](https://panelbear.com/security/). Do NOT create a Issue on the GitHub repo.
85 |
86 | ## Contributors
87 |
88 | [@jondcallahan](https://github.com/jondcallahan)
89 |
90 | ## Contributing
91 |
92 | Please check for any existing issues before openning a new Issue. If you'd like to work on something, please open a new Issue describing what you'd like to do before submitting a Pull Request.
93 |
94 | ## License
95 |
96 | See [LICENSE](https://github.com/panelbearhq/panelbear-js/blob/master/LICENSE).
97 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@panelbear/panelbear-js",
3 | "version": "1.3.3",
4 | "description": "Official Panelbear client (browser)",
5 | "repository": {
6 | "type": "git",
7 | "url": "git+https://github.com/panelbearhq/panelbear-js.git"
8 | },
9 | "keywords": [
10 | "panelbear",
11 | "analytics"
12 | ],
13 | "author": "Anthony N. Simon ",
14 | "license": "Apache-2.0",
15 | "main": "./dist/index.js",
16 | "types": "./dist/index.d.ts",
17 | "files": [
18 | "dist/**/*"
19 | ],
20 | "scripts": {
21 | "build": "tsc --declaration",
22 | "fmt": "prettier --write \"src/**/*.ts\"",
23 | "lint": "tslint -p tsconfig.json"
24 | },
25 | "devDependencies": {
26 | "prettier": "^2.2.1",
27 | "tslint": "^6.1.3",
28 | "tslint-config-prettier": "^1.18.0",
29 | "typescript": "^4.0.5"
30 | },
31 | "bugs": {
32 | "url": "https://github.com/panelbearhq/panelbear-js/issues"
33 | },
34 | "homepage": "https://github.com/panelbearhq/panelbear-js#readme"
35 | }
36 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * The Panelbear script configuration object.
3 | */
4 | export interface PanelbearConfig {
5 | /**
6 | * The Site ID to report events for.
7 | */
8 | site?: string;
9 | /**
10 | * Debug mode allows events to be sent on localhost, and logs to console. Default: false.
11 | */
12 | debug?: boolean;
13 | /**
14 | * Enables or disables the tracking script. If disabled, no events are ever sent. Default: true.
15 | */
16 | enabled?: boolean;
17 | /**
18 | * Optionally define a function which modifies or skips events right before sending them to the analytics API.
19 | */
20 | beforeSend?: (payload: PanelbearEvent) => PanelbearEvent | undefined;
21 | /**
22 | * Override the analytics API where the events will be sent to.
23 | */
24 | analyticsHost?: string;
25 | /**
26 | * Override the analytics script source URL.
27 | */
28 | scriptSrc?: string;
29 | /**
30 | * Honor the Do-Not-Track (DNT) setting on the user's browser. Default: false.
31 | */
32 | honorDNT?: boolean;
33 | /**
34 | * Automatically track navigation changes. Default: true.
35 | */
36 | autoTrack?: boolean;
37 | /**
38 | * Tracking method for single-page apps. Default: 'history'.
39 | */
40 | spaMode?: 'history' | 'off';
41 | /**
42 | * Whether or not the URL fragment (hash part) should be reported. Default: false.
43 | */
44 | includeURLFragment?: boolean;
45 | }
46 |
47 | export interface PanelbearEvent {
48 | pid: string;
49 | event: string;
50 | url?: string;
51 | screen_width?: number;
52 | user_language?: string;
53 | timezone?: string;
54 | referrer?: string;
55 | utm_source?: string;
56 | utm_campaign?: string;
57 | utm_medium?: string;
58 | dns?: number;
59 | connect?: number;
60 | ssl?: number;
61 | ttfb?: number;
62 | download?: number;
63 | dom_content_loaded?: number;
64 | render?: number;
65 | page_load?: number;
66 | transfer_size?: number;
67 | connection_speed?: string;
68 | override_user_agent?: string;
69 | override_ip?: string;
70 | override_country_code?: string;
71 | }
72 |
73 | interface PanelbearInterpreter {
74 | (command: 'trackPageview'): void;
75 | (command: 'track', eventName: string): void;
76 | (command: 'config', config: PanelbearConfig): void;
77 | }
78 |
79 | declare global {
80 | interface Window {
81 | panelbear: PanelbearInterpreter;
82 | panelbearQ: PanelbearInterpreter[];
83 | }
84 | }
85 |
86 | const interpret: PanelbearInterpreter = (command: any, arg1?: any): void => {
87 | window.panelbear =
88 | window.panelbear ||
89 | function () {
90 | window.panelbearQ = window.panelbearQ || [];
91 | window.panelbearQ.push(arguments as any);
92 | };
93 |
94 | try {
95 | window.panelbear(command, arg1);
96 | } catch (e) {
97 | // tslint:disable-next-line:no-console
98 | console.warn('There was an error while executing a Panelbear command', e)
99 | }
100 | };
101 |
102 | export const load = (site: string, config?: PanelbearConfig): void => {
103 | const tracker = document.createElement('script');
104 | tracker.async = true;
105 | tracker.src = `${config?.scriptSrc ?? 'https://cdn.panelbear.com/analytics.js'}?site=${site}`;
106 | document.head.appendChild(tracker);
107 |
108 | interpret('config', {
109 | site: site,
110 | // Disable auto-track on the JS client. Most projects using this library need
111 | // more control over the event handlers.
112 | autoTrack: false,
113 | ...config,
114 | });
115 | };
116 |
117 | export const trackPageview = (): void => {
118 | interpret('trackPageview');
119 | };
120 |
121 | export const config = (config: PanelbearConfig): void => {
122 | interpret('config', config);
123 | };
124 |
125 | export const track = (eventName: string): void => {
126 | interpret('track', eventName);
127 | };
128 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */
4 |
5 | /* Basic Options */
6 | // "incremental": true, /* Enable incremental compilation */
7 | "target": "ES2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9 | // "lib": [], /* Specify library files to be included in the compilation. */
10 | // "allowJs": true, /* Allow javascript files to be compiled. */
11 | // "checkJs": true, /* Report errors in .js files. */
12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
13 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15 | "sourceMap": true, /* Generates corresponding '.map' file. */
16 | // "outFile": "./", /* Concatenate and emit output to single file. */
17 | "outDir": "./dist", /* Redirect output structure to the directory. */
18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
19 | // "composite": true, /* Enable project compilation */
20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
21 | // "removeComments": true, /* Do not emit comments to output. */
22 | // "noEmit": true, /* Do not emit outputs. */
23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
26 |
27 | /* Strict Type-Checking Options */
28 | "strict": true, /* Enable all strict type-checking options. */
29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
30 | // "strictNullChecks": true, /* Enable strict null checks. */
31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */
32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
36 |
37 | /* Additional Checks */
38 | // "noUnusedLocals": true, /* Report errors on unused locals. */
39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
42 |
43 | /* Module Resolution Options */
44 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
45 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
46 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
47 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
48 | // "typeRoots": [], /* List of folders to include type definitions from. */
49 | // "types": [], /* Type declaration files to be included in compilation. */
50 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
51 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
52 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
53 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
54 |
55 | /* Source Map Options */
56 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
58 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
59 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
60 |
61 | /* Experimental Options */
62 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
63 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
64 |
65 | /* Advanced Options */
66 | "skipLibCheck": true, /* Skip type checking of declaration files. */
67 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["tslint:recommended", "tslint-config-prettier"]
3 | }
--------------------------------------------------------------------------------
/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 | "@babel/code-frame@^7.0.0":
6 | version "7.14.5"
7 | resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb"
8 | integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==
9 | dependencies:
10 | "@babel/highlight" "^7.14.5"
11 |
12 | "@babel/helper-validator-identifier@^7.14.5":
13 | version "7.14.9"
14 | resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48"
15 | integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==
16 |
17 | "@babel/highlight@^7.14.5":
18 | version "7.14.5"
19 | resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9"
20 | integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==
21 | dependencies:
22 | "@babel/helper-validator-identifier" "^7.14.5"
23 | chalk "^2.0.0"
24 | js-tokens "^4.0.0"
25 |
26 | ansi-styles@^3.2.1:
27 | version "3.2.1"
28 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
29 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
30 | dependencies:
31 | color-convert "^1.9.0"
32 |
33 | argparse@^1.0.7:
34 | version "1.0.10"
35 | resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
36 | integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
37 | dependencies:
38 | sprintf-js "~1.0.2"
39 |
40 | balanced-match@^1.0.0:
41 | version "1.0.2"
42 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
43 | integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
44 |
45 | brace-expansion@^1.1.7:
46 | version "1.1.11"
47 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
48 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
49 | dependencies:
50 | balanced-match "^1.0.0"
51 | concat-map "0.0.1"
52 |
53 | builtin-modules@^1.1.1:
54 | version "1.1.1"
55 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
56 | integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
57 |
58 | chalk@^2.0.0, chalk@^2.3.0:
59 | version "2.4.2"
60 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
61 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
62 | dependencies:
63 | ansi-styles "^3.2.1"
64 | escape-string-regexp "^1.0.5"
65 | supports-color "^5.3.0"
66 |
67 | color-convert@^1.9.0:
68 | version "1.9.3"
69 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
70 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
71 | dependencies:
72 | color-name "1.1.3"
73 |
74 | color-name@1.1.3:
75 | version "1.1.3"
76 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
77 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
78 |
79 | commander@^2.12.1:
80 | version "2.20.3"
81 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
82 | integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
83 |
84 | concat-map@0.0.1:
85 | version "0.0.1"
86 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
87 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
88 |
89 | diff@^4.0.1:
90 | version "4.0.2"
91 | resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
92 | integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
93 |
94 | escape-string-regexp@^1.0.5:
95 | version "1.0.5"
96 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
97 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
98 |
99 | esprima@^4.0.0:
100 | version "4.0.1"
101 | resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
102 | integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
103 |
104 | fs.realpath@^1.0.0:
105 | version "1.0.0"
106 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
107 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
108 |
109 | function-bind@^1.1.1:
110 | version "1.1.1"
111 | resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
112 | integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
113 |
114 | glob@^7.1.1:
115 | version "7.1.7"
116 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
117 | integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==
118 | dependencies:
119 | fs.realpath "^1.0.0"
120 | inflight "^1.0.4"
121 | inherits "2"
122 | minimatch "^3.0.4"
123 | once "^1.3.0"
124 | path-is-absolute "^1.0.0"
125 |
126 | has-flag@^3.0.0:
127 | version "3.0.0"
128 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
129 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
130 |
131 | has@^1.0.3:
132 | version "1.0.3"
133 | resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
134 | integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
135 | dependencies:
136 | function-bind "^1.1.1"
137 |
138 | inflight@^1.0.4:
139 | version "1.0.6"
140 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
141 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
142 | dependencies:
143 | once "^1.3.0"
144 | wrappy "1"
145 |
146 | inherits@2:
147 | version "2.0.4"
148 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
149 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
150 |
151 | is-core-module@^2.2.0:
152 | version "2.6.0"
153 | resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19"
154 | integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==
155 | dependencies:
156 | has "^1.0.3"
157 |
158 | js-tokens@^4.0.0:
159 | version "4.0.0"
160 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
161 | integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
162 |
163 | js-yaml@^3.13.1:
164 | version "3.14.1"
165 | resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
166 | integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
167 | dependencies:
168 | argparse "^1.0.7"
169 | esprima "^4.0.0"
170 |
171 | minimatch@^3.0.4:
172 | version "3.0.4"
173 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
174 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
175 | dependencies:
176 | brace-expansion "^1.1.7"
177 |
178 | minimist@^1.2.5:
179 | version "1.2.5"
180 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
181 | integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
182 |
183 | mkdirp@^0.5.3:
184 | version "0.5.5"
185 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
186 | integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
187 | dependencies:
188 | minimist "^1.2.5"
189 |
190 | once@^1.3.0:
191 | version "1.4.0"
192 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
193 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
194 | dependencies:
195 | wrappy "1"
196 |
197 | path-is-absolute@^1.0.0:
198 | version "1.0.1"
199 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
200 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
201 |
202 | path-parse@^1.0.6:
203 | version "1.0.7"
204 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
205 | integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
206 |
207 | prettier@^2.2.1:
208 | version "2.4.0"
209 | resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.0.tgz#85bdfe0f70c3e777cf13a4ffff39713ca6f64cba"
210 | integrity sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==
211 |
212 | resolve@^1.3.2:
213 | version "1.20.0"
214 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
215 | integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
216 | dependencies:
217 | is-core-module "^2.2.0"
218 | path-parse "^1.0.6"
219 |
220 | semver@^5.3.0:
221 | version "5.7.1"
222 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
223 | integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
224 |
225 | sprintf-js@~1.0.2:
226 | version "1.0.3"
227 | resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
228 | integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
229 |
230 | supports-color@^5.3.0:
231 | version "5.5.0"
232 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
233 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
234 | dependencies:
235 | has-flag "^3.0.0"
236 |
237 | tslib@^1.13.0, tslib@^1.8.1:
238 | version "1.14.1"
239 | resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
240 | integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
241 |
242 | tslint-config-prettier@^1.18.0:
243 | version "1.18.0"
244 | resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37"
245 | integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==
246 |
247 | tslint@^6.1.3:
248 | version "6.1.3"
249 | resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.3.tgz#5c23b2eccc32487d5523bd3a470e9aa31789d904"
250 | integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==
251 | dependencies:
252 | "@babel/code-frame" "^7.0.0"
253 | builtin-modules "^1.1.1"
254 | chalk "^2.3.0"
255 | commander "^2.12.1"
256 | diff "^4.0.1"
257 | glob "^7.1.1"
258 | js-yaml "^3.13.1"
259 | minimatch "^3.0.4"
260 | mkdirp "^0.5.3"
261 | resolve "^1.3.2"
262 | semver "^5.3.0"
263 | tslib "^1.13.0"
264 | tsutils "^2.29.0"
265 |
266 | tsutils@^2.29.0:
267 | version "2.29.0"
268 | resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
269 | integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
270 | dependencies:
271 | tslib "^1.8.1"
272 |
273 | typescript@^4.0.5:
274 | version "4.4.2"
275 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
276 | integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
277 |
278 | wrappy@1:
279 | version "1.0.2"
280 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
281 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
282 |
--------------------------------------------------------------------------------