create-portfoliable 1.0.3
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.
- package/bin/create-portfoliable.mjs +425 -0
- package/cli/portfoliable.mjs +836 -0
- package/index.html +18 -0
- package/package.json +102 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.png +0 -0
- package/scripts/check-updates.mjs +31 -0
- package/scripts/ensure-valence-index-css.mjs +245 -0
- package/scripts/generate-password-hash.mjs +25 -0
- package/scripts/release-orchestrator.mjs +363 -0
- package/scripts/scaffold-case.mjs +460 -0
- package/scripts/scaffold-consumer.mjs +87 -0
- package/scripts/smoke-homeview.mjs +133 -0
- package/scripts/smoke-initializer.mjs +129 -0
- package/scripts/smoke-packed.mjs +184 -0
- package/scripts/switch-valence-source.mjs +162 -0
- package/scripts/sync-template-shared.mjs +136 -0
- package/scripts/terminal-ui.mjs +274 -0
- package/scripts/verify-integration.mjs +72 -0
- package/src/App.js +10015 -0
- package/src/header-visibility.contract.js +31 -0
- package/src/header-visibility.contract.test.js +41 -0
- package/src/main.js +12 -0
- package/src/parser/markdown.js +855 -0
- package/src/style.css +88 -0
- package/templates/README.md +242 -0
- package/templates/configs/i18n/i18n.config.js +230 -0
- package/templates/configs/i18n/i18n.labels.js +188 -0
- package/templates/configs/portfoliable.a11y.config.js +262 -0
- package/templates/configs/portfoliable.design.config.js +651 -0
- package/templates/gitignore +9 -0
- package/templates/index.html +20 -0
- package/templates/public/api/.htaccess +4 -0
- package/templates/public/api/README.md +27 -0
- package/templates/public/api/password.config.example.json +16 -0
- package/templates/public/api/password.config.json +16 -0
- package/templates/public/api/unlock-case.php +56 -0
- package/templates/public/favicon.ico +0 -0
- package/templates/public/favicon.png +0 -0
- package/templates/public/portfoliable-logo.svg +3 -0
- package/templates/scripts/add-language.mjs +253 -0
- package/templates/scripts/convert-video-to-mp4.mjs +207 -0
- package/templates/scripts/convert-wav-to-mp3.mjs +184 -0
- package/templates/scripts/delete-case.mjs +320 -0
- package/templates/scripts/delete-language.mjs +195 -0
- package/templates/scripts/generate-password-hash.mjs +98 -0
- package/templates/scripts/i18n-config-utils.mjs +123 -0
- package/templates/scripts/scaffold-case.mjs +444 -0
- package/templates/scripts/sync-locales.mjs +1048 -0
- package/templates/scripts/validate-content.mjs +257 -0
- package/templates/scripts/validate-protection.mjs +187 -0
- package/templates/src/cases/index.js +188 -0
- package/templates/src/content/about/ABOUTME.md +202 -0
- package/templates/src/content/cases/template-case/case.md +479 -0
- package/templates/src/content/cases/template-case/cover.png +0 -0
- package/templates/src/content/cases/template-case/he-cover.png +0 -0
- package/templates/src/content/cases/template-case/template-audio.mp3 +0 -0
- package/templates/src/content/cases/template-case/template-video.mp4 +0 -0
- package/templates/src/content/thumbnail-options.generated.json +1044 -0
- package/templates/src/main.js +23 -0
- package/templates/src/parser/markdown.js +805 -0
- package/vite.config.js +111 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File: src/header-visibility.contract.js
|
|
2
|
+
// Purpose: Provide shared visibility resolution helpers for header state contracts.
|
|
3
|
+
// Author: Lio Schimanko
|
|
4
|
+
|
|
5
|
+
// MARK: CONTRACT RESOLUTION HELPERS
|
|
6
|
+
// Shared visibility helpers used by AppShell and unit tests.
|
|
7
|
+
|
|
8
|
+
// Resolves a visibility attribute using contract-first precedence with fallback and default values.
|
|
9
|
+
export function resolveHeaderVisibilityAttributeValue(contractValue, fallbackValue, defaultValue = undefined) {
|
|
10
|
+
if (contractValue !== null && typeof contractValue !== 'undefined') {
|
|
11
|
+
return contractValue;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (fallbackValue !== null && typeof fallbackValue !== 'undefined') {
|
|
15
|
+
return fallbackValue;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return defaultValue;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Enables required header controls for return-only mode and returns null for standard mode.
|
|
22
|
+
export function resolveReturnOnlyVisibilityOverrides(isReturnOnlyEnabled) {
|
|
23
|
+
if (!isReturnOnlyEnabled) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
showNavigationRegion: true,
|
|
29
|
+
showLanguageMenu: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// File: src/header-visibility.contract.test.js
|
|
2
|
+
// Purpose: Validate precedence and return-only semantics for header visibility helpers.
|
|
3
|
+
// Author: Lio Schimanko
|
|
4
|
+
|
|
5
|
+
// MARK: IMPORTS
|
|
6
|
+
import { describe, expect, it } from 'vitest';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
resolveHeaderVisibilityAttributeValue,
|
|
10
|
+
resolveReturnOnlyVisibilityOverrides,
|
|
11
|
+
} from './header-visibility.contract.js';
|
|
12
|
+
|
|
13
|
+
// MARK: CONTRACT TESTS
|
|
14
|
+
// Verifies precedence and override semantics for header visibility contract helpers.
|
|
15
|
+
describe('header visibility contract', () => {
|
|
16
|
+
// Contract values should always win over fallback values.
|
|
17
|
+
it('prefers explicit contract values over fallback values', () => {
|
|
18
|
+
expect(resolveHeaderVisibilityAttributeValue('false', 'true')).toBe('false');
|
|
19
|
+
expect(resolveHeaderVisibilityAttributeValue('true', 'false')).toBe('true');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Fallback should be used when contract value is intentionally missing.
|
|
23
|
+
it('uses fallback when contract is unset', () => {
|
|
24
|
+
expect(resolveHeaderVisibilityAttributeValue(null, 'false')).toBe('false');
|
|
25
|
+
expect(resolveHeaderVisibilityAttributeValue(undefined, 'true')).toBe('true');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Defaults should only be consulted when both previous tiers are absent.
|
|
29
|
+
it('uses default when both contract and fallback are unset', () => {
|
|
30
|
+
expect(resolveHeaderVisibilityAttributeValue(undefined, undefined, 'true')).toBe('true');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Return-only mode injects explicit overrides to keep required controls visible.
|
|
34
|
+
it('only forces visibility overrides in return-only mode', () => {
|
|
35
|
+
expect(resolveReturnOnlyVisibilityOverrides(false)).toBeNull();
|
|
36
|
+
expect(resolveReturnOnlyVisibilityOverrides(true)).toEqual({
|
|
37
|
+
showNavigationRegion: true,
|
|
38
|
+
showLanguageMenu: true,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
package/src/main.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File: src/main.js
|
|
2
|
+
// Purpose: Boot the Portfoliable application shell in the browser.
|
|
3
|
+
// Author: Lio Schimanko
|
|
4
|
+
|
|
5
|
+
// MARK: RUNTIME ENTRY IMPORTS
|
|
6
|
+
import '../templates/configs/i18n/i18n.config.js';
|
|
7
|
+
import './App.js';
|
|
8
|
+
import './style.css';
|
|
9
|
+
|
|
10
|
+
// MARK: APP MOUNT
|
|
11
|
+
// Mount the custom element that renders the runtime shell.
|
|
12
|
+
document.getElementById('app').innerHTML = `<app-shell></app-shell>`;
|