@churchapps/helpers 1.1.8 → 1.1.9
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/.eslintrc.json +29 -0
- package/.github/FUNDING.yml +1 -1
- package/.prettierrc +11 -11
- package/.yarnrc.yml +6 -0
- package/CLAUDE.md +97 -89
- package/LICENSE +21 -21
- package/README.md +15 -15
- package/dist/interfaces/Donation.d.ts +14 -0
- package/dist/interfaces/Donation.d.ts.map +1 -1
- package/dist/interfaces/Donation.js.map +1 -1
- package/package.json +55 -54
- package/scripts/build-cjs.js +32 -32
- package/src/ApiHelper.ts +176 -176
- package/src/AppearanceHelper.ts +69 -69
- package/src/ArrayHelper.ts +157 -157
- package/src/CommonEnvironmentHelper.ts +104 -104
- package/src/CurrencyHelper.ts +10 -10
- package/src/DateHelper.ts +153 -153
- package/src/DonationHelper.ts +26 -26
- package/src/ErrorHelper.ts +39 -39
- package/src/EventHelper.ts +49 -49
- package/src/FileHelper.ts +55 -55
- package/src/PersonHelper.ts +82 -82
- package/src/UniqueIdHelper.ts +36 -36
- package/src/UserHelper.ts +59 -59
- package/src/index.ts +15 -15
- package/src/interfaces/Access.ts +138 -138
- package/src/interfaces/Attendance.ts +45 -45
- package/src/interfaces/Content.ts +84 -84
- package/src/interfaces/Doing.ts +93 -93
- package/src/interfaces/Donation.ts +198 -183
- package/src/interfaces/Error.ts +17 -17
- package/src/interfaces/Membership.ts +184 -184
- package/src/interfaces/Messaging.ts +96 -96
- package/src/interfaces/Permissions.ts +92 -92
- package/src/interfaces/Reporting.ts +41 -41
- package/src/interfaces/UserContextInterface.ts +13 -13
- package/src/interfaces/index.ts +13 -13
- package/tsconfig.json +36 -36
- package/eslint.config.js +0 -33
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"ecmaVersion": 2020,
|
|
6
|
+
"sourceType": "module"
|
|
7
|
+
},
|
|
8
|
+
"plugins": [
|
|
9
|
+
"@typescript-eslint"
|
|
10
|
+
],
|
|
11
|
+
"extends": [
|
|
12
|
+
"eslint:recommended",
|
|
13
|
+
"plugin:@typescript-eslint/recommended"
|
|
14
|
+
],
|
|
15
|
+
"rules": {
|
|
16
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
17
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
18
|
+
"no-unused-vars": "off",
|
|
19
|
+
"prefer-const": "error",
|
|
20
|
+
"no-console": "warn",
|
|
21
|
+
"comma-dangle": ["error", "never"],
|
|
22
|
+
"object-curly-newline": ["error", { "multiline": true, "consistent": true }],
|
|
23
|
+
"array-bracket-newline": ["error", "consistent"]
|
|
24
|
+
},
|
|
25
|
+
"ignorePatterns": [
|
|
26
|
+
"dist/**",
|
|
27
|
+
"node_modules/**"
|
|
28
|
+
]
|
|
29
|
+
}
|
package/.github/FUNDING.yml
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
github: [ChurchApps]
|
|
1
|
+
github: [ChurchApps]
|
package/.prettierrc
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"trailingComma": "none",
|
|
3
|
-
"printWidth": 120,
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"useTabs": false,
|
|
6
|
-
"semi": true,
|
|
7
|
-
"singleQuote": false,
|
|
8
|
-
"quoteProps": "as-needed",
|
|
9
|
-
"bracketSpacing": true,
|
|
10
|
-
"bracketSameLine": false,
|
|
11
|
-
"arrowParens": "avoid"
|
|
1
|
+
{
|
|
2
|
+
"trailingComma": "none",
|
|
3
|
+
"printWidth": 120,
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": false,
|
|
8
|
+
"quoteProps": "as-needed",
|
|
9
|
+
"bracketSpacing": true,
|
|
10
|
+
"bracketSameLine": false,
|
|
11
|
+
"arrowParens": "avoid"
|
|
12
12
|
}
|
package/.yarnrc.yml
ADDED
package/CLAUDE.md
CHANGED
|
@@ -1,90 +1,98 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
This is the `@churchapps/helpers` package - a foundational TypeScript library providing framework-agnostic utilities, interfaces, and helper classes for ChurchApps church management applications. It serves as the core dependency for other ChurchApps packages (ApiHelper, AppHelper, MobileHelper).
|
|
8
|
-
|
|
9
|
-
## Development Commands
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
###
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
This is the `@churchapps/helpers` package - a foundational TypeScript library providing framework-agnostic utilities, interfaces, and helper classes for ChurchApps church management applications. It serves as the core dependency for other ChurchApps packages (ApiHelper, AppHelper, MobileHelper).
|
|
8
|
+
|
|
9
|
+
## Development Commands
|
|
10
|
+
|
|
11
|
+
**This project uses Yarn exclusively. npm is disabled to prevent script execution vulnerabilities.**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn clean # Remove dist folder
|
|
15
|
+
yarn tsc # TypeScript compilation only
|
|
16
|
+
yarn build # Full build (clean + tsc)
|
|
17
|
+
yarn lint # ESLint check
|
|
18
|
+
yarn lint:fix # ESLint with auto-fix
|
|
19
|
+
yarn format # Prettier formatting
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Local Development Workflow
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# After making changes:
|
|
26
|
+
yarn build
|
|
27
|
+
yarn link
|
|
28
|
+
|
|
29
|
+
# In consuming project:
|
|
30
|
+
yarn link @churchapps/helpers
|
|
31
|
+
|
|
32
|
+
# After further changes, repeat build + link cycle
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Publishing
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# 1. Update version in package.json
|
|
39
|
+
# 2. Build and publish:
|
|
40
|
+
yarn build
|
|
41
|
+
yarn publish --access=public
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Security Notes
|
|
45
|
+
|
|
46
|
+
- Script execution is disabled by default in `.yarnrc.yml`
|
|
47
|
+
- Only whitelisted packages can run install scripts
|
|
48
|
+
- npm is disabled via `.npmrc` with `engine-strict=true`
|
|
49
|
+
|
|
50
|
+
## Architecture
|
|
51
|
+
|
|
52
|
+
### Core Structure
|
|
53
|
+
|
|
54
|
+
The package follows a static utility class pattern with comprehensive TypeScript interfaces:
|
|
55
|
+
|
|
56
|
+
- **Helper Classes**: Static utility classes (`ApiHelper`, `DateHelper`, `ArrayHelper`, etc.)
|
|
57
|
+
- **Interfaces**: Church management domain models organized by feature area
|
|
58
|
+
- **Zero Runtime Dependencies**: Framework-agnostic with minimal external deps
|
|
59
|
+
|
|
60
|
+
### Key Helper Categories
|
|
61
|
+
|
|
62
|
+
1. **ApiHelper**: Multi-API HTTP client with JWT auth for ChurchApps microservices
|
|
63
|
+
2. **Data Helpers**: Array manipulation, date/time processing, currency formatting
|
|
64
|
+
3. **User Management**: Multi-church user sessions, permissions, person data
|
|
65
|
+
4. **Business Logic**: Donation processing, file uploads, appearance theming
|
|
66
|
+
5. **System Utilities**: Error handling, environment config, unique ID generation
|
|
67
|
+
|
|
68
|
+
### Interface Organization
|
|
69
|
+
|
|
70
|
+
Interfaces in `src/interfaces/` are grouped by domain:
|
|
71
|
+
- **Access**: Authentication, users, churches, roles, permissions
|
|
72
|
+
- **Membership**: People, groups, households, forms, campus management
|
|
73
|
+
- **Content**: Sermons, playlists, streaming, events
|
|
74
|
+
- **Donation**: Financial transactions, Stripe integration
|
|
75
|
+
- **Attendance**: Service tracking
|
|
76
|
+
- **Messaging**: Communication interfaces
|
|
77
|
+
- **Reporting**: Data analysis interfaces
|
|
78
|
+
|
|
79
|
+
### TypeScript Configuration
|
|
80
|
+
|
|
81
|
+
- Target: ES2020 with CommonJS modules
|
|
82
|
+
- Declaration files generated (`.d.ts`)
|
|
83
|
+
- Strict mode disabled for flexibility
|
|
84
|
+
- Supports React JSX and DOM types
|
|
85
|
+
|
|
86
|
+
### Key Dependencies
|
|
87
|
+
|
|
88
|
+
- `date-fns` & `dayjs`: Date manipulation
|
|
89
|
+
- `rrule`: Recurring event rules
|
|
90
|
+
- `react-ga4`: Analytics (peer dependency pattern)
|
|
91
|
+
|
|
92
|
+
## Important Patterns
|
|
93
|
+
|
|
94
|
+
- **Multi-tenancy**: Most entities include `churchId` for church-scoped data
|
|
95
|
+
- **Optional Properties**: Extensive use for flexible partial updates
|
|
96
|
+
- **Static Methods**: All helpers use static methods for stateless operations
|
|
97
|
+
- **Error Resilience**: Comprehensive error handling with graceful degradation
|
|
90
98
|
- **Environment Flexibility**: Works across React, Next.js, React Native platforms
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Live Church Solutions
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Live Church Solutions
|
|
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
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Helpers
|
|
2
|
-
|
|
3
|
-
Library of helper functions not specific to any project or framework.
|
|
4
|
-
|
|
5
|
-
## To Test
|
|
6
|
-
|
|
7
|
-
1. After making changes run `npm build` followed by `npm link` to expose the package locally
|
|
8
|
-
2. In your test project run `@npm link @churchapps/helpers`
|
|
9
|
-
3. Rerun both after changes
|
|
10
|
-
|
|
11
|
-
## To Publish
|
|
12
|
-
|
|
13
|
-
1. Update version number in package.json
|
|
14
|
-
2. Run `npm run build`
|
|
15
|
-
3. Run `npm publish --access=public`
|
|
1
|
+
# Helpers
|
|
2
|
+
|
|
3
|
+
Library of helper functions not specific to any project or framework.
|
|
4
|
+
|
|
5
|
+
## To Test
|
|
6
|
+
|
|
7
|
+
1. After making changes run `npm build` followed by `npm link` to expose the package locally
|
|
8
|
+
2. In your test project run `@npm link @churchapps/helpers`
|
|
9
|
+
3. Rerun both after changes
|
|
10
|
+
|
|
11
|
+
## To Publish
|
|
12
|
+
|
|
13
|
+
1. Update version number in package.json
|
|
14
|
+
2. Run `npm run build`
|
|
15
|
+
3. Run `npm publish --access=public`
|
|
@@ -49,11 +49,14 @@ export interface PaymentMethodInterface {
|
|
|
49
49
|
provider?: "stripe" | "paypal";
|
|
50
50
|
type?: "card" | "bank" | "paypal";
|
|
51
51
|
last4?: string;
|
|
52
|
+
gatewayId?: string;
|
|
52
53
|
}
|
|
53
54
|
export interface StripeCardUpdateInterface {
|
|
54
55
|
paymentMethodId: string;
|
|
55
56
|
cardData: StripeCardDataInterface;
|
|
56
57
|
personId?: string;
|
|
58
|
+
gatewayId?: string;
|
|
59
|
+
provider?: "stripe" | "paypal";
|
|
57
60
|
}
|
|
58
61
|
export interface StripeCardDataInterface {
|
|
59
62
|
card: StripeCardExpirationInterface;
|
|
@@ -75,6 +78,8 @@ export interface StripeBankAccountUpdateInterface {
|
|
|
75
78
|
customerId: string;
|
|
76
79
|
personId?: string;
|
|
77
80
|
bankData: StripeBankAccountHolderDataInterface;
|
|
81
|
+
gatewayId?: string;
|
|
82
|
+
provider?: "stripe" | "paypal";
|
|
78
83
|
}
|
|
79
84
|
export interface StripeBankAccountHolderDataInterface {
|
|
80
85
|
account_holder_name: string;
|
|
@@ -86,6 +91,8 @@ export interface StripeBankAccountVerifyInterface {
|
|
|
86
91
|
amountData: {
|
|
87
92
|
amounts: string[];
|
|
88
93
|
};
|
|
94
|
+
gatewayId?: string;
|
|
95
|
+
provider?: "stripe" | "paypal";
|
|
89
96
|
}
|
|
90
97
|
export interface StripePersonDonationInterface {
|
|
91
98
|
id: string;
|
|
@@ -109,6 +116,8 @@ export interface StripeDonationInterface {
|
|
|
109
116
|
funds?: StripeFundDonationInterface[];
|
|
110
117
|
notes?: string;
|
|
111
118
|
churchId?: string;
|
|
119
|
+
provider?: "stripe" | "paypal";
|
|
120
|
+
gatewayId?: string;
|
|
112
121
|
}
|
|
113
122
|
export interface StripeDonationIntervalInterface {
|
|
114
123
|
interval: string;
|
|
@@ -126,6 +135,7 @@ export interface SubscriptionInterface {
|
|
|
126
135
|
interval_count: number;
|
|
127
136
|
};
|
|
128
137
|
customer: string;
|
|
138
|
+
gatewayId?: string;
|
|
129
139
|
}
|
|
130
140
|
export interface PayPalPaymentMethodInterface {
|
|
131
141
|
id: string;
|
|
@@ -134,6 +144,9 @@ export interface PayPalPaymentMethodInterface {
|
|
|
134
144
|
last4?: string;
|
|
135
145
|
email?: string;
|
|
136
146
|
}
|
|
147
|
+
export interface PayPalDonationInterface {
|
|
148
|
+
gatewayId?: string;
|
|
149
|
+
}
|
|
137
150
|
export interface PaymentGatewayInterface {
|
|
138
151
|
id: string;
|
|
139
152
|
provider: "stripe" | "paypal";
|
|
@@ -158,6 +171,7 @@ export interface MultiGatewayDonationInterface {
|
|
|
158
171
|
};
|
|
159
172
|
funds?: FundDonationInterface[];
|
|
160
173
|
notes?: string;
|
|
174
|
+
gatewayId?: string;
|
|
161
175
|
}
|
|
162
176
|
export declare class StripePaymentMethod {
|
|
163
177
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Donation.d.ts","sourceRoot":"","sources":["../../src/interfaces/Donation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;I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AAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QACP,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE;QACT,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,KAAK,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,mBAAmB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;gBAEjB,GAAG,CAAC,EAAE,GAAG;CAWtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Donation.js","sourceRoot":"","sources":["../../src/interfaces/Donation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Donation.js","sourceRoot":"","sources":["../../src/interfaces/Donation.ts"],"names":[],"mappings":";;;AA+KA,MAAa,mBAAmB;IAC9B,EAAE,CAAS;IACX,IAAI,CAAS;IACb,IAAI,CAAS;IACb,KAAK,CAAS;IACd,SAAS,CAAU;IACnB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,mBAAmB,CAAU;IAC7B,mBAAmB,CAAU;IAE7B,YAAY,GAAS;QACnB,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACxF,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,GAAG,EAAE,SAAS,IAAI,IAAI,CAAC;QACvD,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,KAAK,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,SAAS,IAAI,GAAG,EAAE,IAAI,EAAE,SAAS,IAAI,IAAI,CAAC;QAChE,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE,QAAQ,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,IAAI,IAAI,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,IAAI,CAAC;QAClC,IAAI,CAAC,mBAAmB,GAAG,GAAG,EAAE,mBAAmB,IAAI,EAAE,CAAC;QAC1D,IAAI,CAAC,mBAAmB,GAAG,GAAG,EAAE,mBAAmB,IAAI,YAAY,CAAC;IACtE,CAAC;CACF;AAtBD,kDAsBC"}
|
package/package.json
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@churchapps/helpers",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Library of helper functions not specific to any one ChurchApps project or framework.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": "./dist/index.js",
|
|
10
|
-
"./interfaces": "./dist/interfaces/index.js"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"clean": "rimraf dist",
|
|
15
|
-
"tsc": "tsc",
|
|
16
|
-
"build": "
|
|
17
|
-
"lint": "eslint src/**/*.ts",
|
|
18
|
-
"lint:fix": "eslint src/**/*.ts --fix",
|
|
19
|
-
"format": "prettier --write src/**/*.ts"
|
|
20
|
-
},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/LiveChurchSolutions/Helpers.git"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"ChurchApps"
|
|
27
|
-
],
|
|
28
|
-
"author": "ChurchApps.org",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"bugs": {
|
|
31
|
-
"url": "https://github.com/LiveChurchSolutions/Helpers/issues"
|
|
32
|
-
},
|
|
33
|
-
"homepage": "https://github.com/LiveChurchSolutions/Helpers#readme",
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=20.0.0",
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"@
|
|
41
|
-
"@typescript-eslint/
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint
|
|
44
|
-
"eslint-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@churchapps/helpers",
|
|
3
|
+
"version": "1.1.9",
|
|
4
|
+
"description": "Library of helper functions not specific to any one ChurchApps project or framework.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./interfaces": "./dist/interfaces/index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
+
"clean": "rimraf dist",
|
|
15
|
+
"tsc": "tsc",
|
|
16
|
+
"build": "yarn clean && yarn tsc",
|
|
17
|
+
"lint": "eslint src/**/*.ts",
|
|
18
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
19
|
+
"format": "prettier --write src/**/*.ts"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/LiveChurchSolutions/Helpers.git"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ChurchApps"
|
|
27
|
+
],
|
|
28
|
+
"author": "ChurchApps.org",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/LiveChurchSolutions/Helpers/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/LiveChurchSolutions/Helpers#readme",
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=20.0.0",
|
|
36
|
+
"yarn": ">=1.22.0",
|
|
37
|
+
"npm": "please-use-yarn"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^24.5.0",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
42
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
43
|
+
"eslint": "^8.57.0",
|
|
44
|
+
"eslint-config-prettier": "^10.1.8",
|
|
45
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
46
|
+
"npm-run-all2": "^8.0.4",
|
|
47
|
+
"prettier": "^3.6.2",
|
|
48
|
+
"rimraf": "^6.0.1",
|
|
49
|
+
"typescript": "^5.9.2"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"dayjs": "^1.11.18",
|
|
53
|
+
"rrule": "^2.8.1"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/scripts/build-cjs.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import fs from 'fs-extra';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = path.dirname(__filename);
|
|
7
|
-
|
|
8
|
-
async function buildCjs() {
|
|
9
|
-
try {
|
|
10
|
-
const distDir = path.join(__dirname, '..', 'dist');
|
|
11
|
-
|
|
12
|
-
// Read the ES module index
|
|
13
|
-
const esmContent = await fs.readFile(path.join(distDir, 'index.js'), 'utf8');
|
|
14
|
-
|
|
15
|
-
// Convert ES module syntax to CommonJS
|
|
16
|
-
let cjsContent = esmContent
|
|
17
|
-
.replace(/export \* from "(.+?)";/g, 'Object.assign(module.exports, require("$1"));')
|
|
18
|
-
.replace(/export \{ (.+?) \} from "(.+?)";/g, (match, exports, from) => {
|
|
19
|
-
const exportList = exports.split(',').map(e => e.trim());
|
|
20
|
-
return exportList.map(exp => `module.exports.${exp} = require("${from}").${exp};`).join('\n');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// Write CommonJS version
|
|
24
|
-
await fs.writeFile(path.join(distDir, 'index.cjs'), cjsContent);
|
|
25
|
-
|
|
26
|
-
console.log('CommonJS build created successfully');
|
|
27
|
-
} catch (error) {
|
|
28
|
-
console.error('Error building CommonJS version:', error);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
async function buildCjs() {
|
|
9
|
+
try {
|
|
10
|
+
const distDir = path.join(__dirname, '..', 'dist');
|
|
11
|
+
|
|
12
|
+
// Read the ES module index
|
|
13
|
+
const esmContent = await fs.readFile(path.join(distDir, 'index.js'), 'utf8');
|
|
14
|
+
|
|
15
|
+
// Convert ES module syntax to CommonJS
|
|
16
|
+
let cjsContent = esmContent
|
|
17
|
+
.replace(/export \* from "(.+?)";/g, 'Object.assign(module.exports, require("$1"));')
|
|
18
|
+
.replace(/export \{ (.+?) \} from "(.+?)";/g, (match, exports, from) => {
|
|
19
|
+
const exportList = exports.split(',').map(e => e.trim());
|
|
20
|
+
return exportList.map(exp => `module.exports.${exp} = require("${from}").${exp};`).join('\n');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Write CommonJS version
|
|
24
|
+
await fs.writeFile(path.join(distDir, 'index.cjs'), cjsContent);
|
|
25
|
+
|
|
26
|
+
console.log('CommonJS build created successfully');
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error('Error building CommonJS version:', error);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
33
|
buildCjs();
|