Skip to content

Commit eea2410

Browse files
committed
Improve starter template.
1 parent 6ace8c6 commit eea2410

59 files changed

Lines changed: 1600 additions & 295 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ tsconfig.bundle.generated.json
99
/.tmp*
1010
/frontend/out/
1111
/frontend/purestack.studio/legal/_private/
12+
/private-docs
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { defineComponent, html } from 'regor'
2+
3+
export interface StudioSetupStep {
4+
heading: string
5+
description: string
6+
}
7+
8+
const setupStepTemplate = html`<Panel tone="accent" variant="surface" class="p-0 mb-5" bodyClass="p-4">
9+
<Flex align="center" class="gap-3 mb-3">
10+
<IconFrame name="tabler:browser" tone="accent" variant="surface"/>
11+
<strong>{{ heading }}</strong>
12+
</Flex>
13+
<p class="mt-0 mb-3 fs-sm">{{ description }}</p>
14+
<ol class="m-0 pl-4 fs-sm">
15+
<li>Choose your template, colors, and features.</li>
16+
<li>Review your choices and create your site.</li>
17+
<li>Browse it live, then finish Studio when you’re ready.</li>
18+
</ol>
19+
</Panel>`
20+
21+
export function defineStudioSetupStepComponent() {
22+
return defineComponent<StudioSetupStep>(setupStepTemplate, {
23+
context: () => ({
24+
heading: 'Configure your site in your browser',
25+
description:
26+
'init starts a local PureStack setup website. Open the URL printed in your terminal to get started.',
27+
}),
28+
})
29+
}

‎frontend/components/studioComponents.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { defineStudioSetupStepComponent } from './getting-started/studioSetupStep'
12
import { defineStudioActivityChartComponent } from './studioActivityChart'
23
import { defineStudioBrandComponent } from './studioBrand'
3-
import { defineStudioCommandComponent } from './studioCommand'
44
import { defineStudioColorPickerComponent } from './studioColorPicker'
5+
import { defineStudioCommandComponent } from './studioCommand'
56
import { defineStudioCopyComponent } from './studioCopy'
67
import { defineStudioFaqComponent } from './studioFaq'
78
import { defineStudioFeatureComponent } from './studioFeature'
@@ -19,6 +20,7 @@ export function defineStudioComponents() {
1920
studioCopy: defineStudioCopyComponent(),
2021
studioFaq: defineStudioFaqComponent(),
2122
studioCommand: defineStudioCommandComponent(),
23+
studioSetupStep: defineStudioSetupStepComponent(),
2224
studioActivityChart: defineStudioActivityChartComponent(),
2325
studioWorkbench: defineStudioWorkbenchComponent(),
2426
}
60.4 KB
Loading
56.8 KB
Loading
55.2 KB
Loading

‎frontend/purestack.studio/guides/getting-started/purestack-cli.mdx‎

Lines changed: 67 additions & 181 deletions
Large diffs are not rendered by default.

