Skip to content

Commit

Permalink
chore: local development UnoCSS improvements (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Sep 11, 2024
1 parent b68db8b commit 38df1f3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
14 changes: 14 additions & 0 deletions integration/cli/create-tutorial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ describe.each(['npm', 'pnpm', 'yarn'])('%s', (packageManager) => {

expect(filesToJSON(distFiles)).toMatchFileSnapshot(`${snapshotPrefix}-built.json`);
});

it<TestContext>('created project contains overwritten UnoCSS config', async ({ projectName, dest }) => {
await createProject(projectName, packageManager, { cwd: tmp });

const unoConfig = await fs.readFile(`${dest}/uno.config.ts`, 'utf8');

expect(unoConfig).toBe(`\
import { defineConfig } from '@tutorialkit/theme';
export default defineConfig({
// add your UnoCSS config here: https://unocss.dev/guide/config-file
});
`);
});
});

async function createProject(name: string, packageManager: string, options: { cwd: string; install?: boolean }) {
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/overwrites/uno.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@tutorialkit/theme';

export default defineConfig({
// add your UnoCSS config here: https://unocss.dev/guide/config-file
});
7 changes: 6 additions & 1 deletion packages/template/uno.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { defineConfig } from '@tutorialkit/theme';

export default defineConfig({
// add your UnoCSS config here: https://unocss.dev/guide/config-file
// required for TutorialKit monorepo development mode
content: {
pipeline: {
include: '**',
},
},
});
4 changes: 4 additions & 0 deletions uno.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// for vscode intellisense
import { defineConfig } from './packages/theme/dist/index.js';

export default defineConfig({});

0 comments on commit 38df1f3

Please sign in to comment.