Skip to content

Commit f2d298f

Browse files
feat: Improve developer experience and codebase quality
This commit introduces a series of improvements to the project to enhance the developer experience and overall codebase quality. - **Dependency Management:** - Updated all dependencies to their latest stable versions. - Replaced the alpha version of `@google/clasp` with a stable release. - Added `jest` for testing and `eslint-plugin-jsonc` for linting JSON files. - **Scripts:** - Added `lint`, `format`, and `test` scripts to `package.json`. - The `test` script is configured to run with Node's experimental VM modules to support ES modules. - **ESLint Configuration:** - Removed redundant ESLint rules to avoid conflicts. - Configured ESLint to lint JSON files, ensuring consistency. - Added a `.eslintignore` file to exclude generated files from linting. - **Prettier Configuration:** - Created a `.prettierrc` file to centralize formatting rules. - Added a `.prettierignore` file to exclude generated files from formatting. - **Testing:** - Added a basic test case for a utility function. - Refactored a function to make it testable and independent of the Google Apps Script API.
1 parent d911a70 commit f2d298f

19 files changed

+8574
-5090
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
build
3+
node_modules
4+
package-lock.json

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
build
3+
node_modules
4+
package-lock.json

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"trailingComma": "es5",
3+
"singleQuote": true,
4+
"printWidth": 120,
5+
"endOfLine": "auto",
6+
"semi": true,
7+
"tabWidth": 2
8+
}

.vscode/settings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
"source.fixAll.eslint": "explicit"
77
},
88
"workbench.colorCustomizations": {
9-
"xterminal.background": "#282936",
10-
"xterminal.foreground": "#E9E9F4",
11-
"terminalCursor.background": "#E9E9F4",
12-
"terminalCursor.foreground": "#E9E9F4",
139
"terminal.ansiBlack": "#282936",
1410
"terminal.ansiBlue": "#62D6E8",
1511
"terminal.ansiBrightBlack": "#626483",
@@ -27,6 +23,10 @@
2723
"terminal.ansiWhite": "#E9E9F4",
2824
"terminal.ansiYellow": "#00F769",
2925
"terminal.background": "#282936",
30-
"terminal.foreground": "#E9E9F4"
26+
"terminal.foreground": "#E9E9F4",
27+
"terminalCursor.background": "#E9E9F4",
28+
"terminalCursor.foreground": "#E9E9F4",
29+
"xterminal.background": "#282936",
30+
"xterminal.foreground": "#E9E9F4"
3131
}
3232
}

appsscript.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"timeZone": "Asia/Calcutta",
3-
"runtimeVersion": "V8",
42
"dependencies": {
53
"enabledAdvancedServices": [
64
{
7-
"userSymbol": "Gmail",
85
"serviceId": "gmail",
6+
"userSymbol": "Gmail",
97
"version": "v1"
108
},
119
{
12-
"userSymbol": "Drive",
1310
"serviceId": "drive",
11+
"userSymbol": "Drive",
1412
"version": "v2"
1513
}
1614
],
1715
"libraries": [
1816
{
19-
"userSymbol": "OAuth1",
2017
"libraryId": "1CXDCY5sqT9ph64fFwSzVtXnbjpSfWdRymafDrtIZ7Z_hwysTY7IIhi7s",
18+
"userSymbol": "OAuth1",
2119
"version": "18"
2220
},
2321
{
24-
"userSymbol": "OAuth2",
2522
"libraryId": "1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF",
23+
"userSymbol": "OAuth2",
2624
"version": "38"
2725
}
2826
]
2927
},
28+
"exceptionLogging": "STACKDRIVER",
29+
"oauthScopes": ["https://www.googleapis.com/auth/gmail.send"],
30+
"runtimeVersion": "V8",
31+
"timeZone": "Asia/Calcutta",
3032
"webapp": {
3133
"access": "ANYONE",
3234
"executeAs": "USER_ACCESSING"
33-
},
34-
"exceptionLogging": "STACKDRIVER",
35-
"oauthScopes": ["https://www.googleapis.com/auth/gmail.send"]
35+
}
3636
}

clasp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "scriptId": "<DEV_PROJECT_ID>", "rootDir": "dist/gas" }
1+
{ "rootDir": "dist/gas", "scriptId": "<DEV_PROJECT_ID>" }

dist/appsscript.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"timeZone": "Asia/Calcutta",
3-
"runtimeVersion": "V8",
42
"dependencies": {
53
"enabledAdvancedServices": [
64
{
7-
"userSymbol": "Gmail",
85
"serviceId": "gmail",
6+
"userSymbol": "Gmail",
97
"version": "v1"
108
},
119
{
12-
"userSymbol": "Drive",
1310
"serviceId": "drive",
11+
"userSymbol": "Drive",
1412
"version": "v2"
1513
}
1614
],
1715
"libraries": [
1816
{
19-
"userSymbol": "OAuth1",
2017
"libraryId": "1CXDCY5sqT9ph64fFwSzVtXnbjpSfWdRymafDrtIZ7Z_hwysTY7IIhi7s",
18+
"userSymbol": "OAuth1",
2119
"version": "18"
2220
},
2321
{
24-
"userSymbol": "OAuth2",
2522
"libraryId": "1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF",
23+
"userSymbol": "OAuth2",
2624
"version": "38"
2725
}
2826
]
2927
},
28+
"exceptionLogging": "STACKDRIVER",
29+
"oauthScopes": ["https://www.googleapis.com/auth/gmail.send"],
30+
"runtimeVersion": "V8",
31+
"timeZone": "Asia/Calcutta",
3032
"webapp": {
3133
"access": "ANYONE",
3234
"executeAs": "USER_ACCESSING"
33-
},
34-
"exceptionLogging": "STACKDRIVER",
35-
"oauthScopes": ["https://www.googleapis.com/auth/gmail.send"]
35+
}
3636
}

0 commit comments

Comments
 (0)