Skip to content

Commit 8ae9a4b

Browse files
committed
chore: move internal docs to a private internal/ companion repo
Consolidate all gitignored reference material (fedex-docs/, documentation.yaml, build brief, ADRs, planning specs, scaffold guidance) under a single internal/ directory, which is its own private git repo (nodrel-dev/n8n-fedex-node-internal) and is gitignored here. Collapses ~10 .gitignore entries to one (/internal/), keeps the docs colocated in the working tree, and adds bootstrap-internal.sh to restore them on a fresh clone. Updates the internal/ path references in CLAUDE.md and two code comments. No published artifact changes.
1 parent fd6d378 commit 8ae9a4b

5 files changed

Lines changed: 62 additions & 33 deletions

File tree

.gitignore

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,12 @@ fedex-docs/.DS_Store
146146
# macOS
147147
.DS_Store
148148

149-
# Internal planning/reference — kept local, never published
150-
/specs/
151-
/.specify/
149+
# Internal docs, reference specs & planning — consolidated under internal/, which is
150+
# its own private git repo (nodrel-dev/n8n-fedex-node-internal). Never published.
151+
# Run ./bootstrap-internal.sh on a fresh clone to restore it. See CLAUDE.md.
152+
/internal/
153+
154+
# Local Claude session dir + machine-local runtime state (never leave this machine)
152155
/.claude/
153-
/.agents/
154-
/fedex-docs/
155-
/docs/adr/
156-
/docs/manual-review-video-script.md
157-
/scripts/n8n-demo.sh
158-
/AGENTS.md
159-
/fedex-node-build-brief.md
160-
/documentation.yaml
161156
dev.sh
162157
.jwt-secret

CLAUDE.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ accounts hit the carrier API with their own rates. npm has no direct FedEx node
1212
done, `pnpm build` + `pnpm lint` verified green-toolchain. The node still contains the
1313
**placeholder `User`/`Company` resources** — these must be replaced with the four real operations.
1414
The full spec, decided scope, API map, and acceptance criteria live in
15-
**`fedex-node-build-brief.md`** (read it first). All doc links are centralized in
16-
**`documentation.yaml`** — consult it before web-searching for any FedEx or n8n reference. The
17-
scaffold's own n8n build guidance lives in **`AGENTS.md`** + **`.agents/*.md`** (load the relevant
18-
`.agents/` file before editing nodes/credentials — see the table in `AGENTS.md`).
19-
20-
**The FedEx docs are captured locally in `fedex-docs/` — do not web-search FedEx, read these.**
21-
The `.md` files are the portal prose; **`fedex-docs/json-schemas/*.json` are the OpenAPI specs and
22-
are AUTHORITATIVE** for request/response field names, enums, and nesting. `documentation.yaml`
15+
**`internal/fedex-node-build-brief.md`** (read it first). All doc links are centralized in
16+
**`internal/documentation.yaml`** — consult it before web-searching for any FedEx or n8n reference. The
17+
scaffold's own n8n build guidance lives in **`internal/AGENTS.md`** + **`internal/.agents/*.md`** (load the relevant
18+
`internal/.agents/` file before editing nodes/credentials — see the table in `internal/AGENTS.md`).
19+
20+
**The FedEx docs are captured locally in `internal/fedex-docs/` — do not web-search FedEx, read these.**
21+
The `.md` files are the portal prose; **`internal/fedex-docs/json-schemas/*.json` are the OpenAPI specs and
22+
are AUTHORITATIVE** for request/response field names, enums, and nesting. `internal/documentation.yaml`
2323
maps each operation to its `local_md` + `local_schema` and lists the confirmed Ship label enums
2424
and a MIME map. The portal pages require login, so the captured specs are the working source.
2525

