Skip to content

Commit 6a77b43

Browse files
Merge pull request #14 from bootgs/max/next
update
2 parents f2df1b9 + e6b9d5a commit 6a77b43

File tree

21 files changed

+1059
-805
lines changed

21 files changed

+1059
-805
lines changed

.husky/pre-commit

100644100755
Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,3 @@
11
#!/bin/bash
22

3-
# Переходим в корневой каталог репозитория
4-
cd "$(git rev-parse --show-toplevel)" || exit 1
5-
6-
# Проверка на наличие node_modules
7-
echo "[plugin husky:pre-commit]: Checking for node_modules..."
8-
if [ ! -d "node_modules" ]; then
9-
echo " ✗ Error: Missing node_modules. Please run 'npm install' first."
10-
exit 1
11-
fi
12-
echo " ✓ Done."
13-
echo "" # Добавляем пустую строку для лучшей читаемости
14-
15-
# 1. Запуск аудита безопасности
16-
echo "[plugin husky:pre-commit]: Running npm audit..."
17-
npm audit --audit-level=high
18-
if [ $? -ne 0 ]; then
19-
echo " ✗ Error: npm audit failed."
20-
exit 1
21-
fi
22-
echo " ✓ Done."
23-
echo ""
24-
25-
# 2. Проверка типов TypeScript без компиляции
26-
echo "[plugin husky:pre-commit]: Running tsc..."
27-
tsc --noEmit
28-
if [ $? -ne 0 ]; then
29-
echo " ✗ Error: TypeScript check failed."
30-
exit 1
31-
fi
32-
echo " ✓ Done."
33-
echo ""
34-
35-
# 3. Линтинг и форматирование
36-
echo "[plugin husky:pre-commit]: Running lint..."
37-
npm run lint
38-
if [ $? -ne 0 ]; then
39-
echo " ✗ Error: Linting failed."
40-
exit 1
41-
fi
42-
echo " ✓ Done."
43-
echo ""
44-
45-
echo "[plugin husky:pre-commit]: Running format..."
46-
npm run format
47-
if [ $? -ne 0 ]; then
48-
echo " ✗ Error: Formatting failed."
49-
exit 1
50-
fi
51-
echo " ✓ Done."
52-
echo ""
53-
54-
echo "[plugin husky:pre-commit]: All checks passed successfully."
55-
exit 0
3+
bash ./sctipts/pre-commit.sh

.husky/pre-push

100644100755
Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,3 @@
11
#!/bin/bash
22

3-
# Переходим в корневой каталог репозитория
4-
cd "$(git rev-parse --show-toplevel)" || exit 1
5-
6-
# Проверка на наличие node_modules
7-
echo "[plugin husky:pre-push]: Checking for node_modules..."
8-
if [ ! -d "node_modules" ]; then
9-
echo " ✗ Error: Missing node_modules. Please run 'npm install' first."
10-
exit 1
11-
fi
12-
echo " ✓ Done."
13-
echo "" # Добавляем пустую строку для лучшей читаемости
14-
15-
# 1. Запуск аудита безопасности
16-
echo "[plugin husky:pre-push]: Running npm audit..."
17-
npm audit --audit-level=high
18-
if [ $? -ne 0 ]; then
19-
echo " ✗ Error: npm audit failed."
20-
exit 1
21-
fi
22-
echo " ✓ Done."
23-
echo ""
24-
25-
# 2. Проверка типов TypeScript без компиляции
26-
echo "[plugin husky:pre-push]: Running tsc..."
27-
tsc --noEmit
28-
if [ $? -ne 0 ]; then
29-
echo " ✗ Error: TypeScript check failed."
30-
exit 1
31-
fi
32-
echo " ✓ Done."
33-
echo ""
34-
35-
# 3. Линтинг и форматирование
36-
echo "[plugin husky:pre-push]: Running lint..."
37-
npm run lint
38-
if [ $? -ne 0 ]; then
39-
echo " ✗ Error: Linting failed."
40-
exit 1
41-
fi
42-
echo " ✓ Done."
43-
echo ""
44-
45-
echo "[plugin husky:pre-push]: Running format..."
46-
npm run format
47-
if [ $? -ne 0 ]; then
48-
echo " ✗ Error: Formatting failed."
49-
exit 1
50-
fi
51-
echo " ✓ Done."
52-
echo ""
53-
54-
echo "[plugin husky:pre-push]: Running test..."
55-
npm run test
56-
if [ $? -ne 0 ]; then
57-
echo " ✗ Error: Test failed."
58-
exit 1
59-
fi
60-
echo " ✓ Done."
61-
echo ""
62-
63-
echo "[plugin husky:pre-push]: All checks passed successfully."
64-
exit 0
3+
bash ./sctipts/pre-push.sh

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/appsscript-boot.iml renamed to .idea/apps-script-boot.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,37 @@
33
![Project banner for Google Apps Script Boot Framework](docs/assets/google-apps-script-boot-author-MaksymStoianov-artist-DarynaMikhailenko.JPG)
44

