@portfoliable/create
v0.7.0
Published
Unified Portfoliable package with initializer and runtime CLI
Maintainers
Readme
@portfoliable/create User Manual
This guide is the end-user instruction manual for projects created with:
npm create @portfoliableUse this document after scaffolding to run, customize, validate, and ship your portfolio application.
1. What This Tool Creates
The initializer generates a Vite-based portfolio app with:
- app shell and UI wiring
- case markdown loading and parsing pipeline
- content validation commands
- build and preview scripts
- case scaffolding utilities
2. Prerequisites
Before creating a project:
- install Node.js 18 or newer
- verify npm is available
- use a writable local directory
- ensure internet access for package download
Check your environment:
node -v
npm -v3. Create a New Portfolio Project
Scaffold a new app:
npm create @portfoliable my-portfolioMove into the project:
cd my-portfolioStart development mode:
npm run portfoliable4. Initializer Flags
Pass flags after --:
npm create @portfoliable my-portfolio -- --no-install
npm create @portfoliable my-portfolio -- --forceFlag reference:
--no-install: scaffold files without installing dependencies--force: allow overwrite when target exists
5. Generated Commands
Your generated project includes these scripts:
npm run portfoliable- run local development servernpm run portfoliable-build- create production buildnpm run portfoliable-preview- preview production outputnpm run portfoliable-thumbnail-options- inspect available thumbnail device optionsnpm run portfoliable-create-case- create new starter case filenpm run portfoliable-scaffold-case- legacy alias for case creation
6. Daily Development Workflow
Recommended sequence:
- run dev server
- edit case markdown content and assets
- validate content contract
- build and preview before publishing
Typical command flow:
npm run portfoliable
npm run portfoliable-build
npm run portfoliable-preview6.1 View Transitions (Home to Case)
Generated apps use a single-page flow:
- Home route renders
ds-home-viewwith gallery thumbnails. - Clicking a thumbnail transitions in-place to
ds-case-view. - Case route keeps breadcrumb navigation (
Back,Home, active case title) and usesds-articlefor long-form content.
Transition behavior:
- default motion is subtle slide + fade + scale for an Apple-like minimal feel
Reduce Motionaccessibility mode disables transition motion automatically- browser
prefers-reduced-motionis also respected
This means users never leave the app shell while navigating between overview and case detail views.
7. Content Structure and Contract
Case files are stored as markdown under the generated content directory.
Each case requires frontmatter with localized fields:
idslugtitle.enandtitle.ptshortDesc.enandshortDesc.ptreadTime.enandreadTime.ptyear.enandyear.ptthumbSrc.enandthumbSrc.pt
Optional but commonly used fields include:
desc.enanddesc.ptdescRecruiterrepositoryUrlliveUrlvideoSrcvttSrcaudioSrcaudioSrcRecruiter
For framed thumbnails, configure:
thumbCategorythumbBrandthumbModelthumbColor
Body content must include language sections expected by the parser.
7.1 Summary and Reader Rules (Auto Toggle)
The parser now derives UI toggles for:
- summary panel (
showSummary) - reader body (
showReader) - table of contents (
showToc) - case controller/navigator (
showNavigator)
Use these rules.
- Language blocks are still required:
<!-- lang:en -->
...english content...
<!-- lang:pt -->
...portuguese content...- Optional summary block markers (inside each language section):
<!-- summary:start -->
## Executive Summary
- Keep bullets, headings, and paragraphs here.
- Nested markdown children are preserved.
<!-- summary:end -->Everything inside summary markers is rendered to the summary slot. Everything outside summary markers is rendered to the reader body.
- Folder placement controls defaults:
src/content/cases/*.md: mixed mode (auto-detect summary + reader)src/content/cases/summary/*.md: summary-only default (showReader=false)src/content/cases/reader/*.md: reader-only default (showSummary=false)
- Optional frontmatter overrides (highest priority):
showSummary: true|falseshowReader: true|falseshowPlayer: true|falseshowToc: true|falseshowNavigator: true|false
Accepted aliases (same behavior):
summary,show-summaryreader,show-readerplayer,show-playertoc,show-tocnavigator,show-navigator
- TOC and controller behavior:
- TOC defaults to on when reader content contains headings (
##or###) - Navigator/controller defaults to on when reader is enabled
- If
showReader=false, TOC and navigator are forced off - TOC active state (open menu item + closed minimap line) follows case-reader container scroll
- TOC and navigator/controller remain fixed while the reader content scrolls
- TOC and navigator/controller are non-scrollable control surfaces (page scroll is not captured inside them)
- Marker validity:
- Always pair both summary markers in each localized section
- Unbalanced markers are treated as content validation warnings
8. Create a New Case
Generate a starter case:
npm run portfoliable-create-case -- --name "Checkout Revamp"Legacy alias:
npm run portfoliable-scaffold-case -- --name "Checkout Revamp"9. Thumbnail Device Options
Inspect supported values:
npm run portfoliable-thumbnail-options
npm run portfoliable-thumbnail-options -- --full
npm run portfoliable-thumbnail-options -- --jsonUse exact category/brand/model/color values from command output to avoid mismatches.
10. Validation and Build Gates
Run before commit or deployment:
npm run validate:content
npm run portfoliable-build
npm run portfoliable-previewIf validation fails, correct frontmatter keys and language sections first.
11. Troubleshooting
npm create cannot fetch package
- verify npm registry connectivity
- retry after checking package availability
Content validation errors
- add missing required frontmatter keys
- ensure both language sections are present and correctly marked
Thumbnail not rendering as expected
- rerun thumbnail options command
- verify values are exact matches from catalog output
Build succeeds but preview is incorrect
Reset local dependencies and rebuild:
rm -rf node_modules package-lock.json
npm install
npm run portfoliable-build
npm run portfoliable-preview12. Upgrade Guidance for Existing Projects
When updating dependencies in an existing generated project:
- update package versions
- run validation
- build and preview
- verify parser output and media rendering behavior
13. Minimal Quick Start
npm create @portfoliable my-portfolio
cd my-portfolio
npm run portfoliableAfter that, edit your case markdown files and keep validation/build checks in your routine.
