ultimate-jekyll-manager 0.0.203 → 0.0.205

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/CLAUDE.md CHANGED
@@ -6,6 +6,8 @@ Ultimate Jekyll Manager is a template framework that consuming projects install
6
6
 
7
7
  **Important:** This is NOT a standalone project. You cannot run `npm start` or `npm run build` directly in this repository.
8
8
 
9
+ **DO NOT run `npm start`, `npm run build`, or any dev server commands.** The user already has a development server running in a consuming project. Running these commands here would either fail or create duplicate servers unnecessarily.
10
+
9
11
  ## Project Structure
10
12
 
11
13
  ### Directory Organization
@@ -22,7 +24,7 @@ Ultimate Jekyll Manager is a template framework that consuming projects install
22
24
 
23
25
  ## Local Development
24
26
 
25
- The local development server URL is stored in `.temp/_config_browsersync.yml` in the consuming project's root directory. Read this file to determine the correct URL for browsing and testing.
27
+ The local development server URL is stored in `.temp/_config_browsersync.yml` in the consuming project's root directory. Read this file to determine the correct URL for browsing and testing. By default, use "https://192.168.86.69:4000".
26
28
 
27
29
  ## Asset Organization
28
30
 
@@ -462,6 +464,26 @@ Ultimate Jekyll supports both light and dark modes. Use adaptive classes instead
462
464
 
463
465
  These classes automatically adapt to the current theme mode.
464
466
 
467
+ ### Cards Inside Colored Sections
468
+
469
+ When placing cards inside sections with `bg-body-secondary` or `bg-body-tertiary`, cards will blend in because they share the same background color by default.
470
+
471
+ **Solution:** Add `bg-body` to cards to create visual contrast:
472
+
473
+ ```html
474
+ <!-- ❌ WRONG - Card blends with section background -->
475
+ <section class="bg-body-secondary">
476
+ <div class="card">...</div>
477
+ </section>
478
+
479
+ <!-- ✅ CORRECT - Card stands out with contrasting background -->
480
+ <section class="bg-body-secondary">
481
+ <div class="card bg-body">...</div>
482
+ </section>
483
+ ```
484
+
485
+ **Rule:** When a section uses `bg-body-secondary` or `bg-body-tertiary`, always add `bg-body` to child cards to ensure proper visual hierarchy.
486
+
465
487
  ## Page Loading Protection System
466
488
 
467
489
  Ultimate Jekyll prevents race conditions by disabling buttons during JavaScript initialization.
package/dist/cli.js CHANGED
@@ -2,6 +2,9 @@
2
2
  const path = require('path');
3
3
  const jetpack = require('fs-jetpack');
4
4
 
5
+ // Load .env file from current working directory (project root)
6
+ require('dotenv').config({ path: path.join(process.cwd(), '.env') });
7
+
5
8
  // Command Aliases
6
9
  const DEFAULT = 'setup';
7
10
  const ALIASES = {
@@ -6,6 +6,7 @@ const { execute } = require('node-powertools');
6
6
 
7
7
  /**
8
8
  * Detects and sets GITHUB_REPOSITORY environment variable if not already set
9
+ * Uses GitHub API to verify/correct the owner in case repo was transferred
9
10
  * @param {Object} logger - Logger instance for output
10
11
  * @returns {Promise<string|null>} - Repository in format "owner/repo" or null if detection fails
11
12
  */
@@ -20,16 +21,54 @@ async function detectGitHubRepository(logger = console) {
20
21
 
21
22
  // Parse GitHub repository from remote URL
22
23
  // Supports: https://github.com/owner/repo.git, git@github.com:owner/repo.git
23
- const match = result.match(/github\.com[:/]([^/]+\/[^.\s]+)/);
24
+ const match = result.match(/github\.com[:/]([^/]+)\/([^.\s]+)/);
24
25
 
25
- if (match) {
26
- process.env.GITHUB_REPOSITORY = match[1];
27
- logger.log(`Auto-detected repository from git remote: ${process.env.GITHUB_REPOSITORY}`);
28
- return process.env.GITHUB_REPOSITORY;
29
- } else {
26
+ if (!match) {
30
27
  logger.warn(`⚠️ Could not parse GitHub repository from git remote URL: ${result}`);
31
28
  return null;
32
29
  }
30
+
31
+ let owner = match[1];
32
+ let repo = match[2];
33
+
34
+ // If GH_TOKEN is available, verify the current owner via GitHub API
35
+ // This handles cases where repos were transferred to a different owner
36
+ if (process.env.GH_TOKEN) {
37
+ try {
38
+ const { Octokit } = require('@octokit/rest');
39
+ const octokit = new Octokit({ auth: process.env.GH_TOKEN });
40
+
41
+ // GitHub API automatically redirects to the current location of transferred repos
42
+ const { data } = await octokit.repos.get({ owner, repo });
43
+
44
+ // Check if the repo was transferred (owner changed)
45
+ if (data.owner.login !== owner) {
46
+ logger.log(`🔄 Repository was transferred: ${owner}/${repo} → ${data.owner.login}/${repo}`);
47
+
48
+ // Update the local git remote to the new owner
49
+ const newOwner = data.owner.login;
50
+ const newUrl = result.includes('git@')
51
+ ? `git@github.com:${newOwner}/${repo}.git`
52
+ : `https://github.com/${newOwner}/${repo}.git`;
53
+
54
+ try {
55
+ await execute(`git remote set-url origin ${newUrl}`, { log: false });
56
+ logger.log(`✅ Updated git remote origin to: ${newUrl}`);
57
+ } catch (remoteError) {
58
+ logger.warn(`⚠️ Could not update git remote: ${remoteError.message}`);
59
+ }
60
+
61
+ owner = newOwner;
62
+ }
63
+ } catch (apiError) {
64
+ // If API call fails, fall back to git remote value
65
+ logger.warn(`⚠️ Could not verify repository owner via GitHub API: ${apiError.message}`);
66
+ }
67
+ }
68
+
69
+ process.env.GITHUB_REPOSITORY = `${owner}/${repo}`;
70
+ logger.log(`Auto-detected repository from git remote: ${process.env.GITHUB_REPOSITORY}`);
71
+ return process.env.GITHUB_REPOSITORY;
33
72
  } catch (e) {
34
73
  // Ignore errors from git command (e.g., not a git repo, no remote)
35
74
  if (logger.warn) {
@@ -101,6 +101,9 @@ class GitHubCache {
101
101
  this.logger.log(`📦 Zip file: ${zipFileName}`);
102
102
  this.logger.log(`📂 Extract directory: ${extractDir}`);
103
103
  this.logger.log(`📁 Directory contents: ${JSON.stringify(dirContents)}`);
104
+ this.logger.log(`🔍 Debug - this.owner: ${this.owner}, this.repo: ${this.repo}`);
105
+ this.logger.log(`🔍 Debug - GITHUB_REPOSITORY env: ${process.env.GITHUB_REPOSITORY}`);
106
+ this.logger.log(`🔍 Debug - Pattern being used: ^${this.owner}-${this.repo}-[a-f0-9]+$`);
104
107
 
105
108
  // GitHub zipball format: {owner}-{repo}-{sha}
106
109
  // Match this pattern to avoid picking up other cache directories (like imagemin, translation)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-jekyll-manager",
3
- "version": "0.0.203",
3
+ "version": "0.0.205",
4
4
  "description": "Ultimate Jekyll dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {