@movalib/movalib-commons 1.0.8 → 1.0.10

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/dist/MovaLogin.js CHANGED
@@ -55,8 +55,8 @@ var react_1 = require("react");
55
55
  var lab_1 = require("@mui/lab");
56
56
  var logo_large_png_1 = __importDefault(require("./assets/images/logo/logo_large.png"));
57
57
  var logo_pro_large_png_1 = __importDefault(require("./assets/images/logo/logo_pro_large.png"));
58
- var leaf_green_large_png_1 = __importDefault(require("./assets/images/logo/leaf_green_large.png"));
59
- var leaf_pink_large_png_1 = __importDefault(require("./assets/images/logo/leaf_pink_large.png"));
58
+ var leaf_green_large_png_1 = __importDefault(require("./assets/images/leaf_green_large.png"));
59
+ var leaf_pink_large_png_1 = __importDefault(require("./assets/images/leaf_pink_large.png"));
60
60
  var material_1 = require("@mui/material");
61
61
  var MovaCopyright_1 = __importDefault(require("./MovaCopyright"));
62
62
  var Enums_1 = require("./helpers/Enums");
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.0.8",
4
- "description": "",
3
+ "version": "1.0.10",
4
+ "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "private": false,
8
+ "files": [
9
+ "dist"
10
+ ],
8
11
  "scripts": {
9
- "build": "tsc",
12
+ "build": "tsc && npm run copy-assets",
13
+ "copy-assets": "cp -r src/assets/ dist/assets/",
10
14
  "test": "echo \"Error: no test specified\" && exit 1",
11
15
  "clean": "rm -rf dist node_modules package-lock.json"
12
16
  },
@@ -29,6 +33,8 @@
29
33
  "@mui/material": "^5.13.5",
30
34
  "@mui/icons-material": "^5.11.16",
31
35
  "@mui/lab": "^5.0.0-alpha.134",
36
+ "@emotion/react": "^11.11.1",
37
+ "@emotion/styled": "^11.11.0",
32
38
  "@types/react": "^18.2.22",
33
39
  "@types/react-dom": "^18.2.7",
34
40
  "typescript": "^4.9.5"
