@styleframe/loader 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/config.ts DELETED
@@ -1,45 +0,0 @@
1
- import type { Styleframe } from "@styleframe/core";
2
- import { styleframe } from "@styleframe/core";
3
- import { loadConfig, watchConfig } from "c12";
4
- import path from "node:path";
5
-
6
- export async function loadConfiguration({
7
- cwd = process.cwd(),
8
- name = "styleframe",
9
- }: {
10
- cwd?: string;
11
- name?: string;
12
- } = {}) {
13
- const { config } = await loadConfig<Styleframe>({
14
- cwd,
15
- name,
16
- defaults: styleframe(),
17
- });
18
-
19
- return config;
20
- }
21
-
22
- export async function loadConfigurationFromPath(entry: string) {
23
- const entryPath = path.resolve(entry);
24
- const cwd = path.dirname(entryPath);
25
- const name = path.basename(entryPath).replace(/(\.config)?(\.ts)?$/, "");
26
-
27
- return await loadConfiguration({ cwd, name });
28
- }
29
-
30
- export async function watchConfiguration({
31
- cwd = process.cwd(),
32
- }: {
33
- cwd?: string;
34
- } = {}) {
35
- return await watchConfig<Styleframe>({
36
- cwd,
37
- name: "styleframe",
38
- acceptHMR({ getDiff }) {
39
- const diff = getDiff();
40
- if (diff.length === 0) {
41
- return true; // No changes!
42
- }
43
- },
44
- });
45
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./build";
2
- export * from "./config";
3
- export * from "./utils";
package/src/utils.ts DELETED
@@ -1,10 +0,0 @@
1
- import { stat } from "node:fs/promises";
2
-
3
- export async function directoryExists(path: string) {
4
- try {
5
- const stats = await stat(path);
6
- return stats.isDirectory();
7
- } catch {
8
- return false;
9
- }
10
- }
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/tsconfig.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "@styleframe/config-typescript",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": ".tsbuildinfo"
5
- },
6
- "include": [
7
- "src/**/*.ts",
8
- "playground/**/*.ts",
9
- "tsdown.config.ts",
10
- "vite.config.ts"
11
- ]
12
- }
package/vite.config.ts DELETED
@@ -1,13 +0,0 @@
1
- import { createViteConfig } from "@styleframe/config-vite";
2
- import { VitePluginNode } from "vite-plugin-node";
3
-
4
- const __dirname = new URL(".", import.meta.url).pathname;
5
-
6
- export default createViteConfig("loader", __dirname, {
7
- plugins: [
8
- VitePluginNode({
9
- appPath: "./src/index.ts",
10
- adapter: "express",
11
- }),
12
- ],
13
- });