Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .redocly/plugins/custom-rules.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

import SkipAbbreviatedExamples from './rules/skip-abbreviated-examples.js'

export default function CustomRulesPlugin() {
Expand Down
28 changes: 28 additions & 0 deletions .redocly/plugins/rules/skip-abbreviated-examples.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

function removeNodesWithKey(obj, key) {
if (obj === null) return;
if (typeof obj === 'string') return;
Expand Down
21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,27 @@ erb_lint {files}
bundle exec lefthook install
```

### JavaScript and TypeScript Copyright Headers

All first-party JavaScript and TypeScript files must use the canonical compact
line-comment copyright header generated from `COPYRIGHT_short`:

```typescript
//-- copyright
// OpenProject is an open source project management software.
// ...
//++

```

Use `//-- copyright` and `//++` exactly as shown. Prefix non-empty body lines
with `// `, prefix empty body lines with `//`, and leave one blank line between
the header and the source code. Do not compose or reformat the header manually.

Run `rake copyright:update_typescript` to add or repair headers in `.ts` and
`.tsx` files. Run `rake copyright:update_js` for `.js`, `.mjs`, and `.cjs`
files. Both commands accept an optional path argument.

## Commit Messages
- First line: < 72 characters, then blank line, then detailed description
- Reference work packages when applicable
Expand Down
54 changes: 53 additions & 1 deletion extensions/op-blocknote-hocuspocus/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,62 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

import js from "@eslint/js";
import { readFileSync } from "node:fs";
import globals from "globals";
import { fileURLToPath } from "node:url";
import tseslint from "typescript-eslint";
import json from "@eslint/json";
import { defineConfig } from "eslint/config";
import stylistic from "@stylistic/eslint-plugin";
import headers from "eslint-plugin-headers";

const copyrightPath = fileURLToPath(new URL("../../COPYRIGHT_short", import.meta.url));
const copyrightHeader = [
"-- copyright",
...readFileSync(copyrightPath, "utf8")
.trimEnd()
.split(/\r?\n/)
.map((line) => line ? ` ${line}` : ""),
"++",
].join("\n");

export default defineConfig([
{
ignores: ["package-lock.json"],
},
tseslint.configs.recommended,
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
files: ["**/*.{js,mjs,cjs,ts,tsx,mts,cts}"],
plugins: {
js,
'@stylistic': stylistic,
headers,
},
extends: ["js/recommended"],
languageOptions: { globals: globals.node },
Expand All @@ -27,6 +69,16 @@ export default defineConfig([
}],
"@stylistic/semi": ["warn", "always"],
"@stylistic/indent": ["warn", 2],
"headers/header-format": [
"error",
{
source: "string",
content: copyrightHeader,
style: "line",
linePrefix: "",
trailingNewlines: 2,
},
],
}
},
{
Expand Down
14 changes: 14 additions & 0 deletions extensions/op-blocknote-hocuspocus/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions extensions/op-blocknote-hocuspocus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@stylistic/eslint-plugin": "^5.3.1",
"@types/node": "^25.9.5",
"eslint": "^10.6.0",
"eslint-plugin-headers": "^1.3.4",
"globals": "^17.7.0",
"msw": "^2.12.7",
"typescript": "^6.0.3",
Expand Down
28 changes: 28 additions & 0 deletions extensions/op-blocknote-hocuspocus/src/closeEvents.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

import type { CloseEvent } from "@hocuspocus/common";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

import { BlockNoteSchema } from "@blocknote/core";
import { ServerBlockNoteEditor } from "@blocknote/server-util";
import type { beforeHandleMessagePayload, onAuthenticatePayload, onLoadDocumentPayload, onStoreDocumentPayload, onTokenSyncPayload } from "@hocuspocus/server";
Expand Down
28 changes: 28 additions & 0 deletions extensions/op-blocknote-hocuspocus/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

import { Logger } from "@hocuspocus/extension-logger";
import { Server } from "@hocuspocus/server";
import { OpenProjectApi } from "./extensions/openProjectApi";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

import { createDecipheriv, createHash } from "node:crypto";

export const ALGORITHM = "aes-256-gcm";
Expand Down
28 changes: 28 additions & 0 deletions extensions/op-blocknote-hocuspocus/src/services/resourceService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See COPYRIGHT and LICENSE files for more details.
//++

const OPENPROJECT_URL = process.env.OPENPROJECT_URL?.trim() || null;
const OPENPROJECT_HTTPS = process.env.OPENPROJECT_HTTPS?.trim() === 'true';

Expand Down
Loading
Loading