-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build decofile and decofile priority
Signed-off-by: Marcos Candeia <[email protected]>
- Loading branch information
Showing
4 changed files
with
51 additions
and
10 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
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,6 +1,20 @@ | ||
import { build } from "./tailwind.ts"; | ||
await build(); | ||
import { newFsFolderProvider } from "@deco/deco/engine"; | ||
import { exists } from "@std/fs/exists"; | ||
import { join } from "@std/path"; | ||
import { build as tailwindBuild } from "./tailwind.ts"; | ||
|
||
if (Deno.args.includes("build")) { | ||
Deno.exit(0); | ||
} | ||
const DECO_FOLDER = ".deco"; | ||
export const build = async () => { | ||
await tailwindBuild(); | ||
const decoFolder = join(Deno.cwd(), DECO_FOLDER); | ||
if ( | ||
Deno.args.includes("build") && await exists(decoFolder) | ||
) { | ||
const provider = newFsFolderProvider(join(DECO_FOLDER, "blocks")); | ||
const decofile = await provider.state(); | ||
await Deno.writeTextFile( | ||
join(decoFolder, "decofile.json"), | ||
JSON.stringify(decofile, null, 2), | ||
); | ||
} | ||
}; |
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