generated from unplugin/unplugin-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): improve build step again; clean from build in 1 command
- Loading branch information
Showing
30 changed files
with
172 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ export default antfu( | |
'**/tests/fixtures/', | ||
'**/tests/tmp/', | ||
'.vscode', | ||
'**/grammars/*.tmLanguage.js', | ||
], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { useThemeSheet, useRuntimeSheet } from '@pinceau/runtime' | ||
import { useRuntimeSheet, useThemeSheet } from '@pinceau/runtime' | ||
|
||
export const PinceauSvelteOptions = {"dev":false,"colorSchemeMode":"media","computedStyles":true,"variants":true,"ssr":{"theme":true,"runtime":true},"appId":false} | ||
export const PinceauSvelteOptions = { dev: false, colorSchemeMode: 'media', computedStyles: true, variants: true, ssr: { theme: true, runtime: true }, appId: false } | ||
|
||
let userOptions | ||
let userOptions | ||
|
||
let themeSheet | ||
let themeSheet | ||
export const getRuntimeSheet = () => runtimeSheet | ||
|
||
let runtimeSheet | ||
let runtimeSheet | ||
export const getThemeSheet = () => themeSheet | ||
|
||
export const pinceauPlugin = (options) => { | ||
userOptions = { ...PinceauSvelteOptions, ...options } | ||
|
||
themeSheet = useThemeSheet(userOptions) | ||
runtimeSheet = useRuntimeSheet({ themeSheet, ...userOptions }) | ||
} | ||
export function pinceauPlugin(options) { | ||
userOptions = { ...PinceauSvelteOptions, ...options } | ||
|
||
export const ssr = { toString: () => runtimeSheet.toString() } | ||
themeSheet = useThemeSheet(userOptions) | ||
runtimeSheet = useRuntimeSheet({ themeSheet, ...userOptions }) | ||
} | ||
|
||
export const ssr = { toString: () => runtimeSheet.toString() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { join } from 'pathe' | ||
import type { PinceauContext } from '@pinceau/core' | ||
import { configSourceFromModulePath } from './module-path' | ||
|
||
export function resolveBuildDir(ctx: PinceauContext) { | ||
const { buildDir: optionsBuildDir } = ctx.options.theme | ||
|
||
let buildDir = optionsBuildDir | ||
|
||
// Enforce ending slash for buildDir | ||
if (buildDir && !buildDir.endsWith('/')) { | ||
buildDir += '/' | ||
} | ||
|
||
// Try to resolve using common module path resolve | ||
if (buildDir === undefined && ctx.options.cwd && ctx.options.resolve) { | ||
buildDir = configSourceFromModulePath('@pinceau/outputs', ctx)?.path | ||
} | ||
|
||
// Try to resolve using path join | ||
if (buildDir === undefined && ctx.options.cwd) { | ||
buildDir = join(ctx.options.cwd, 'node_modules/@pinceau/outputs/') | ||
} | ||
|
||
return buildDir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.