ultimate-jekyll-manager 0.0.109 → 0.0.110
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/commands/setup.js
CHANGED
|
@@ -41,6 +41,7 @@ module.exports = async function (options) {
|
|
|
41
41
|
options.checkLocality = options.checkLocality !== 'false';
|
|
42
42
|
options.updateBundle = options.updateBundle !== 'false';
|
|
43
43
|
options.publishGitHubToken = options.publishGitHubToken !== 'false';
|
|
44
|
+
options.updateGitHubPages = options.updateGitHubPages !== 'false';
|
|
44
45
|
|
|
45
46
|
// Log
|
|
46
47
|
logger.log(`Welcome to ${package.name} v${package.version}!`);
|
|
@@ -115,6 +116,11 @@ module.exports = async function (options) {
|
|
|
115
116
|
await publishGitHubToken();
|
|
116
117
|
}
|
|
117
118
|
|
|
119
|
+
// Update GitHub Pages settings
|
|
120
|
+
if (options.updateGitHubPages) {
|
|
121
|
+
await updateGitHubPages(options);
|
|
122
|
+
}
|
|
123
|
+
|
|
118
124
|
// Check which locality we are using
|
|
119
125
|
if (options.updateBundle && !Manager.isServer()) {
|
|
120
126
|
await updateBundle();
|
|
@@ -498,3 +504,121 @@ async function publishGitHubToken() {
|
|
|
498
504
|
// Don't throw - this is not critical for setup to continue
|
|
499
505
|
}
|
|
500
506
|
}
|
|
507
|
+
|
|
508
|
+
// Update GitHub Pages settings
|
|
509
|
+
async function updateGitHubPages(options) {
|
|
510
|
+
options = options || {};
|
|
511
|
+
|
|
512
|
+
// Check if GH_TOKEN is available
|
|
513
|
+
if (!process.env.GH_TOKEN) {
|
|
514
|
+
logger.warn('⚠️ GH_TOKEN not found in environment variables. Skipping GitHub Pages update.');
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// Check if GITHUB_REPOSITORY is available
|
|
519
|
+
if (!process.env.GITHUB_REPOSITORY) {
|
|
520
|
+
logger.warn('⚠️ GITHUB_REPOSITORY not detected. Skipping GitHub Pages update.');
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// Quit if in build mode
|
|
525
|
+
if (Manager.isBuildMode()) {
|
|
526
|
+
logger.log('⚠️ Skipping GitHub Pages update in build mode.');
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
try {
|
|
531
|
+
// Parse owner and repo
|
|
532
|
+
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
|
|
533
|
+
|
|
534
|
+
// Initialize Octokit
|
|
535
|
+
const octokit = new Octokit({
|
|
536
|
+
auth: process.env.GH_TOKEN,
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
logger.log(`📄 Configuring GitHub Pages for ${owner}/${repo}...`);
|
|
540
|
+
|
|
541
|
+
// Get current repository info to check if Pages is already enabled
|
|
542
|
+
let pagesInfo;
|
|
543
|
+
try {
|
|
544
|
+
const { data } = await octokit.repos.getPages({
|
|
545
|
+
owner,
|
|
546
|
+
repo,
|
|
547
|
+
});
|
|
548
|
+
pagesInfo = data;
|
|
549
|
+
logger.log('GitHub Pages already enabled, updating configuration...');
|
|
550
|
+
} catch (error) {
|
|
551
|
+
if (error.status === 404) {
|
|
552
|
+
logger.log('GitHub Pages not yet enabled, creating Pages site...');
|
|
553
|
+
pagesInfo = null;
|
|
554
|
+
} else {
|
|
555
|
+
throw error;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Determine the source configuration
|
|
560
|
+
const sourceConfig = options.source || { branch: 'gh-pages', path: '/' };
|
|
561
|
+
|
|
562
|
+
// If custom domain is provided in config, use it
|
|
563
|
+
const customDomain = options.customDomain || (config.url ? new URL(config.url).host : null);
|
|
564
|
+
|
|
565
|
+
// Build options for API call
|
|
566
|
+
const pagesOptions = {
|
|
567
|
+
owner,
|
|
568
|
+
repo,
|
|
569
|
+
source: sourceConfig,
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// Add custom domain if available and not github.io domain
|
|
573
|
+
if (customDomain && !customDomain.includes('github.io')) {
|
|
574
|
+
pagesOptions.cname = customDomain;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// Add HTTPS enforcement (recommended)
|
|
578
|
+
if (options.httpsEnforced !== false) {
|
|
579
|
+
pagesOptions.https_enforced = true;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// Create or update Pages configuration
|
|
583
|
+
if (!pagesInfo) {
|
|
584
|
+
// Create new Pages site
|
|
585
|
+
const { data } = await octokit.repos.createPagesSite(pagesOptions);
|
|
586
|
+
logger.log(`✅ GitHub Pages enabled successfully!`);
|
|
587
|
+
logger.log(` URL: ${data.html_url}`);
|
|
588
|
+
if (data.cname) {
|
|
589
|
+
logger.log(` Custom domain: ${data.cname}`);
|
|
590
|
+
}
|
|
591
|
+
} else {
|
|
592
|
+
// Update existing Pages site
|
|
593
|
+
const updateOptions = {
|
|
594
|
+
owner,
|
|
595
|
+
repo,
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
// Only include fields that can be updated
|
|
599
|
+
if (customDomain && !customDomain.includes('github.io')) {
|
|
600
|
+
updateOptions.cname = customDomain;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
if (options.httpsEnforced !== false) {
|
|
604
|
+
updateOptions.https_enforced = true;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
// Update source if different
|
|
608
|
+
if (JSON.stringify(pagesInfo.source) !== JSON.stringify(sourceConfig)) {
|
|
609
|
+
updateOptions.source = sourceConfig;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const { data } = await octokit.repos.updateInformationAboutPagesSite(updateOptions);
|
|
613
|
+
logger.log(`✅ GitHub Pages configuration updated successfully!`);
|
|
614
|
+
logger.log(` URL: ${data.html_url}`);
|
|
615
|
+
if (data.cname) {
|
|
616
|
+
logger.log(` Custom domain: ${data.cname}`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
} catch (error) {
|
|
621
|
+
logger.error(`❌ Failed to update GitHub Pages: ${error.message}`);
|
|
622
|
+
// Don't throw - this is not critical for setup to continue
|
|
623
|
+
}
|
|
624
|
+
}
|
|
@@ -8,7 +8,7 @@ on:
|
|
|
8
8
|
- main
|
|
9
9
|
- template
|
|
10
10
|
schedule:
|
|
11
|
-
|
|
11
|
+
- cron: '{ github.workflows.build.schedule }' # auto-build schedule (configurable in ultimate-jekyll-manager.json)
|
|
12
12
|
|
|
13
13
|
concurrency:
|
|
14
14
|
group: ${{ github.ref }}
|
|
@@ -18,6 +18,10 @@ const config = Manager.getConfig('project');
|
|
|
18
18
|
const rootPathPackage = Manager.getRootPath('main');
|
|
19
19
|
const rootPathProject = Manager.getRootPath('project');
|
|
20
20
|
|
|
21
|
+
// Load ultimate-jekyll-manager.json config
|
|
22
|
+
const ujConfigPath = path.join(rootPathPackage, 'dist/defaults/ultimate-jekyll-manager.json');
|
|
23
|
+
const ujConfig = jetpack.exists(ujConfigPath) ? JSON5.parse(jetpack.read(ujConfigPath)) : {};
|
|
24
|
+
|
|
21
25
|
// Get clean versions
|
|
22
26
|
// const cleanVersions = { versions: Manager.getCleanVersions()};
|
|
23
27
|
const cleanVersions = { versions: package.engines };
|
|
@@ -65,7 +69,7 @@ const FILE_MAP = {
|
|
|
65
69
|
|
|
66
70
|
// Files to run templating on
|
|
67
71
|
'.github/workflows/build.yml': {
|
|
68
|
-
template: cleanVersions,
|
|
72
|
+
template: { ...cleanVersions, ...ujConfig },
|
|
69
73
|
},
|
|
70
74
|
'.nvmrc': {
|
|
71
75
|
template: cleanVersions,
|
package/firebase-debug.log
CHANGED
|
@@ -198,3 +198,59 @@
|
|
|
198
198
|
[debug] [2025-10-27T23:48:17.927Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
199
199
|
[debug] [2025-10-27T23:48:17.927Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
200
200
|
[debug] [2025-10-27T23:48:17.927Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
201
|
+
[debug] [2025-10-30T00:06:03.831Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
202
|
+
[debug] [2025-10-30T00:06:03.832Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
203
|
+
[debug] [2025-10-30T00:06:03.834Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
204
|
+
[debug] [2025-10-30T00:06:03.834Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
205
|
+
[debug] [2025-10-30T00:06:03.834Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
206
|
+
[debug] [2025-10-30T00:06:03.847Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
207
|
+
[debug] [2025-10-30T00:06:03.847Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
208
|
+
[debug] [2025-10-30T00:06:03.833Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
209
|
+
[debug] [2025-10-30T00:06:03.833Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
210
|
+
[debug] [2025-10-30T00:06:03.833Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
211
|
+
[debug] [2025-10-30T00:06:03.847Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
212
|
+
[debug] [2025-10-30T00:06:03.847Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
213
|
+
[debug] [2025-10-30T00:06:03.984Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
214
|
+
[debug] [2025-10-30T00:06:03.984Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
215
|
+
[debug] [2025-10-30T00:06:03.984Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
216
|
+
[debug] [2025-10-30T00:06:03.985Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
217
|
+
[debug] [2025-10-30T00:06:03.985Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
218
|
+
[debug] [2025-10-30T00:06:03.986Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
219
|
+
[debug] [2025-10-30T00:06:03.986Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
220
|
+
[debug] [2025-10-30T00:06:03.987Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
221
|
+
[debug] [2025-10-30T00:06:03.987Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
222
|
+
[debug] [2025-10-30T00:06:03.984Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
223
|
+
[debug] [2025-10-30T00:06:03.985Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
224
|
+
[debug] [2025-10-30T00:06:03.985Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
225
|
+
[debug] [2025-10-30T00:06:03.986Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
226
|
+
[debug] [2025-10-30T00:06:03.986Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
227
|
+
[debug] [2025-10-30T00:06:03.987Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
228
|
+
[debug] [2025-10-30T00:06:03.987Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
229
|
+
[debug] [2025-11-04T23:58:14.817Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
230
|
+
[debug] [2025-11-04T23:58:14.817Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
231
|
+
[debug] [2025-11-04T23:58:14.819Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
232
|
+
[debug] [2025-11-04T23:58:14.819Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
233
|
+
[debug] [2025-11-04T23:58:14.819Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
234
|
+
[debug] [2025-11-04T23:58:14.835Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
235
|
+
[debug] [2025-11-04T23:58:14.836Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
236
|
+
[debug] [2025-11-04T23:58:14.819Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
237
|
+
[debug] [2025-11-04T23:58:14.819Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
238
|
+
[debug] [2025-11-04T23:58:14.820Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
239
|
+
[debug] [2025-11-04T23:58:14.836Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
240
|
+
[debug] [2025-11-04T23:58:14.836Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
241
|
+
[debug] [2025-11-04T23:58:14.969Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
242
|
+
[debug] [2025-11-04T23:58:14.969Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
243
|
+
[debug] [2025-11-04T23:58:14.970Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
244
|
+
[debug] [2025-11-04T23:58:14.970Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
245
|
+
[debug] [2025-11-04T23:58:14.971Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
246
|
+
[debug] [2025-11-04T23:58:14.971Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
247
|
+
[debug] [2025-11-04T23:58:14.972Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
248
|
+
[debug] [2025-11-04T23:58:14.972Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
249
|
+
[debug] [2025-11-04T23:58:14.975Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
250
|
+
[debug] [2025-11-04T23:58:14.975Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
251
|
+
[debug] [2025-11-04T23:58:14.976Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
252
|
+
[debug] [2025-11-04T23:58:14.976Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
253
|
+
[debug] [2025-11-04T23:58:14.977Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
254
|
+
[debug] [2025-11-04T23:58:14.977Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
255
|
+
[debug] [2025-11-04T23:58:14.978Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
256
|
+
[debug] [2025-11-04T23:58:14.978Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|