@@ -69,7 +69,7 @@ against `ship.json` — the leaf is `LabelResponseVO`, which also carries `track
6969
the chosen `imageType` (`PDF``application/pdf`, `PNG``image/png`, `ZPLII`/`EPL2`
7070
`application/octet-stream`) and a sensible filename (e.g. `label-<trackingNumber>.pdf`). Pass the
7171
JSON (tracking number, rates) through on the main output. Send `labelResponseOptions: LABEL` to get
72-
the base64 inline (vs `URL_ONLY`). The full confirmed enum lists are in `documentation.yaml`.
72+
the base64 inline (vs `URL_ONLY`). The full confirmed enum lists are in `internal/documentation.yaml`.
7373

7474
**Auth — the scaffold uses n8n's built-in OAuth2.** The generated credential
7575
`FedexOAuth2Api` (`credentials/FedexOAuth2Api.credentials.ts`, credential name `fedexOAuth2Api`)
@@ -88,41 +88,45 @@ What still needs fixing before it works:
8888
- The node's `requestDefaults.baseURL` is likewise hardcoded to prod — tie it to the same env choice.
8989

9090
`client_id`/`client_secret` map to the FedEx **API Key / Secret Key**. FedEx errors: surface
91-
`errors[].message`; treat `4xx` validation distinctly. Exact OAuth shape: `documentation.yaml``fedex.auth`.
91+
`errors[].message`; treat `4xx` validation distinctly. Exact OAuth shape: `internal/documentation.yaml``fedex.auth`.
9292

9393
**Account number is sensitive and required for Rate + Ship.** Source it from the credential or a
9494
node field — never a default, never hardcoded. Same for API keys and base URLs.
9595

96-
**File layout (scaffolded).** Package lives at repo root; reference docs (`fedex-docs/`,
97-
`documentation.yaml`, `fedex-node-build-brief.md`) sit alongside but are excluded from the npm
98-
tarball (`package.json` `files: ["dist"]`). The node is `nodes/Fedex/Fedex.node.ts`; per-resource
96+
**File layout (scaffolded).** Package lives at repo root. All internal reference docs, specs, and
97+
planning live under **`internal/`**, which is gitignored by this public repo and is **its own
98+
private git repo** (`nodrel-dev/n8n-fedex-node-internal`). On a fresh clone, restore it with
99+
`./bootstrap-internal.sh`; commit doc changes from inside `internal/`, code changes from the root.
100+
The reference docs (`internal/fedex-docs/`, `internal/documentation.yaml`,
101+
`internal/fedex-node-build-brief.md`) are also excluded from the npm tarball (`package.json`
102+
`files: ["dist"]`). The node is `nodes/Fedex/Fedex.node.ts`; per-resource
99103
descriptions live in `nodes/Fedex/resources/<resource>/`. The two resources **mirror the two FedEx
100104
dev-portal projects / credentials** (ADR-0004): `tracking/` holding **Track** (binds
101105
`fedexTrackOAuth2Api`), and `shipping/` holding **Get Rates**, **Create**, and **Validate** (binds
102106
`fedexShippingOAuth2Api` — the shipping project bundles Rate + Ship + Address Validation under one
103107
key). Resource = FedEx project, operation = verb; credentials bind per operation (operation values
104108
are globally unique). Keep files focused (<800 lines), one resource per folder, so operations stay
105109
independent and the pattern is reusable for a future UPS package. The rationale behind the resource
106-
model and the sandbox/production credential design is captured in the local `docs/adr/` notes (kept
107-
out of the published repo, like `fedex-docs/` and `documentation.yaml`).
110+
model and the sandbox/production credential design is captured in the local `internal/docs/adr/` notes (kept
111+
out of the published repo, like `internal/fedex-docs/` and `internal/documentation.yaml`).
108112

109113
## Hard constraints (these will fail the build / lint if violated)
110114

111115
- **pnpm only.** npm breaks the install.
112116
- **Do not modify the eslint config**`n8n-node lint --strict` fails if it differs from default.
113117
- **Verify FedEx field names / paths against live docs** before coding each operation — versions
114-
drift. `documentation.yaml` flags which entries need re-verification (`verify: true`).
118+
drift. `internal/documentation.yaml` flags which entries need re-verification (`verify: true`).
115119
- Surface the real FedEx error (`errors[].message`) via `NodeApiError` / `NodeOperationError`;
116120
honor n8n's **Continue On Fail**.
117121
- Package must be named `n8n-nodes-fedex`, include the `n8n-community-node-package` keyword, and
118122
declare the `n8n` config block pointing at built nodes + credentials.
119123

120124
## Reference shortcuts
121125

122-
- Full spec & acceptance criteria → `fedex-node-build-brief.md`
123-
- All doc URLs, local doc map, confirmed endpoints/enums, OAuth shape → `documentation.yaml`
124-
- FedEx request/response shapes → `fedex-docs/json-schemas/*.json` (OpenAPI, authoritative);
125-
prose → `fedex-docs/*.md`. Operation→file mapping is in `documentation.yaml`.
126+
- Full spec & acceptance criteria → `internal/fedex-node-build-brief.md`
127+
- All doc URLs, local doc map, confirmed endpoints/enums, OAuth shape → `internal/documentation.yaml`
128+
- FedEx request/response shapes → `internal/fedex-docs/json-schemas/*.json` (OpenAPI, authoritative);
129+
prose → `internal/fedex-docs/*.md`. Operation→file mapping is in `internal/documentation.yaml`.
126130
- Live n8n SDK types (`INodeType`, `INodeTypeDescription`, `IExecuteFunctions`, `ICredentialType`)
127131
→ prefer the n8n-mcp (MCP_DOCKER) or Context7 MCP tools over recalling from memory.
128132

bootstrap-internal.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Restores the private internal/ docs repo into this working tree.
4+
#
5+
# The public repo gitignores internal/ — it is its own private companion repo
6+
# (nodrel-dev/n8n-fedex-node-internal) holding the captured FedEx specs, build
7+
# brief, doc map, ADRs, and planning. Run this once after a fresh clone.
8+
#
9+
# Usage:
10+
# ./bootstrap-internal.sh # uses the default SSH remote below
11+
# ./bootstrap-internal.sh <git-remote> # override (e.g. an HTTPS URL)
12+
set -euo pipefail
13+
14+
REMOTE="${1:-git@github.com:nodrel-dev/n8n-fedex-node-internal.git}"
15+
DIR="internal"
16+
17+
if [ -e "$DIR/.git" ]; then
18+
echo "internal/ is already a git repo — pulling latest instead."
19+
git -C "$DIR" pull --ff-only
20+
exit 0
21+
fi
22+
23+
if [ -e "$DIR" ] && [ -n "$(ls -A "$DIR" 2>/dev/null)" ]; then
24+
echo "ERROR: ./$DIR exists and is non-empty but is not a git repo." >&2
25+
echo "Move or remove it first, then re-run." >&2
26+
exit 1
27+
fi
28+
29+
git clone "$REMOTE" "$DIR"
30+
echo "✓ Restored internal/ from $REMOTE"

nodes/Fedex/cores/extractLabel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface LabelMime {
99
ext: string;
1010
}
1111

12-
// encodedLabel imageType -> binary MIME type + file extension (confirmed in documentation.yaml).
12+
// encodedLabel imageType -> binary MIME type + file extension (confirmed in internal/documentation.yaml).
1313
export const LABEL_MIME: Record<string, LabelMime> = {
1414
PDF: { mime: 'application/pdf', ext: 'pdf' },
1515
PNG: { mime: 'image/png', ext: 'png' },

nodes/Fedex/cores/fedexTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Typed FedEx request shapes produced by the pure cores (ADR-0003). These mirror
2-
// the authoritative OpenAPI specs in fedex-docs/json-schemas and are intentionally
2+
// the authoritative OpenAPI specs in internal/fedex-docs/json-schemas and are intentionally
33
// free of any n8n coupling so the cores stay unit-testable in isolation.
44

55
export interface FedexAddress {

0 commit comments

Comments
 (0)