@networkpro/web 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.browserslistrc +5 -0
  2. package/.editorconfig +65 -0
  3. package/.env.template +18 -0
  4. package/.gitattributes +212 -0
  5. package/.github/COMMIT_GUIDE.md +31 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.yml +74 -0
  7. package/.github/ISSUE_TEMPLATE/config.yml +32 -0
  8. package/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
  9. package/.github/ISSUE_TEMPLATE/legal_review.yml +53 -0
  10. package/.github/workflows/auto-assign.yml +36 -0
  11. package/.github/workflows/backup-branch.yml +40 -0
  12. package/.github/workflows/build-and-publish.yml +202 -0
  13. package/.github/workflows/check-codeql.yml +40 -0
  14. package/.github/workflows/check-security-txt-expirty.yml +46 -0
  15. package/.github/workflows/dependency-review.yml +22 -0
  16. package/.github/workflows/lighthouse.yml +163 -0
  17. package/.github/workflows/playwright.yml +66 -0
  18. package/.github/workflows/publish-test.yml +215 -0
  19. package/.github/workflows/templates/check-codeql.template.yml +47 -0
  20. package/.lighthouserc.cjs +37 -0
  21. package/.markdownlint.mjs +31 -0
  22. package/.md-smart-quotes.js +31 -0
  23. package/.node-version +1 -0
  24. package/.nvmrc +1 -0
  25. package/.prettierignore +55 -0
  26. package/.prettierrc +35 -0
  27. package/.stylelintignore +43 -0
  28. package/.svelte-kit/tsconfig.json +49 -0
  29. package/.vscode/customData.json +73 -0
  30. package/.vscode/extensions.json +13 -0
  31. package/.vscode/extensions.jsonc +24 -0
  32. package/.vscode/settings.json +80 -0
  33. package/CHANGELOG.md +19 -1
  34. package/package.json +1 -1
  35. package/src/lib/components/ui/.gitkeep +0 -0
  36. package/src/routes/...404/+page.svelte +26 -0
  37. package/static/.well-known/dnt-policy.txt +218 -0
  38. package/static/.well-known/gpc.json +4 -0
  39. package/static/.well-known/humans.txt +21 -0
  40. package/static/.well-known/security.txt +12 -0
  41. package/static/.well-known/security.txt.sig +7 -0
