vending-mocha 0.1.7 → 0.1.8

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.
@@ -7,23 +7,25 @@ on:
7
7
  release:
8
8
  types: [created]
9
9
 
10
+ permissions:
11
+ id-token: write # Required for OIDC
12
+ contents: read
13
+
10
14
  jobs:
11
- publish-npm:
15
+ publish:
12
16
  runs-on: ubuntu-latest
13
17
  steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-node@v4
16
20
  with:
17
- node-version: 20
18
- registry-url: https://registry.npmjs.org/
21
+ node-version: '24'
22
+ registry-url: 'https://registry.npmjs.org'
19
23
  - run: npm ci
20
- - run: npm run build
24
+ - run: npm run build --if-present
21
25
  - run: npm publish
22
- env:
23
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
24
26
 
25
27
  increment-version:
26
- needs: publish-npm
28
+ needs: publish
27
29
  runs-on: ubuntu-latest
28
30
  permissions:
29
31
  contents: write
package/bin/cli.js CHANGED
@@ -296,7 +296,7 @@ async function handleUpgrade() {
296
296
  }
297
297
 
298
298
  console.log(chalk.yellow('WARNING: This will overwrite project files to the latest version of vending-mocha.'));
299
- console.log(chalk.yellow('Your content (posts/, projects/, life/) and configuration (src/site.config.ts) will be preserved.'));
299
+ console.log(chalk.yellow('Your content (posts/, projects/, life/, static/) and configuration (src/site.config.ts) will be preserved.'));
300
300
  console.log(chalk.yellow('Please ensure you have committed your changes before proceeding.'));
301
301
 
302
302
  const { proceed } = await inquirer.prompt([
@@ -321,6 +321,8 @@ async function handleUpgrade() {
321
321
  ...IGNORE_FILES,
322
322
  'posts',
323
323
  'projects',
324
+ 'life',
325
+ 'static',
324
326
  'src/site.config.ts', // Important: Preserve config
325
327
  'package.json' // We handle this separately
326
328
  ];
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "vending-mocha",
3
3
  "description": "A personal blogging framework for developers.",
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "vending-mocha": "./bin/cli.js"
9
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/kcthota/vending-mocha.git"
13
+ },
10
14
  "scripts": {
11
15
  "dev": "npm run build:all && vite",
12
16
  "build:client": "tsc -b && vite build --outDir docs",
@@ -54,4 +58,4 @@
54
58
  "typescript-eslint": "^8.48.0",
55
59
  "vite": "^7.3.1"
56
60
  }
57
- }
61
+ }
@@ -5,14 +5,35 @@ import { siteConfig } from '../site.config';
5
5
  import remarkGfm from 'remark-gfm';
6
6
  import { Github, Mail, Rss } from 'lucide-react';
7
7
 
8
+ declare const __BUILD_TIMESTAMP__: string | number | undefined;
9
+
8
10
  export default function Profile() {
11
+ const isRelativeImage = Boolean(siteConfig.image && !siteConfig.image.startsWith('http') && !siteConfig.image.startsWith('//'));
12
+ let finalImageUrl = siteConfig.image || '';
13
+
14
+ if (isRelativeImage && siteConfig.image) {
15
+ finalImageUrl = `${getBasePath()}${siteConfig.image.startsWith('/') ? siteConfig.image.slice(1) : siteConfig.image}`;
16
+
17
+ if (typeof __BUILD_TIMESTAMP__ !== 'undefined') {
18
+ try {
19
+ const url = new URL(finalImageUrl, 'http://dummy.local');
20
+ if (!url.searchParams.has('v')) {
21
+ url.searchParams.set('v', String(__BUILD_TIMESTAMP__));
22
+ }
23
+ finalImageUrl = url.pathname + url.search + url.hash;
24
+ } catch (err) {
25
+ // Should not happen, but safe fallback
26
+ }
27
+ }
28
+ }
29
+
9
30
  return (
10
31
  <section className="profile-section">
11
32
  {siteConfig.image && (
12
33
  <div className="profile-sidebar">
13
34
  <div className="profile-image-container">
14
35
  <img
15
- src={siteConfig.image.startsWith('http') ? siteConfig.image : `${getBasePath()}${siteConfig.image.startsWith('/') ? siteConfig.image.slice(1) : siteConfig.image}`}
36
+ src={finalImageUrl}
16
37
  alt="Profile"
17
38
  className="profile-image"
18
39
  />
package/vite.config.ts CHANGED
@@ -62,5 +62,8 @@ export default defineConfig({
62
62
  },
63
63
  ssr: {
64
64
  noExternal: ['react-syntax-highlighter']
65
+ },
66
+ define: {
67
+ __BUILD_TIMESTAMP__: Date.now(),
65
68
  }
66
69
  })