Skip to content

Commit af38458

Browse files
committed
fix: correct GitHub URLs and improve source code documentation
- Fix readme.txt GitHub URLs: codeideal/openfields -> novincode/openfields - Expand source code documentation with direct links to source directories - Add banner comment to compiled admin.js pointing to source repo - Add Vite banner plugin to auto-prepend source reference on build
1 parent 6cd3b3f commit af38458

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

plugin/assets/admin/js/admin.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/readme.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ Codeideal Open Fields is a powerful, lightweight, and 100% open-source custom fi
1717

1818
= Source Code & Build Instructions =
1919

20-
The admin interface JavaScript (`assets/admin/js/admin.js`) is built from uncompressed React/TypeScript source code included in the development repository.
20+
The admin interface JavaScript (`assets/admin/js/admin.js`) and CSS (`assets/admin/css/admin.css`) are compiled from uncompressed source code. All other JavaScript and CSS files in the plugin are uncompressed and human-readable.
2121

22-
**Source files:** The full uncompressed source is available at [https://github.com/codeideal/openfields](https://github.com/codeideal/openfields) in the `admin/src/` directory.
22+
**Public source repository:** [https://github.com/novincode/openfields](https://github.com/novincode/openfields)
23+
24+
**Source files location:** The uncompressed React/TypeScript source for the admin JS is in [`admin/src/`](https://github.com/novincode/openfields/tree/main/admin/src). The uncompressed CSS source for `admin.css` is in [`admin/src/styles/`](https://github.com/novincode/openfields/tree/main/admin/src/styles). All other JavaScript and CSS files in `assets/admin/js/` and `assets/admin/css/` (except `admin.js` and `admin.css`) are already human-readable and uncompressed.
2325

2426
**To build from source:**
2527

26-
1. Clone the repository: `git clone https://github.com/codeideal/openfields.git`
28+
1. Clone the repository: `git clone https://github.com/novincode/openfields.git`
2729
2. Install dependencies: `pnpm install`
28-
3. Build the admin JS: `pnpm run build`
30+
3. Build the admin JS/CSS: `pnpm run build`
2931

30-
The build output is placed in `plugin/assets/admin/js/admin.js`. All other CSS and JavaScript files in the plugin are uncompressed and human-readable.
32+
The build uses Vite and TypeScript. Output is placed in `plugin/assets/admin/js/admin.js` and `plugin/assets/admin/css/admin.css`.
3133

3234
= Key Features =
3335

vite.config.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
33
import path from 'path';
4+
import fs from 'fs';
5+
6+
const sourceBanner = '/*! Codeideal Open Fields - Source: https://github.com/novincode/openfields/tree/main/admin/src - Build: pnpm run build */\n';
7+
8+
function bannerPlugin() {
9+
return {
10+
name: 'banner',
11+
writeBundle(_options: any, bundle: Record<string, any>) {
12+
for (const [fileName] of Object.entries(bundle)) {
13+
if (fileName.endsWith('.js')) {
14+
const filePath = path.resolve(__dirname, 'plugin/assets/admin', fileName);
15+
const content = fs.readFileSync(filePath, 'utf-8');
16+
fs.writeFileSync(filePath, sourceBanner + content);
17+
}
18+
}
19+
},
20+
};
21+
}
422

523
export default defineConfig({
6-
plugins: [react()],
24+
plugins: [react(), bannerPlugin()],
725
resolve: {
826
alias: {
927
'@': path.resolve(__dirname, './admin/src'),

0 commit comments

Comments
 (0)