Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/module-app-navigation_fusion-lint-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@equinor/fusion-framework-module-app": patch
"@equinor/fusion-framework-module-navigation": patch
---

Internal: address fusion-lint warnings — mark `FrameworkOptionsSchema` as intentionally co-located per the file's existing convention, and add intent comments to `NavigationProvider`'s path-normalization loops.
9 changes: 9 additions & 0 deletions .github/actions/build-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ runs:
shell: bash
run: pnpm build --continue

# Checkout pins `ref` to the PR head SHA, so it only fetches that commit's
# history — `main` never becomes a resolvable ref locally. `git fetch`
# alone only populates FETCH_HEAD, so fetch straight into a local branch
# ref, which is what turbo's merge-base lookup requires.
- name: Fetch main for affected detection
if: ${{ inputs.only-affected == 'true' }}
shell: bash
run: git fetch origin main:main

- name: Build project [affected]
if: ${{ inputs.only-affected == 'true' }}
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions packages/modules/app/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const ApiApplicationPersonSchema = z.object({
* at runtime without requiring them to be declared here. Add known properties
* to this schema as they are introduced.
*/
// Deliberately co-located with ApiApplicationBuildSchema, which depends on it
// fusion-lint-disable-next-line single-export-per-file
export const FrameworkOptionsSchema = z
.object({
contextRouting: z
Expand Down
4 changes: 4 additions & 0 deletions packages/modules/navigation/src/NavigationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ const normalizePathname = (path: string): string => {
let result = '';
let lastWasSlash = false;

// Walk each character once to collapse runs of slashes in a single pass
for (let i = 0; i < path.length; i++) {
const char = path[i];
// Only slashes need de-duplication; every other character passes through
if (char === '/') {
// Keep the first slash of a run, drop the rest
if (!lastWasSlash) {
result += char;
lastWasSlash = true;
Expand Down Expand Up @@ -67,6 +70,7 @@ const normalizePathname = (path: string): string => {
const stripTrailingSlashes = (path: string): string => {
// Use iterative approach to avoid ReDoS vulnerability
let endIndex = path.length;
// Shrink endIndex past every trailing slash
while (endIndex > 0 && path[endIndex - 1] === '/') {
endIndex--;
}
Expand Down
Loading