‎frontend/purestack.studio/index.mdx‎

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -522,65 +522,58 @@ card.<span class="syntax-blue">toCSS</span>()</code></pre>
522522
<span class="eyebrow">03 / START BUILDING</span>
523523
<h2 id="start-title">Make something<br/><span>of your own.</span></h2>
524524
<p>
525-
Install <code>purestack</code> from npm to build your own site. Explore
526-
the source and run the included examples with the steps here, or follow
527-
the <a href="/guides/getting-started/purestack-cli/">CLI guide</a> to start a project.
525+
Start PureStack Studio with one command, then open it in your browser.
526+
Choose a starting point, find your colors, and make it yours.
528527
</p>
529528
<ol class="start-steps">
530529
<li>
531530
<span>01</span>
532531
<div>
533-
<strong>Get the source</strong>
534-
<p>Clone the repository and install with Yarn.</p>
532+
<strong>Open Studio</strong>
533+
<p>Run init. Follow the link in your terminal.</p>
535534
</div>
536535
</li>
537536
<li>
538537
<span>02</span>
539538
<div>
540-
<strong>Start the playground</strong>
541-
<p>Run the included content site locally.</p>
539+
<strong>Find your starting point</strong>
540+
<p>Choose a template, colors, and the features you need.</p>
542541
</div>
543542
</li>
544543
<li>
545544
<span>03</span>
546545
<div>
547-
<strong>Make it yours</strong>
548-
<p>Edit a page. Add a component. Keep going.</p>
546+
<strong>Create it. See it. Make it yours.</strong>
547+
<p>Browse your new site. Your content and code are yours to shape.</p>
549548
</div>
550549
</li>
551550
</ol>
552551
</div>
553552
<div class="start-terminal">
554553
<div class="terminal-heading">
555554
<span><Icon name="tabler:terminal-2"/>Your terminal</span
556-
><span>FROM SOURCE</span>
555+
><span>START WITH STUDIO</span>
557556
</div>
558557
<div class="terminal-body">
559558
<StudioCommand
560-
target="command-clone"
561-
label="Copy clone command"
562-
description="# Clone the project"
563-
command="git clone https://github.com/PureStackStudio/PureStack.git"/>
564-
<StudioCommand
565-
target="command-install"
566-
label="Copy install commands"
567-
description="# Install dependencies"
568-
:command="'cd PureStack\nyarn install'"/>
559+
target="command-init"
560+
label="Copy Studio command"
561+
description="# Your new site starts here"
562+
command="npx purestack@latest init"/>
563+
<StudioSetupStep/>
569564
<StudioCommand
570565
target="command-dev"
571566
label="Copy development command"
572-
description="# Start the sample site"
567+
description="# After setup, keep building in your project folder"
573568
command="yarn dev"/>
574569
<div class="terminal-address">
575-
<span class="status-dot"></span>Open localhost:4173 in your browser
570+
<span class="status-dot"></span>Choose. Create. Browse your live site.
576571
</div>
577572
</div>
578573
<a
579574
class="terminal-footer"
580-
href="https://github.com/PureStackStudio/PureStack#development"
581-
target="_blank"
582-
rel="noopener"
583-
>Setup details in the README <span aria-hidden="true">↗</span></a
575+
href="/guides/getting-started/purestack-cli/"
576+
>Your first site, step by step <span aria-hidden="true">↗</span></a
584577
>
585578
</div>
586579
</Grid>
@@ -624,10 +617,10 @@ card.<span class="syntax-blue">toCSS</span>()</code></pre>
624617
talk to whichever backend your product uses.
625618
</StudioFaq>
626619
<StudioFaq title="How do I install PureStack?">
627-
Add the published package to your project with <code>yarn add purestack</code>.
628-
The quick start above runs the included sample from a repository checkout;
629-
the <a href="/guides/getting-started/purestack-cli/">CLI guide</a> shows how to build your
630-
own site with the installed package.
620+
Run <code>npx purestack@latest init</code> and open the link in your
621+
terminal. Studio guides you through choosing and creating your site,
622+
including optional dependency installation. Follow the
623+
<a href="/guides/getting-started/purestack-cli/">CLI guide</a> for your first steps.
631624
</StudioFaq>
632625
</div>
633626
</Grid>

‎packages/purestack/src/cli/wizard/session.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
cp,
23
mkdir,
34
mkdtemp,
45
readdir,
@@ -54,7 +55,11 @@ class BrowserPeer implements DevWebSocketConnection {
5455

5556
async function fixture(previewFails = false) {
5657
const cwd = await mkdtemp(path.join(tmpdir(), 'purestack-studio-test-'))
57-
const root = path.resolve('templates/starter')
58+
const root = path.join(cwd, 'template')
59+
await cp(path.resolve('templates/starter'), root, {
60+
recursive: true,
61+
filter: (source) => path.basename(source) !== 'node_modules',
62+
})
5863
const template = {
5964
root,
6065
source: 'starter',

‎packages/purestack/src/init/init.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ async function fixture(template = 'starter') {
6666
const unpacked = path.join(temporary, 'fixture')
6767
await cp(path.join(repository, 'templates', template), unpacked, {
6868
recursive: true,
69+
filter: (source) => path.basename(source) !== 'node_modules',
6970
})
7071
return unpacked
7172
}
@@ -214,7 +215,10 @@ describe('project generation', () => {
214215
)
215216
expect(yarnConfig).toContain('nodeLinker: node-modules')
216217
expect(yarnConfig).toContain('npmMinimalAgeGate: 0')
217-
expect(Object.keys(project.dependencies)).toEqual(['purestack'])
218+
expect(project.dependencies).toMatchObject({
219+
'@purestack/ts-style': cliVersion,
220+
regor: '^1.7.6',
221+
})
218222
expect(
219223
JSON.parse(
220224
await readFile(
@@ -606,7 +610,7 @@ describe('project generation', () => {
606610
await readFile(path.join(directory, 'content/siteConfig.json'), 'utf8'),
607611
)
608612
expect(config).toMatchObject({
609-
style: { theme: { skin: 'standard', presets: ['mint'] } },
613+
style: { theme: { skin: 'starter', presets: ['mint'] } },
610614
navigation: { mode: 'none' },
611615
pagefind: { enabled: false },
612616
pageToc: { enabled: false },

0 commit comments

Comments
 (0)