-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.all-contributors.config.cjs
More file actions
181 lines (166 loc) · 4.8 KB
/
Copy path.all-contributors.config.cjs
File metadata and controls
181 lines (166 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/**
* All Contributors Configuration for LightSpeedWP Organization
*
* Manages contributor recognition and README generation.
* This configuration provides:
* - Comprehensive contributor type definitions
* - Environment variable overrides for CI/CD
* - Custom commit message templates
* - Badge and image customization
*
* Environment Variables:
* - CONTRIBUTORS_AUTO_COMMIT: Enable auto-commits (default: false)
* - CONTRIBUTORS_IMAGE_SIZE: Badge image size (default: 100)
* - CONTRIBUTORS_PER_LINE: Contributors per line (default: 7)
* - CONTRIBUTORS_PROJECT_NAME: Override project name
* - CONTRIBUTORS_PROJECT_OWNER: Override project owner
*/
/**
* Load environment variables with fallback defaults
*/
require("dotenv").config();
/**
* Configuration constants with environment variable overrides
*/
const projectName = process.env.CONTRIBUTORS_PROJECT_NAME || ".github";
const projectOwner = process.env.CONTRIBUTORS_PROJECT_OWNER || "lightspeedwp";
const autoCommit = process.env.CONTRIBUTORS_AUTO_COMMIT === "true";
const imageSize = parseInt(process.env.CONTRIBUTORS_IMAGE_SIZE) || 100;
const contributorsPerLine = parseInt(process.env.CONTRIBUTORS_PER_LINE) || 7;
/**
* All Contributors Configuration Object
*
* @type {import('all-contributors-cli').Configuration}
*/
module.exports = {
/**
* Project identification
*/
projectName,
projectOwner,
repoType: "github",
repoHost: "https://github.com",
/**
* Project metadata
*/
projectDescription:
"GitHub Community Health files for LightSpeedWP organization",
projectWebsite: "https://lightspeedwp.agency",
license: "GPL-2.0-or-later",
/**
* Files to update with contributor information
* Additional files can be added for multi-file projects
*/
files: [
"README.md",
// Add more files as needed
// 'docs/CONTRIBUTORS.md',
// 'CHANGELOG.md'
],
/**
* Badge and image configuration
*/
imageSize,
contributorsPerLine,
/**
* Badge URL template (can be customized for different services)
*/
badgeTemplate:
"https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat-square",
/**
* Commit configuration
* Controls automatic commits when contributors are added
*/
commit: autoCommit,
commitConvention: "conventional",
/**
* Custom commit message templates
*/
commitTemplate: {
add: "docs: add <%= username %> as a contributor for <%= contributions %>",
update: "docs: update contributors",
},
/**
* Link to usage guidelines
* Helps new contributors understand how to get recognized
*/
linkToUsage: true,
/**
* Skip asking for contribution types
* When true, will add all available contribution types
*/
skipCi: false,
/**
* Current contributors list
* This will be automatically updated as contributors are added
*/
contributors: [
{
login: "lightspeedwp",
name: "LightSpeedWP",
avatar_url: "https://avatars.githubusercontent.com/u/13472139?v=4",
profile: "https://github.com/lightspeedwp",
contributions: [
"ideas", // Ideas, planning, feedback
"fundingFinding", // Finding/providing funding
"projectManagement", // Project management
"business", // Business development
"code", // Code
"design", // Design
"doc", // Documentation
"infra", // Infrastructure (CI/CD, etc)
"maintenance", // Maintenance
"test", // Tests
],
},
],
/**
* Available contribution types
* Can be extended with custom contribution types
*/
contributionTypes: {
// Standard types are automatically included
// Custom types can be added here
agent: {
symbol: "🤖",
description: "AI Agent Development",
link: '[<%= symbol %>](<%= url %> "AI Agent Development")',
},
automation: {
symbol: "⚙️",
description: "Automation & Workflows",
link: '[<%= symbol %>](<%= url %> "Automation & Workflows")',
},
devops: {
symbol: "🚀",
description: "DevOps & Deployment",
link: '[<%= symbol %>](<%= url %> "DevOps & Deployment")',
},
},
/**
* Custom functions for contributor validation and processing
*/
functions: {
/**
* Validate GitHub username format
*/
validateUsername: function (username) {
const usernameRegex = /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i;
return usernameRegex.test(username);
},
/**
* Generate contributor stats
*/
generateStats: function (contributors) {
return {
total: contributors.length,
byType: contributors.reduce((acc, contributor) => {
contributor.contributions.forEach((type) => {
acc[type] = (acc[type] || 0) + 1;
});
return acc;
}, {}),
};
},
},
};