@@ -0,0 +1,202 @@
1
+ # .github/workflows/build-and-publish.yml
2
+ #
3
+ # Copyright © 2025 Network Pro Strategies (Network Pro™)
4
+ # SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
+ # This file is part of Network Pro
6
+
7
+ name: Build and Publish to Registries
8
+
9
+ on:
10
+ release:
11
+ types: [created]
12
+ workflow_dispatch:
13
+
14
+ # Allow one concurrent deployment
15
+ concurrency:
16
+ group: 'build-and-publish'
17
+ cancel-in-progress: true
18
+
19
+ permissions:
20
+ actions: read
21
+ contents: read
22
+
23
+ jobs:
24
+ check-codeql:
25
+ uses: ./.github/workflows/check-codeql.yml
26
+
27
+ build:
28
+ needs: check-codeql
29
+ runs-on: ubuntu-24.04
30
+ env:
31
+ ENV_MODE: ci
32
+
33
+ steps:
34
+ - name: Checkout repository
35
+ uses: actions/checkout@v4
36
+
37
+ - name: Set up Node.js
38
+ uses: actions/setup-node@v4
39
+ with:
40
+ node-version: 24
41
+ cache: npm
42
+ cache-dependency-path: package-lock.json
43
+
44
+ - name: Upgrade npm
45
+ run: |
46
+ corepack enable
47
+ npm install -g npm@11.4.1
48
+
49
+ - name: Install Node.js dependencies
50
+ run: npm ci
51
+
52
+ - name: Install jq
53
+ run: sudo apt-get install -y jq
54
+
55
+ - name: Run JSDoc lint check
56
+ id: jsdoc_lint
57
+ continue-on-error: true
58
+ run: |
59
+ set -e
60
+ output=$(npm run lint:jsdoc || true)
61
+ echo "$output"
62
+
63
+ count=$(echo "$output" | wc -l)
64
+ echo "jsdoc_count=$count" >> "$GITHUB_OUTPUT"
65
+
66
+ - name: ✅ Pass
67
+ if: steps.jsdoc_lint.outputs.jsdoc_count == '0'
68
+ run: echo "JSDoc lint passed successfully!"
69
+
70
+ - name: ⚠️ JSDoc violations detected (non-blocking)
71
+ if: steps.jsdoc_lint.outputs.jsdoc_count != '0'
72
+ run: echo "⚠️ JSDoc lint check failed with ${{ steps.jsdoc_lint.outputs.jsdoc_count }} violations (non-blocking)"
73
+
74
+ # Test to ensure the package is working
75
+ - name: Build Node.js project
76
+ run: npm run build
77
+
78
+ # Create Git archive of version-controlled files
79
+ - name: Create clean source archive
80
+ run: git archive --format=tar.gz --output=clean-source.tar.gz HEAD
81
+
82
+ - name: Upload source archive
83
+ uses: actions/upload-artifact@v4
84
+ with:
85
+ name: clean-source
86
+ path: clean-source.tar.gz
87
+
88
+ publish-npmjs:
89
+ needs: build
90
+ runs-on: ubuntu-24.04
91
+ env:
92
+ ENV_MODE: ci
93
+
94
+ steps:
95
+ - name: Download clean source archive
96
+ uses: actions/download-artifact@v4
97
+ with:
98
+ name: clean-source
99
+ path: ./
100
+
101
+ - name: Extract source archive
102
+ run: tar -xzf clean-source.tar.gz
103
+
104
+ - name: Remove extracted source archive
105
+ run: rm clean-source.tar.gz
106
+
107
+ - name: Set up Node.js for npmjs
108
+ uses: actions/setup-node@v4
109
+ with:
110
+ node-version: 24
111
+ registry-url: https://registry.npmjs.org/
112
+ cache: npm
113
+ cache-dependency-path: package-lock.json
114
+
115
+ - name: Upgrade npm
116
+ run: |
117
+ corepack enable
118
+ npm install -g npm@11.4.1
119
+
120
+ - name: Install Node.js dependencies
121
+ run: npm ci
122
+
123
+ - name: Set up Git user
124
+ run: |
125
+ git config --global user.email "github@sl.neteng.cc"
126
+ git config --global user.name "SunDevil311"
127
+
128
+ - name: Verify version not already published
129
+ run: |
130
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
131
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
132
+ echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION is already published..."
133
+
134
+ npm view $PACKAGE_NAME@$PACKAGE_VERSION > /dev/null && {
135
+ echo "❌ Version $PACKAGE_VERSION already exists on npm. Exiting..."
136
+ exit 1
137
+ } || echo "✅ Version is new. Proceeding with publish."
138
+
139
+ - name: Publish package to npmjs
140
+ run: npm publish --access public
141
+ env:
142
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_NETPRO }}
143
+
144
+ publish-gpr:
145
+ needs: build
146
+ runs-on: ubuntu-24.04
147
+ env:
148
+ ENV_MODE: ci
149
+
150
+ steps:
151
+ - name: Download clean source archive
152
+ uses: actions/download-artifact@v4
153
+ with:
154
+ name: clean-source
155
+ path: ./
156
+
157
+ - name: Extract source archive
158
+ run: tar -xzf clean-source.tar.gz
159
+
160
+ - name: Remove extracted source archive
161
+ run: rm clean-source.tar.gz
162
+
163
+ - name: Set up Node.js for GPR
164
+ uses: actions/setup-node@v4
165
+ with:
166
+ node-version: 24
167
+ registry-url: https://npm.pkg.github.com/
168
+ cache: npm
169
+ cache-dependency-path: package-lock.json
170
+
171
+ - name: Upgrade npm
172
+ run: |
173
+ corepack enable
174
+ npm install -g npm@11.4.1
175
+
176
+ - name: Install Node.js dependencies
177
+ run: npm ci
178
+
179
+ - name: Set up Git user
180
+ run: |
181
+ git config --global user.email "github@sl.neteng.cc"
182
+ git config --global user.name "SunDevil311"
183
+
184
+ - name: Update package name for GPR
185
+ run: |
186
+ sed -i 's/"name": ".*"/"name": "@netwk-pro\/web"/' package.json
187
+
188
+ - name: Verify version not already published
189
+ run: |
190
+ PACKAGE_NAME=$(node -p "require('./package.json').name")
191
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
192
+ echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION is already published..."
193
+
194
+ npm view $PACKAGE_NAME@$PACKAGE_VERSION > /dev/null && {
195
+ echo "❌ Version $PACKAGE_VERSION already exists on npm. Exiting..."
196
+ exit 1
197
+ } || echo "✅ Version is new. Proceeding with publish."
198
+
199
+ - name: Publish package to GPR
200
+ run: npm publish
201
+ env:
202
+ NODE_AUTH_TOKEN: ${{ secrets.NWPRO_GPR }}
@@ -0,0 +1,40 @@
1
+ # .github/workflows/check-codeql.template.yml
2
+ #
3
+ # Copyright © 2025 Network Pro Strategies (Network Pro™)
4
+ # SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
+ # This file is part of Network Pro
6
+
7
+ name: CodeQL Status Check
8
+
9
+ permissions:
10
+ actions: read
11
+ contents: read
12
+
13
+ on:
14
+ workflow_call:
15
+
16
+ jobs:
17
+ check:
18
+ name: Check CodeQL Status
19
+ runs-on: ubuntu-24.04
20
+
21
+ steps:
22
+ - name: Check CodeQL Workflow
23
+ env:
24
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25
+ run: |
26
+ gh --version
27
+
28
+ if ! gh run list --repo "${GITHUB_REPOSITORY}" --workflow "CodeQL" --limit 1 --json conclusion --jq '.[0].conclusion' > codeql_status.txt; then
29
+ echo "::error title=CodeQL Check Failed::Could not retrieve CodeQL run status. Blocking deployment."
30
+ exit 1
31
+ fi
32
+
33
+ CODEQL_STATUS=$(cat codeql_status.txt)
34
+ echo "CodeQL status: $CODEQL_STATUS"
35
+ if [[ "$CODEQL_STATUS" != "success" ]]; then
36
+ echo "::error title=CodeQL Check Failed::Latest CodeQL run did not succeed. Blocking deployment."
37
+ exit 1
38
+ fi
39
+
40
+ rm -f codeql_status.txt
@@ -0,0 +1,46 @@
1
+ name: Check security.txt expiry
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 7 * * 0' # Every Sunday at 0700 UTC (midnight MST)
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ check-expiry:
13
+ runs-on: ubuntu-latest
14
+ name: Validate .well-known/security.txt expiration
15
+
16
+ steps:
17
+ - name: Checkout repo
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Check security.txt expiration
21
+ run: |
22
+ FILE=".well-known/security.txt"
23
+ if [ ! -f "$FILE" ]; then
24
+ echo "::error ::security.txt file not found!"
25
+ exit 1
26
+ fi
27
+
28
+ EXP_DATE=$(grep -i '^Expires:' "$FILE" | cut -d' ' -f2- | tr -d '\r')
29
+ if [ -z "$EXP_DATE" ]; then
30
+ echo "::error ::Expires field not found in security.txt"
31
+ exit 1
32
+ fi
33
+
34
+ EXP_TIMESTAMP=$(date --utc --date="$EXP_DATE" +%s || true)
35
+ NOW_TIMESTAMP=$(date --utc +%s)
36
+ SECONDS_LEFT=$(( EXP_TIMESTAMP - NOW_TIMESTAMP ))
37
+ DAYS_LEFT=$(( SECONDS_LEFT / 86400 ))
38
+
39
+ if [ "$DAYS_LEFT" -lt 0 ]; then
40
+ echo "::error ::security.txt has expired!"
41
+ exit 1
42
+ elif [ "$DAYS_LEFT" -lt 30 ]; then
43
+ echo "::warning ::security.txt expires in less than 30 days ($DAYS_LEFT days left)"
44
+ else
45
+ echo "✅ security.txt is valid for another $DAYS_LEFT days."
46
+ fi
@@ -0,0 +1,22 @@
1
+ # .github/workflows/dependency-review.yml
2
+ #
3
+ # Copyright © 2025 Network Pro Strategies (Network Pro™)
4
+ # SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
+ # This file is part of Network Pro
6
+
7
+ name: 'Dependency Review'
8
+ on: [pull_request]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ dependency-review:
15
+ runs-on: ubuntu-24.04
16
+
17
+ steps:
18
+ - name: 'Checkout Repository'
19
+ uses: actions/checkout@v4
20
+
21
+ - name: 'Dependency Review'
22
+ uses: actions/dependency-review-action@v4
@@ -0,0 +1,163 @@
1
+ # .github/workflows/lighthouse.yml
2
+ #
3
+ # Copyright © 2025 Network Pro Strategies (Network Pro™)
4
+ # SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
+ # This file is part of Network Pro
6
+
7
+ name: Lighthouse Audit
8
+
9
+ on:
10
+ push:
11
+ branches: [master]
12
+ pull_request:
13
+ branches: [master]
14
+ workflow_dispatch:
15
+
16
+ # cspell:ignore tostring
17
+
18
+ # Sets permissions of the GITHUB_TOKEN to allow read access to repo and write
19
+ # permission for PRs for comment summary
20
+ permissions:
21
+ contents: read
22
+ pull-requests: write
23
+
24
+ jobs:
25
+ audit:
26
+ name: Run Lighthouse CI
27
+ runs-on: ubuntu-24.04
28
+ env:
29
+ ENV_MODE: ci
30
+ timeout-minutes: 10
31
+
32
+ steps:
33
+ - name: Checkout Repository
34
+ uses: actions/checkout@v4
35
+
36
+ - name: Authenticate GitHub CLI
37
+ run: gh auth status
38
+ env:
39
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ - name: Log ENV_MODE
42
+ run: 'echo "ENV_MODE is set to: $ENV_MODE"'
43
+
44
+ - name: Setup Node.js
45
+ uses: actions/setup-node@v4
46
+ with:
47
+ node-version: lts/*
48
+ check-latest: true
49
+ cache: npm
50
+ cache-dependency-path: package-lock.json
51
+
52
+ - name: Upgrade npm
53
+ run: |
54
+ corepack enable
55
+ npm install -g npm@11.4.1
56
+
57
+ - name: Clean previous Lighthouse reports
58
+ run: |
59
+ if [ -d ".lighthouseci" ]; then
60
+ COUNT=$(find .lighthouseci -type f | wc -l)
61
+ echo "🧹 Removing $COUNT file(s) from .lighthouseci/"
62
+ rm -rf .lighthouseci
63
+ else
64
+ echo "🧹 No previous .lighthouseci/ directory to clean."
65
+ fi
66
+
67
+ - name: Install Dependencies
68
+ run: npm ci
69
+
70
+ - name: Build Site
71
+ run: npm run build
72
+
73
+ - name: Install Google Chrome
74
+ run: |
75
+ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
76
+ sudo apt install -y ./google-chrome-stable_current_amd64.deb
77
+
78
+ - name: Record Chrome version and timestamp
79
+ run: |
80
+ mkdir -p .lighthouseci
81
+ {
82
+ echo "Chrome Version: $(google-chrome --version)"
83
+ echo "Audit Timestamp: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
84
+ } > .lighthouseci/chrome-version.txt
85
+
86
+ - name: Collect Lighthouse results
87
+ run: |
88
+ npx @lhci/cli collect \
89
+ --chrome-path="$(which google-chrome)" \
90
+ --config=.lighthouserc.cjs
91
+
92
+ - name: Log Chrome version used
93
+ run: cat .lighthouseci/chrome-version.txt
94
+
95
+ - name: Check for budget.json
96
+ run: |
97
+ if [ ! -f budget.json ]; then
98
+ echo "❌ ERROR: budget.json not found. LHCI budget assertions will be skipped."
99
+ exit 1
100
+ else
101
+ echo "✅ Found budget.json"
102
+ fi
103
+
104
+ - name: Assert Lighthouse results (non-blocking)
105
+ run: npx @lhci/cli assert --config=.lighthouserc.cjs
106
+ continue-on-error: true
107
+
108
+ - name: Annotate and Comment on Lighthouse Budget Failures
109
+ if: always()
110
+ continue-on-error: true
111
+ env:
112
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113
+ run: |
114
+ REPORT=$(ls -t .lighthouseci/*.report.json .lighthouseci/lhr-*.json 2>/dev/null | head -n 1)
115
+
116
+ if [ -z "$REPORT" ]; then
117
+ echo "::warning ::No valid Lighthouse report found for annotation step."
118
+ exit 0
119
+ fi
120
+
121
+ echo "🔍 Parsing $REPORT for failing audits..."
122
+
123
+ if ! jq -e '.audits' "$REPORT" > /dev/null; then
124
+ echo "::warning ::The selected report is not a valid Lighthouse output (missing .audits key)."
125
+ exit 0
126
+ fi
127
+
128
+ FAILURES=$(jq -r '.audits | to_entries[] | select(.value.score < 1 and .value.score != null) | [.key, .value.title, (.value.score | tostring)] | @tsv' "$REPORT")
129
+
130
+ if [ -z "$FAILURES" ]; then
131
+ echo "✅ No failing audits found. Lighthouse budgets passed."
132
+ exit 0
133
+ fi
134
+
135
+ echo "⚠️ Failing Lighthouse audits:"
136
+ COMMENT_BODY="### ⚠️ Lighthouse Budget Issues Detected"
137
+
138
+ while IFS=$'\t' read -r key title score; do
139
+ echo "::warning file=.lighthouseci/report.json,line=1,title=Lighthouse Budget Issue::$title (score: $score)"
140
+ COMMENT_BODY="${COMMENT_BODY}"$'\n'"- ${title} (score: ${score})"
141
+ done <<< "$FAILURES"
142
+
143
+ COMMENT_BODY="${COMMENT_BODY}"$'\n\n'"View the full report in the workflow artifacts or in \`.lighthouseci/report.html\`."
144
+
145
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
146
+ gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT_BODY" || echo "::warning ::Failed to post PR comment"
147
+ else
148
+ echo "Not a PR — skipping GitHub comment post."
149
+ fi
150
+
151
+ - name: Upload Lighthouse results
152
+ run: npx @lhci/cli upload --config=.lighthouserc.cjs
153
+
154
+ - name: List contents of .lighthouseci
155
+ run: ls -al .lighthouseci
156
+
157
+ - name: Upload full .lighthouseci output
158
+ uses: actions/upload-artifact@v4
159
+ with:
160
+ name: lighthouse-reports
161
+ path: .lighthouseci/
162
+ include-hidden-files: true
163
+ if-no-files-found: error
@@ -0,0 +1,66 @@
1
+ # .github/workflows/playwright.yml
2
+ #
3
+ # Copyright © 2025 Network Pro Strategies (Network Pro™)
4
+ # SPDX-License-Identifier: CC-BY-4.0 OR GPL-3.0-or-later
5
+ # This file is part of Network Pro
6
+
7
+ name: Playwright Tests
8
+ on:
9
+ push:
10
+ branches: [master]
11
+ pull_request:
12
+ branches: [master]
13
+ workflow_dispatch:
14
+
15
+ # ✅ Least-privilege access
16
+ permissions:
17
+ contents: read # Required for actions/checkout
18
+
19
+ jobs:
20
+ test:
21
+ timeout-minutes: 30
22
+ runs-on: ubuntu-24.04
23
+ env:
24
+ NODE_ENV: test
25
+ ENV_MODE: ci
26
+
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+
31
+ - name: Log ENV_MODE
32
+ run: 'echo "ENV_MODE is set to: $ENV_MODE"'
33
+
34
+ - name: Set up Node.js
35
+ uses: actions/setup-node@v4
36
+ with:
37
+ node-version: lts/*
38
+ check-latest: true
39
+ cache: npm
40
+ cache-dependency-path: package-lock.json
41
+
42
+ - name: Upgrade npm
43
+ run: |
44
+ corepack enable
45
+ npm install -g npm@11.4.1
46
+
47
+ - name: Install Node.js dependencies
48
+ run: npm ci
49
+
50
+ - name: Build site
51
+ run: npm run build
52
+
53
+ - name: Install Playwright Browsers
54
+ run: npx playwright install --with-deps
55
+
56
+ - name: Run Playwright tests
57
+ run: NODE_ENV=test npx playwright test
58
+
59
+ - name: Upload Playwright report
60
+ if: always()
61
+ uses: actions/upload-artifact@v4
62
+ with:
63
+ name: playwright-report
64
+ path: playwright-report/
65
+ if-no-files-found: ignore
66
+ retention-days: 30