diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bd32807 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Normalize line endings: everything text is committed with LF and checked +# out as LF on every platform, so Windows clones (core.autocrlf=true) don't +# fail the incremental prettier --check CI gate on CRLF. +* text=auto eol=lf + +# Binary assets — never normalized or diffed as text. +*.docx binary +*.xlsx binary +*.pptx binary +*.pdf binary +*.png binary +*.ico binary +*.icns binary +*.ttf binary +*.otf binary +*.woff binary +*.woff2 binary diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7421ca7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,6 @@ +# ee/ is the enterprise-license boundary and takes no external contributions +# (see ee/LICENSE); license-related files need a maintainer review. +/ee/ @merrick-2002 +/LICENSE @merrick-2002 +/NOTICE @merrick-2002 +/.github/CODEOWNERS @merrick-2002 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4c2b194 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# Keep GitHub Actions fresh: workflow actions are SHA-pinned, so tag moves +# never reach us without a PR bumping the pinned commit here. +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e21274f..a42dc8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,12 @@ jobs: timeout-minutes: 45 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: fetch-depth: 0 - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 20 cache: npm @@ -82,5 +82,11 @@ jobs: - name: Regenerate test fixtures run: npm run fixtures + # Generation is byte-deterministic (zip entry mtimes are pinned in + # tests/helpers/build-docx.ts); a diff here means the generator and the + # committed fixtures have drifted apart. + - name: Check committed fixtures match the generator + run: git diff --exit-code -- fixtures/generated + - name: Test run: npm test diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b5fb22c..a49f5a5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -56,9 +56,11 @@ an individual is officially representing the community in public spaces. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement through the -repository's security advisory channel or the contact listed in -[SECURITY.md](SECURITY.md). All complaints will be reviewed and investigated +reported to the community leaders responsible for enforcement through +GitHub's +[private vulnerability reporting](https://github.com/genspark-ai/genoffice/security/advisories/new) +channel on this repository (used here as the private contact channel for +conduct reports as well). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10c283c..2223700 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,9 +53,12 @@ formatting diff. ## Building installers +Run these from the repository root — they regenerate the third-party +notices and build all five apps before packaging: + ```bash -npm run dist:mac -w @genoffice/shell # dmg + zip -npm run dist:win -w @genoffice/shell # nsis installer +npm run dist:mac # dmg + zip +npm run dist:win # nsis installer ``` Without Apple or Windows signing credentials in the environment these produce diff --git a/README.md b/README.md index 867dbd3..2af0954 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,11 @@ calls through the Genspark service side; no model API key is stored locally. ## Engine packages -All pure TypeScript, unit-tested, no Electron dependency: +All pure TypeScript, no Electron dependency, unit-tested (except the UI kit): -- `packages/docx-engine` — docx parsing → block tree (with `docxIndex` anchors - - passthrough), OOXML fragment generation, byte-level paragraph patching. +- `packages/docx-engine` — docx parsing → block tree (with `docxIndex` + anchors and passthrough), OOXML fragment generation, byte-level paragraph + patching. - `packages/pptx-engine` / `packages/pptx-render` — pptx model and rendering. - `packages/file-parse` — text extraction for AI attachments (office formats, text formats). diff --git a/SECURITY.md b/SECURITY.md index 3338fe5..1a8e12d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,8 +3,8 @@ ## Reporting a Vulnerability Please report suspected vulnerabilities privately via GitHub's -[private vulnerability reporting](../../security/advisories/new) on this -repository. Do not open public issues for security reports. We aim to +[private vulnerability reporting](https://github.com/genspark-ai/genoffice/security/advisories/new) +on this repository. Do not open public issues for security reports. We aim to acknowledge reports within 72 hours. ## Process Security Posture diff --git a/apps/docs/src/main/docs-main.ts b/apps/docs/src/main/docs-main.ts index c363577..8aa6f08 100644 --- a/apps/docs/src/main/docs-main.ts +++ b/apps/docs/src/main/docs-main.ts @@ -11,7 +11,11 @@ import { } from 'node:fs' import { basename, join } from 'node:path' import { BrowserWindow, Menu, WebContentsView, app, dialog, ipcMain, shell } from 'electron' -import { fetchWithSsrfGuard, safeExternalUrl } from '@genoffice/electron-utils' +import { + fetchWithSsrfGuard, + installNavigationGuard, + safeExternalUrl, +} from '@genoffice/electron-utils' import { createI18n, getUiLang, normalizeLang, setUiLang } from '@genoffice/i18n' import { ProjectStore } from '@genoffice/project-store' import type { @@ -3399,6 +3403,7 @@ export function hasDocsWindow(): boolean { // ---- standalone lifecycle (apps/docs running on its own) ---- export function startDocsStandalone(): void { + installNavigationGuard(app) // dev runs must not share the packaged app's userData (recent files, AI settings) // or its single-instance lock — otherwise `npm run dev` silently quits whenever // the installed GenOffice Docs is open and forwards its argv there instead. diff --git a/apps/docs/src/renderer/index.html b/apps/docs/src/renderer/index.html index b3ad57a..6ea72de 100644 --- a/apps/docs/src/renderer/index.html +++ b/apps/docs/src/renderer/index.html @@ -2,6 +2,10 @@
+