55
<p align="right">
6-
<i>Artist: <a href="https://darynamikhailenko.com/?utm_source=github&utm_medium=readme&utm_campaign=appsscript-boot&utm_content=banner-artist-credit" title="Portfolio of Daryna Mikhailenko, the artist">Daryna Mikhailenko</a></i>
6+
<i>Artist: <a href="https://darynamikhailenko.com/?utm_source=github&utm_medium=readme&utm_campaign=apps-script-boot&utm_content=banner-artist-credit" title="Portfolio of Daryna Mikhailenko, the artist">Daryna Mikhailenko</a></i>
77
</p>
88

99
# Boot Framework for Google Apps Script™ projects
1010

1111
[![Built%20with-clasp](https://img.shields.io/badge/Built%20with-clasp-4285f4.svg)](https://github.com/google/clasp)
12-
[![License](https://img.shields.io/github/license/MaksymStoianov/appsscript-boot?label=License)](LICENSE)
13-
[![Latest release](https://img.shields.io/github/v/release/MaksymStoianov/appsscript-boot?label=Release)](https://github.com/MaksymStoianov/appsscript-boot/releases)
12+
[![License](https://img.shields.io/github/license/bootgs/boot?label=License)](LICENSE)
13+
[![Latest release](https://img.shields.io/github/v/release/bootgs/boot?label=Release)](https://github.com/bootgs/boot/releases)
1414

15-
[![GitHub Stars](https://img.shields.io/github/stars/MaksymStoianov/appsscript-boot?style=social)](https://github.com/MaksymStoianov/appsscript-boot/stargazers)
16-
[![GitHub Fork](https://img.shields.io/github/forks/MaksymStoianov/appsscript-boot?style=social)](https://github.com/MaksymStoianov/appsscript-boot/forks)
15+
[![GitHub Stars](https://img.shields.io/github/stars/bootgs/boot?style=social)](https://github.com/bootgs/boot/stargazers)
16+
[![GitHub Fork](https://img.shields.io/github/forks/bootgs/boot?style=social)](https://github.com/bootgs/boot/forks)
1717
[![GitHub Sponsors](https://img.shields.io/github/sponsors/MaksymStoianov?style=social&logo=github)](https://github.com/sponsors/MaksymStoianov)
1818

1919
## Introduction
2020

21-
`appsscript-boot` is a powerful, scalable, and modern framework for building high-performance Google Apps Script
22-
applications.
21+
**Boot.gs** is a powerful, scalable, and modern framework for building high-performance Google Apps Script applications.
2322

2423
## How to Install
2524

2625
To get started, install the dependencies:
2726

2827
```bash
29-
npm install github:MaksymStoianov/appsscript-boot#main
28+
npm install github:bootgs/boot#main
3029
```
3130

3231
> **Note:** It's recommended to use tags (`#vX.Y.Z`) for production environments to ensure version stability.
3332
3433
For example:
3534

3635
```bash
37-
npm install github:MaksymStoianov/appsscript-boot#v1.1.0
36+
npm install github:bootgs/boot#v1.1.0
3837
```
3938

4039
## How to Use
@@ -44,18 +43,18 @@ npm install github:MaksymStoianov/appsscript-boot#v1.1.0
4443
Define a REST controller that will handle HTTP requests to your Apps Script web application:
4544

4645
```TypeScript
47-
import {Get, RestController} from "appsscript-boot";
46+
import {Get, RestController} from "boot";
4847

4948
@RestController("api/sheet")
5049
export class Sheet {
51-
@Get("active-range")
52-
getActiveRange(): string {
53-
return "This action return active range.";
54-
}
50+
@Get("active-range")
51+
getActiveRange(): string {
52+
return "This action return active range.";
53+
}
5554
}
5655
```
5756

58-
This code is a great example of using the `appsscript-boot` framework to build a **web app on Google Apps Script** with
57+
This code is a great example of using the **Boot.gs** framework to build a **web app on Google Apps Script** with
5958
a **REST API** architecture. Essentially, it turns your standard Apps Script code into a full-fledged web application
6059
that can handle and respond to HTTP requests (GET and POST).
6160

@@ -68,14 +67,14 @@ build a
6867
more complex application with multiple API endpoints, you'd have to write a lot of manual routing logic. This can
6968
quickly become clunky and difficult to manage.
7069

71-
`appsscript-boot` solves this problem by providing decorators (`@RestController`, `@Get`) and automated routing. This
70+
**Boot.gs** solves this problem by providing decorators (`@RestController`, `@Get`) and automated routing. This
7271
allows
7372
you to structure your code in a way that is common in modern web frameworks like Express.js or NestJS.
7473

7574
The result is code that is more organized, readable, and scalable.
7675

7776
```TypeScript
78-
import {App, Newable, Get, RestController} from "appsscript-boot";
77+
import {App, Newable, Get, RestController} from "boot";
7978

8079
/**
8180
* This JSDoc comment describes the `doGet` function.
@@ -86,22 +85,22 @@ import {App, Newable, Get, RestController} from "appsscript-boot";
8685
*/
8786
// The `doGet` function is a mandatory entry point for web app GET requests.
8887
export function doGet(event: GoogleAppsScript.Events.DoGet) {
89-
// Defines an array of controllers that the application will use.
90-
// In this case, only the `Sheet` class is used.
91-
const controllers: Newable[] = [Sheet];
92-
93-
// Defines an array of providers (services) that will be available for injection.
94-
// There are no providers in this example.
95-
const providers: Newable[] = [];
96-
97-
// Creates an application instance, passing it the list of controllers and providers.
98-
const app = App.create({
99-
controllers,
100-
providers
101-
});
102-
103-
// Delegates the processing of the GET request to the created application instance.
104-
return app.doGet(event);
88+
// Defines an array of controllers that the application will use.
89+
// In this case, only the `Sheet` class is used.
90+
const controllers: Newable[] = [Sheet];
91+
92+
// Defines an array of providers (services) that will be available for injection.
93+
// There are no providers in this example.
94+
const providers: Newable[] = [];
95+
96+
// Creates an application instance, passing it the list of controllers and providers.
97+
const app = App.create({
98+
controllers,
99+
providers
100+
});
101+
102+
// Delegates the processing of the GET request to the created application instance.
103+
return app.doGet(event);
105104
}
106105

107106
/**
@@ -113,20 +112,20 @@ export function doGet(event: GoogleAppsScript.Events.DoGet) {
113112
*/
114113
// The `doPost` function is the entry point for web app POST requests.
115114
export function doPost(event: GoogleAppsScript.Events.DoPost) {
116-
// Defines controllers for POST requests (same logic as for `doGet`).
117-
const controllers: Newable[] = [Sheet];
115+
// Defines controllers for POST requests (same logic as for `doGet`).
116+
const controllers: Newable[] = [Sheet];
118117

119-
// Defines providers (none here).
120-
const providers: Newable[] = [];
118+
// Defines providers (none here).
119+
const providers: Newable[] = [];
121120

122-
// Creates an application instance.
123-
const app = App.create({
124-
controllers,
125-
providers
126-
});
121+
// Creates an application instance.
122+
const app = App.create({
123+
controllers,
124+
providers
125+
});
127126

128-
// Delegates the processing of the POST request to the application.
129-
return app.doPost(event);
127+
// Delegates the processing of the POST request to the application.
128+
return app.doPost(event);
130129
}
131130

132131
/**
@@ -136,18 +135,18 @@ export function doPost(event: GoogleAppsScript.Events.DoPost) {
136135
// The `@RestController` decorator declares this class as a controller and sets the base path to "api/sheet".
137136
@RestController("api/sheet")
138137
export class Sheet {
139-
/**
140-
* This JSDoc comment describes the `getActiveRange` method.
141-
* It is a handler for a GET request.
142-
*/
143-
// The `@Get` decorator marks this method as a GET request handler and sets the endpoint path to "active-range".
144-
// The full path to this endpoint will be "api/sheet/active-range".
145-
@Get("active-range")
146-
// The method signature: it takes no arguments and returns a string.
147-
getActiveRange(): string {
148-
// The return value of the method.
149-
return "This action return active range.";
150-
}
138+
/**
139+
* This JSDoc comment describes the `getActiveRange` method.
140+
* It is a handler for a GET request.
141+
*/
142+
// The `@Get` decorator marks this method as a GET request handler and sets the endpoint path to "active-range".
143+
// The full path to this endpoint will be "api/sheet/active-range".
144+
@Get("active-range")
145+
// The method signature: it takes no arguments and returns a string.
146+
getActiveRange(): string {
147+
// The return value of the method.
148+
return "This action return active range.";
149+
}
151150
}
152151
```
153152

@@ -272,4 +271,4 @@ This project is licensed under the [LICENSE](LICENSE) file.
272271

273272
---
274273

275-
**Like this project?** [Star our awesome repo »](https://github.com/MaksymStoianov/appsscript-boot)
274+
**Like this project?** [Star our awesome repo »](https://github.com/bootgs/boot)

config/typescript/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
"allowUnreachableCode": false,
2727
"allowUnusedLabels": false,
2828
"composite": false,
29-
"baseUrl": "../.."
29+
"baseUrl": "../..",
30+
"paths": {
31+
"src/*": ["../../src/*"]
32+
}
3033
},
3134
"include": ["../../src/**/*", "../../test/**/*"],
3235
"exclude": ["../../node_modules", "../../dist"]

config/typescript/tsconfig.node.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
"noUnusedLocals": false,
1919
"noUnusedParameters": false,
2020
"noFallthroughCasesInSwitch": true,
21-
"noUncheckedSideEffectImports": true
21+
"noUncheckedSideEffectImports": true,
22+
"baseUrl": "../..",
23+
"paths": {
24+
"src/*": ["../../src/*"]
25+
}
2226
},
2327
"include": ["../../config/**/*", "../../vite.config.ts"],
2428
"exclude": ["../../node_modules", "../../dist"]

0 commit comments

Comments
 (0)