package/PV_README.md DELETED
@@ -1,15 +0,0 @@
1
- # 1. build this movalib commons lib
2
-
3
- ### `npm build`
4
-
5
- # 2. publish this movalib commons lib (public)
6
-
7
- ### `npm login`
8
- ### `npm publish --access=public`
9
-
10
- # 3. publish this movalib commons lib (private)
11
-
12
- Make shure that "private=true" in your package.json
13
-
14
- ### `npm login`
15
- ### `npm publish --access=restricted`
@@ -1,17 +0,0 @@
1
- import React, { FunctionComponent } from "react";
2
- import { Link, Typography } from "@mui/material";
3
-
4
- function MovaCopyright(props: any) {
5
- return (
6
- <Typography variant="body2" color="text.secondary" align="center" {...props}>
7
- {'Copyright © '}
8
- <Link color="inherit" href="https://www.movalib.com">
9
- Movalib.com
10
- </Link>{' '}
11
- {new Date().getFullYear()}
12
- {'.'}
13
- </Typography>
14
- );
15
- }
16
-
17
- export default MovaCopyright;
package/src/MovaLogin.tsx DELETED
@@ -1,195 +0,0 @@
1
- import { CSSProperties, FormEvent, FunctionComponent, useState } from "react";
2
- import { LoadingButton } from '@mui/lab';
3
- import LogoLarge from './assets/images/logo/logo_large.png';
4
- import LogoProLarge from './assets/images/logo/logo_pro_large.png';
5
- import GreenLeafImage from './assets/images/logo/leaf_green_large.png';
6
- import PinkLeafImage from './assets/images/logo/leaf_pink_large.png';
7
- import { Alert, Box, Checkbox, Container, CssBaseline, FormControlLabel, Grid, Link, TextField } from "@mui/material";
8
- import MovaCopyright from "./MovaCopyright";
9
- import { MovaLoginForm, MovaFormField } from "./helpers/Types";
10
- import { MovaAppType } from "./helpers/Enums";
11
- import { validateEmail } from "./helpers/Validator";
12
-
13
- // Permet de centrer le contenu de l'application
14
- const styles: CSSProperties = {
15
- display: 'flex',
16
- justifyContent: 'center',
17
- alignItems: 'center',
18
- height: '100vh', // Ajustez la hauteur en fonction de vos besoins
19
- };
20
-
21
- const initialFormState = {
22
- email: { value: '', isValid: true },
23
- password: { value: '', isValid: true },
24
- };
25
-
26
- interface MovaLoginProps {
27
- movaAppType: MovaAppType | "GARAGE" | "USER" | "ADMIN",
28
- onSubmit: (form: MovaLoginForm) => void,
29
- loading?: boolean
30
- }
31
-
32
- const MovaLogin: FunctionComponent<MovaLoginProps> = ({ loading, movaAppType, onSubmit }) => {
33
-
34
- const [form, setForm] = useState<MovaLoginForm>(initialFormState);
35
- const [message, setMessage] = useState<string>("");
36
- //const [loading, setLoading] = useState(false);
37
-
38
- const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>): void => {
39
- const fieldName: string = e.target.name;
40
- const fieldValue: string = e.target.value;
41
- const newField: MovaFormField = { [fieldName]: { value: fieldValue, isValid: true } };
42
-
43
- setForm({ ...form, ...newField});
44
- }
45
-
46
- const handleSubmit = async (e: FormEvent) => {
47
- e.preventDefault();
48
- try {
49
- if(validateForm() && onSubmit) {
50
- // Si le formulaire est valide, on appel la function callback transmise en props
51
- onSubmit(form);
52
- }
53
-
54
- }catch (error){
55
- console.error('Error occurred during submission:', error);
56
- }
57
- }
58
-
59
- const validateForm = () => {
60
- let newForm: MovaLoginForm = form;
61
-
62
- // Validator email
63
- if(!validateEmail(form.email.value.length)) {
64
- const errorMsg: string = 'Adresse email invalide';
65
- const newField: MovaFormField = { value: form.email.value, error: errorMsg, isValid: false };
66
- newForm = { ...newForm, ...{ email: newField } };
67
- } else {
68
- const newField: MovaFormField = { value: form.email.value, error: '', isValid: true };
69
- newForm = { ...newForm, ...{ email: newField } };
70
- }
71
-
72
- // Validator password
73
- if(form.password.value.length < 8) {
74
- const errorMsg: string = 'Votre mot de passe doit faire au moins 8 caractères de long.';
75
- const newField: MovaFormField = {value: form.password.value, error: errorMsg, isValid: false};
76
- newForm = { ...newForm, ...{ password: newField } };
77
- } else {
78
- const newField: MovaFormField = { value: form.password.value, error: '', isValid: true };
79
- newForm = { ...newForm, ...{ password: newField } };
80
- }
81
-
82
- setForm(newForm);
83
-
84
- return newForm.email.isValid && newForm.password.isValid;
85
- }
86
-
87
- const getMovaLogo = () => {
88
-
89
- return movaAppType === MovaAppType.GARAGE ? LogoProLarge :
90
- movaAppType === MovaAppType.USER ? LogoLarge :
91
- movaAppType === MovaAppType.ADMIN ? LogoLarge : LogoLarge;
92
- }
93
-
94
-
95
- return (
96
- <div style={styles}>
97
- <img src={GreenLeafImage} style={{position: 'fixed',
98
- float:'left',
99
- width: '250px',
100
- height: '400px',
101
- top: '-20%',
102
- left: '3%',
103
- opacity: '0.3',
104
- zIndex: -8}} alt='Feuille Verte Movalib'></img>
105
-
106
- <Container component="main" maxWidth="xs">
107
- <CssBaseline />
108
- <Box
109
- sx={{
110
- marginTop: 6,
111
- display: 'flex',
112
- flexDirection: 'column',
113
- alignItems: 'center',
114
- }}
115
- >
116
- <img src={getMovaLogo()} style={{width:'80%'}}/>
117
- <br />
118
- </Box>
119
-
120
- <Box component="form" onSubmit={handleSubmit} noValidate sx={{ mt: 1 }}>
121
- <TextField
122
- margin="normal"
123
- required
124
- fullWidth
125
- id="email"
126
- label="Adresse email"
127
- name="email"
128
- autoComplete="email"
129
- autoFocus
130
- onChange={e => handleInputChange(e)}
131
- value={form.email.value}
132
- error={!form.email.isValid}
133
- helperText={form.email.error}
134
- />
135
- <TextField
136
- margin="normal"
137
- required
138
- fullWidth
139
- name="password"
140
- label="Mot de passe"
141
- type="password"
142
- id="password"
143
- autoComplete="current-password"
144
- onChange={e => handleInputChange(e)}
145
- value={form.password.value}
146
- error={!form.password.isValid}
147
- helperText={form.password.error}
148
- />
149
- <FormControlLabel control={<Checkbox value="remember" color="primary" />}
150
- label="Se souvenir de moi"
151
- />
152
- {/* <MyLoadingButton
153
- type={ButtonType.SUBMIT}
154
- label="Se connecter" /> */}
155
-
156
- <LoadingButton
157
- loading={loading}
158
- type="submit"
159
- fullWidth
160
- variant="contained"
161
- sx={{ mt: 3, mb: 2 }}>
162
- <span>Se connecter</span>
163
- </LoadingButton>
164
-
165
- {message && <Alert severity="error" sx={{ mb: 2 }}>{message}</Alert>}
166
-
167
- <Grid container>
168
- <Grid item xs>
169
- <Link href="#" variant="body2" color="text.secondary">
170
- Mot de passe oublié ?
171
- </Link>
172
- </Grid>
173
- <Grid item>
174
- <Link href="#" variant="body2" color="text.secondary">
175
- {"Créer un compte"}
176
- </Link>
177
- </Grid>
178
- </Grid>
179
- </Box>
180
- <MovaCopyright sx={{ mt: 8, mb: 4 }} />
181
- </Container>
182
-
183
- <img src={PinkLeafImage} style={{position: 'fixed',
184
- float:'right',
185
- width: '250px',
186
- height: '400px',
187
- bottom: '-20%',
188
- right: '3%',
189
- opacity: '0.3',
190
- zIndex: '-10'}} alt='Feuille Rose Movalib'></img>
191
- </div>
192
- );
193
- };
194
-
195
- export default MovaLogin;
@@ -1,65 +0,0 @@
1
- // MovaSnackbar.tsx
2
- import React, { FunctionComponent } from 'react';
3
- import { Snackbar, Alert, IconButton, SnackbarCloseReason } from '@mui/material';
4
- import CloseIcon from '@mui/icons-material/CloseRounded';
5
-
6
- interface MovaSnackbarProps {
7
- snackbar: {
8
- open: boolean;
9
- message: string;
10
- severity: 'success' | 'info' | 'warning' | 'error' | undefined;
11
- };
12
- setSnackbar: (snackbar: {
13
- open: boolean;
14
- message: string;
15
- severity: 'success' | 'info' | 'warning' | 'error' | undefined;
16
- }) => void;
17
- }
18
-
19
- const MovaSnackbar: FunctionComponent<MovaSnackbarProps> = ({ snackbar, setSnackbar }) => {
20
-
21
- /**
22
- * Gestion de la fermeture de la snackbar. Si la raison de cette fermeture est
23
- * un clic en dehors de la zone de contenu on intercepte et annule la fermeture 'clickaway'.
24
- * @param event Evénnement de fermeture
25
- * @param reason Origine de l'événnement de fermeture
26
- * @returns
27
- */
28
- const handleClose = (event: globalThis.Event | React.SyntheticEvent<any, globalThis.Event>,
29
- reason: SnackbarCloseReason) => {
30
-
31
- if (reason === 'clickaway') return;
32
-
33
- setSnackbar({ open: false, message: '', severity: undefined });
34
- };
35
-
36
- const handleCloseAlert = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
37
- setSnackbar({ open: false, message: '', severity: undefined });
38
- };
39
-
40
- return (
41
- <Snackbar open={snackbar.open} autoHideDuration={5000} onClose={handleClose}>
42
- <Alert severity={snackbar.severity} variant="filled" sx={{ width: '100%' }}
43
- action={
44
- <>
45
- {/* TODO : possiblité d'annuler l'action qui vient d'avoir lieu */}
46
- {/* <Button color="inherit" size="small" onClick={handleCancelAction}>
47
- Annuler
48
- </Button> */}
49
- <IconButton
50
- size="small"
51
- aria-label="close"
52
- color="inherit"
53
- onClick={handleCloseAlert}
54
- >
55
- <CloseIcon fontSize="small" />
56
- </IconButton>
57
- </>
58
- }>
59
- {snackbar.message}
60
- </Alert>
61
- </Snackbar>
62
- );
63
- };
64
-
65
- export default MovaSnackbar;
@@ -1,12 +0,0 @@
1
- // src/Button.tsx
2
- import React from 'react';
3
-
4
- interface TestButtonProps {
5
- label: string;
6
- }
7
-
8
- const TestButton: React.FC<TestButtonProps> = ({ label }) => {
9
- return <button>{label}</button>;
10
- };
11
-
12
- export default TestButton;
@@ -1,38 +0,0 @@
1
-
2
- export enum MovaAppType {
3
- /**
4
- * Application Garagiste
5
- */
6
- GARAGE = "GARAGE",
7
- /**
8
- * Application Utilisateur (automobiliste)
9
- */
10
- USER = "USER",
11
- /**
12
- * Application Administrateur (MovaTeam)
13
- */
14
- ADMIN = "ADMIN"
15
- }
16
-
17
- export enum RoleType {
18
- /**
19
- * Client du centre auto (automobiliste)
20
- */
21
- CUSTOMER = "CUSTOMER",
22
- /**
23
- * Technicien du centre auto
24
- */
25
- TECHNICIAN = "GARAGE_LEADER",
26
- /**
27
- * Chef d'atelier
28
- */
29
- GARAGE_LEADER = "GARAGE_LEADER",
30
- /**
31
- * Administrateur du centre auto (propriétaire ou dirigeant)
32
- */
33
- GARAGE_ADMIN = "ADMINISTRATOR",
34
- /**
35
- * Super-Administrateur (team Movalib)
36
- */
37
- MOVALIB_ADMIN = "MOVALIB_ADMIN",
38
- }
@@ -1 +0,0 @@
1
- export {}
@@ -1,11 +0,0 @@
1
-
2
- export type MovaLoginForm = {
3
- email: MovaFormField,
4
- password: MovaFormField
5
- }
6
-
7
- export type MovaFormField = {
8
- value?: any,
9
- error?: string,
10
- isValid?: boolean
11
- }
@@ -1,57 +0,0 @@
1
- /**
2
- * Un email valide
3
- */
4
- const emailRegex:RegExp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
5
-
6
- /**
7
- * Un mot de passe qui contient au moins une majuscule, une minuscule, un chiffre
8
- * et un caractère spécial. La longueur du mot de passe doit être d'au moins 8 caractères.
9
- */
10
- const passwordRegex:RegExp = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
11
-
12
- /**
13
- * Un numéro de téléphone (10 chiffres)
14
- */
15
- const phoneNumberRegex:RegExp = /^\d{0,10}$/;
16
-
17
- /**
18
- * Un code postal (5 chiffres)
19
- */
20
- const postalCodeRegex:RegExp = /^\d{5}$/;
21
-
22
- /**
23
- * Une URL valide
24
- */
25
- const urlRegex:RegExp =/^(ftp|http|https):\/\/[^ "]+$/;
26
-
27
- /**
28
- * Un nom pouvant contenir des lettres, chiffres d'une taille comprise entre 3 et 20 caractères
29
- */
30
- const userNameRegex:RegExp = /^[a-z0-9_-]{3,20}$/;
31
-
32
- /**
33
- * Un texte pouvant contenir des lettres, chiffres et quelques caractères spéciaux
34
- */
35
- const textRegex:RegExp = /^[a-zA-Z0-9\s.,!?'"()+=-_-éèçà]+$/;
36
-
37
-
38
- export function validatePhoneNumber(phoneNumber: string) : boolean {
39
- if (phoneNumber === null || phoneNumber === undefined) {
40
- return false;
41
- }
42
- return phoneNumberRegex.test(phoneNumber);
43
- }
44
-
45
- export function validateText(text: string) : boolean {
46
- if (text === null || text === undefined) {
47
- return false;
48
- }
49
- return textRegex.test(text);
50
- }
51
-
52
- export function validateEmail(email: string) : boolean {
53
- if (email === null || email === undefined) {
54
- return false;
55
- }
56
- return emailRegex.test(email);
57
- }
package/src/index.ts DELETED
@@ -1,20 +0,0 @@
1
- // src/index.ts
2
-
3
- // Export des composants
4
- export { default as TestButton } from './TestButton';
5
- export { default as MovaSnackbar } from './MovaSnackbar';
6
- export { default as MovaLogin } from './MovaLogin';
7
- export { default as MovaCopyright } from './MovaCopyright';
8
-
9
- // Export des classes
10
- export { default as User } from './models/User';
11
- export { default as Role } from './models/Role';
12
- export { default as Address } from './models/Address';
13
-
14
- // Export des types
15
- export type { MovaFormField } from './helpers/Types';
16
- export type { MovaLoginForm } from './helpers/Types';
17
-
18
- // Export des enums
19
- export { RoleType } from './helpers/Enums';
20
- export { MovaAppType } from './helpers/Enums';
@@ -1,28 +0,0 @@
1
- export default class Address {
2
-
3
- id: string; // UUID
4
- streetName: string; // Street number & name
5
- postalCode: string; // Postal code
6
- cityName: string; // City name
7
- country: string; // Country name
8
- countryCode: string; // Country ISO code
9
- additional?: string; // Additional address information (optional)
10
-
11
- constructor(
12
- id: string,
13
- streetName: string,
14
- postalCode: string,
15
- cityName: string,
16
- country: string,
17
- countryCode: string,
18
- additional?: string
19
- ) {
20
- this.id = id;
21
- this.streetName = streetName;
22
- this.postalCode = postalCode;
23
- this.cityName = cityName;
24
- this.country = country;
25
- this.countryCode = countryCode;
26
- this.additional = additional;
27
- }
28
- }
@@ -1,16 +0,0 @@
1
- export default class Role {
2
-
3
- id:string;
4
- isActive: boolean;
5
- authorizations: string[];
6
-
7
- constructor(
8
- id:string,
9
- isActive: boolean = true,
10
- authorizations: string[]
11
- ) {
12
- this.id = id;
13
- this.isActive = isActive;
14
- this.authorizations = authorizations;
15
- }
16
- }
@@ -1,59 +0,0 @@
1
- import { RoleType } from "../helpers/Enums";
2
- import Address from './Address';
3
-
4
- export default class User {
5
-
6
- // Properties
7
- id: string;
8
- roles: string[];
9
- firstname: string;
10
- lastname: string;
11
- avatar: string;
12
- email: string;
13
- password: string;
14
- created: Date;
15
- addresses? : Address[]
16
- phoneNumber?: string;
17
-
18
- constructor(
19
- id: string,
20
- roles: string[],
21
- firstname: string = '',
22
- lastname: string = '',
23
- avatar: string = '',
24
- email: string = '',
25
- password: string = '',
26
- created: Date = new Date(),
27
- addresses?: Address[],
28
- phoneNumber?: string
29
- ) {
30
- this.id = id;
31
- this.roles = roles;
32
- this.firstname = firstname;
33
- this.lastname = lastname;
34
- this.avatar = avatar;
35
- this.email = email;
36
- this.password = password;
37
- this.created = created;
38
- this.addresses = addresses;
39
- this.phoneNumber = phoneNumber;
40
- }
41
-
42
- static getFirstLetter = (user: User) : string => {
43
-
44
- const firstLetter = user.lastname[0].toUpperCase();
45
- return /[0-9]/.test(firstLetter) ? '0-9' : firstLetter;
46
- }
47
-
48
- static isCustomer = (user: User) : boolean => {
49
- if(!user || !user.roles) return false;
50
-
51
- return Boolean(user.roles.find(r => r = RoleType.CUSTOMER));
52
- }
53
-
54
- static isTechnician = (user: User) : boolean => {
55
- if(!user || !user.roles) return false;
56
-
57
- return Boolean(user.roles.find(r => r = RoleType.TECHNICIAN));
58
- }
59
- }
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
package/tsconfig.json DELETED
@@ -1,114 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- "lib": [
16
- "dom",
17
- "dom.iterable",
18
- "esnext"
19
- ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
20
- "jsx": "react-jsx", /* Specify what JSX code is generated. */
21
- // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
22
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
23
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
24
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
25
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
26
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
27
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
28
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
29
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
30
-
31
- /* Modules */
32
- "module": "CommonJS", /* Specify what module code is generated. */
33
- // "rootDir": "./", /* Specify the root folder within your source files. */
34
- "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
35
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
36
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
37
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
38
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
39
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
40
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
41
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
42
- // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
43
- // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
44
- // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
45
- // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
46
- "resolveJsonModule": true, /* Enable importing .json files. */
47
- // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
48
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
49
-
50
- /* JavaScript Support */
51
- "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
52
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
53
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
54
-
55
- /* Emit */
56
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
57
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
58
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
59
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
60
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
62
- "outDir": "./dist", /* Specify an output folder for all emitted files. */
63
- // "removeComments": true, /* Disable emitting comments. */
64
- //"noEmit": true, /* Disable emitting files from a compilation. */
65
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
66
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
67
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
68
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
69
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
70
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
71
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
72
- // "newLine": "crlf", /* Set the newline character for emitting files. */
73
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
74
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
75
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
76
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
77
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
78
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
79
-
80
- /* Interop Constraints */
81
- "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
82
- // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
83
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
84
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
85
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
86
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
87
-
88
- /* Type Checking */
89
- "strict": true, /* Enable all strict type-checking options. */
90
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
91
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
92
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
93
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
94
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
95
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
96
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
97
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
98
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
99
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
100
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
101
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
102
- "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
103
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
104
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
105
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
106
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
107
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
108
-
109
- /* Completeness */
110
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
111
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
112
- },
113
- "include": ["src"]
114
- }
File without changes
File without changes