@monkvision/typescript-config 4.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Samy Ouyahia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @monkvision/typescript-config
2
+ This package provides the TSConfigs used in MonkJs Typescript projects. It also exports useful type declarations for
3
+ compiling.
4
+
5
+ # Install
6
+ To install the project simply run the following command :
7
+
8
+ ```shell
9
+ yarn add -D typescript @monkvision/typescript-config
10
+ ```
11
+
12
+ # How to use
13
+ To use one of the Typescript config exported by this package, place the following code in your `tsconfig.json` :
14
+
15
+ ```json
16
+ {
17
+ "extends": "@monkvision/typescript-config/tsconfig.json",
18
+ "include": ["src", "test"]
19
+ }
20
+ ```
21
+
22
+ You can replace `tsconfig.json` by the name of the config file you want to use.
23
+
24
+ We also recommend using a second tsconfig file used for building your sources using the command
25
+ `tsc -p tsconfig.build.json`. The build file will specify the outDir and exclude the test files like this :
26
+
27
+ ```json
28
+ {
29
+ "extends": "./tsconfig.json",
30
+ "compilerOptions": {
31
+ "outDir": "dist"
32
+ },
33
+ "exclude": ["test"]
34
+ }
35
+ ```
36
+
37
+ # Available configs
38
+ Here is a list of available Typescript config files exported by this project :
39
+
40
+ | Name | Usage |
41
+ |------------------------------|----------------------------------------------|
42
+ | `tsconfig.json` | Base configuration for TypeScript projects |
43
+ | `tsconfig.react.json` | Base configuration for React projects |
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@monkvision/typescript-config",
3
+ "packageManager": "yarn@3.2.4",
4
+ "version": "4.0.7",
5
+ "description": "The TSConfigs used in MonkJs TypeScript projects",
6
+ "author": "monkvision",
7
+ "license": "BSD-3-Clause-Clear",
8
+ "files": [
9
+ "tsconfig.json",
10
+ "tsconfig.react.json",
11
+ "tsconfig.react-native.json",
12
+ "types.d.ts",
13
+ "LICENSE",
14
+ "README.md"
15
+ ],
16
+ "types": "./types.d.ts",
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/monkvision/monkjs.git"
23
+ },
24
+ "keywords": [
25
+ "monkvision",
26
+ "config",
27
+ "typescript",
28
+ "tsconfig"
29
+ ],
30
+ "bugs": {
31
+ "url": "https://github.com/monkvision/monkjs/issues"
32
+ },
33
+ "homepage": "https://github.com/monkvision/monkjs",
34
+ "gitHead": "f132e4e5bc390aa304e25a05f3f72f5e1dca6b13"
35
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Base",
4
+ "compileOnSave": false,
5
+ "compilerOptions": {
6
+ "allowJs": true,
7
+ "allowUnreachableCode": false,
8
+ "allowUnusedLabels": false,
9
+ "allowSyntheticDefaultImports": true,
10
+ "alwaysStrict": true,
11
+ "declaration": true,
12
+ "esModuleInterop": true,
13
+ "exactOptionalPropertyTypes": false,
14
+ "forceConsistentCasingInFileNames": false,
15
+ "lib": ["esnext"],
16
+ "module": "commonjs",
17
+ "moduleResolution": "node",
18
+ "noFallthroughCasesInSwitch": true,
19
+ "noImplicitAny": true,
20
+ "noImplicitOverride": true,
21
+ "noImplicitReturns": true,
22
+ "noImplicitThis": true,
23
+ "noPropertyAccessFromIndexSignature": true,
24
+ "noUncheckedIndexedAccess": false,
25
+ "resolveJsonModule": true,
26
+ "sourceMap": true,
27
+ "skipLibCheck": false,
28
+ "strict": true,
29
+ "strictBindCallApply": true,
30
+ "strictFunctionTypes": true,
31
+ "strictNullChecks": true,
32
+ "strictPropertyInitialization": true,
33
+ "target": "esnext",
34
+ "types": ["jest", "node", "@monkvision/typescript-config"],
35
+ "useUnknownInCatchVariables": true
36
+ }
37
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "target": "es5",
5
+ "lib": [
6
+ "dom",
7
+ "dom.iterable",
8
+ "esnext"
9
+ ],
10
+ "isolatedModules": true,
11
+ "jsx": "react-jsx",
12
+ "module": "commonjs",
13
+ "skipLibCheck": true
14
+ },
15
+ "include": ["src"],
16
+ "exclude": ["node_modules", "**/*.spec.ts"]
17
+ }
package/types.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ declare module '*.svg' {
2
+ import React = require('react');
3
+ export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
4
+ const src: string;
5
+ export default src;
6
+ }
7
+
8
+ // Network Information API
9
+ declare interface Navigator extends NavigatorNetworkInformation {}
10
+ declare interface WorkerNavigator extends NavigatorNetworkInformation {}
11
+ declare interface NavigatorNetworkInformation {
12
+ readonly connection?: NetworkInformation;
13
+ }
14
+ type Megabit = number;
15
+ type Millisecond = number;
16
+ type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';
17
+ type ConnectionType =
18
+ | 'bluetooth'
19
+ | 'cellular'
20
+ | 'ethernet'
21
+ | 'mixed'
22
+ | 'none'
23
+ | 'other'
24
+ | 'unknown'
25
+ | 'wifi'
26
+ | 'wimax';
27
+ interface NetworkInformation extends EventTarget {
28
+ readonly type?: ConnectionType;
29
+ readonly effectiveType?: EffectiveConnectionType;
30
+ readonly downlinkMax?: Megabit;
31
+ readonly downlink?: Megabit;
32
+ readonly rtt?: Millisecond;
33
+ readonly saveData?: boolean;
34
+ }