@batijs/core 0.0.87 → 0.0.90
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/dist/index.d.ts +15 -12
- package/dist/index.js +146 -146
- package/dist/rules.d.ts +1 -1
- package/package.json +4 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { ASTNode, ProxifiedModule } from 'magicast';
|
|
2
2
|
export { generateCode, loadFile, parseModule } from 'magicast';
|
|
3
|
+
import { Flags } from '@batijs/features';
|
|
3
4
|
export { addVitePlugin } from 'magicast/helpers';
|
|
4
5
|
export { default as which } from 'which';
|
|
5
6
|
import { Color } from 'colorette';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
declare const flags: Map<Flags, "framework:solid" | "framework:react" | "framework:vue" | "db:edgedb" | "db:prisma" | "auth:authjs" | "rpc:telefunc" | "server:hattip" | "server:express" | "server:h3" | "uikit:tailwindcss" | "analytics:plausible.io" | "hosting:vercel">;
|
|
9
|
-
type BeforeColon<T extends string> = T extends `${infer A}:${string}` ? A : never;
|
|
10
|
-
type AfterColon<T extends string> = T extends `${string}:${infer B}` ? B : never;
|
|
11
|
-
type Flags = AfterColon<(typeof features)[number]>;
|
|
12
|
-
type Namespaces = BeforeColon<(typeof features)[number]>;
|
|
13
|
-
|
|
14
|
-
type MaybeContentGetter = (() => string | Promise<string>) | undefined;
|
|
8
|
+
type ContentGetter = () => string | Promise<string>;
|
|
15
9
|
interface VikeMeta {
|
|
16
|
-
BATI_MODULES?:
|
|
10
|
+
BATI_MODULES?: Flags[];
|
|
17
11
|
}
|
|
12
|
+
type TransformerProps = {
|
|
13
|
+
readfile?: ContentGetter;
|
|
14
|
+
target: string;
|
|
15
|
+
source: string;
|
|
16
|
+
meta: VikeMeta;
|
|
17
|
+
};
|
|
18
|
+
type Transformer = (props: TransformerProps) => unknown;
|
|
18
19
|
|
|
19
20
|
declare function transformAstAndGenerate(tree: ASTNode, meta: VikeMeta, options?: {
|
|
20
21
|
filepath?: string;
|
|
21
22
|
}): Promise<string>;
|
|
22
23
|
declare function renderSquirrelly(template: string, meta: VikeMeta): string;
|
|
23
24
|
|
|
24
|
-
declare function loadAsJson(
|
|
25
|
-
declare function loadAsMagicast<Exports extends object>(
|
|
25
|
+
declare function loadAsJson({ readfile, source, target }: TransformerProps): Promise<any>;
|
|
26
|
+
declare function loadAsMagicast<Exports extends object>({ readfile, source, target, }: TransformerProps): Promise<ProxifiedModule<Exports>>;
|
|
26
27
|
declare function loadRelativeFileAsMagicast<Exports extends object>(relativePath: string, meta: Pick<ImportMeta, "url">): Promise<ProxifiedModule<Exports>>;
|
|
27
28
|
|
|
28
29
|
interface PackageJsonDeps {
|
|
@@ -34,6 +35,7 @@ interface PackageJsonScripts {
|
|
|
34
35
|
dev?: string;
|
|
35
36
|
build?: string;
|
|
36
37
|
preview?: string;
|
|
38
|
+
lint?: string;
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
interface PackageJsonScriptOption {
|
|
@@ -45,6 +47,7 @@ interface PackageJsonScriptOptions {
|
|
|
45
47
|
dev?: PackageJsonScriptOption;
|
|
46
48
|
build?: PackageJsonScriptOption;
|
|
47
49
|
preview?: PackageJsonScriptOption;
|
|
50
|
+
lint?: PackageJsonScriptOption;
|
|
48
51
|
}
|
|
49
52
|
declare function addDependency<T extends PackageJsonDeps, U extends PackageJsonDeps>(packageJson: T, scopedPackageJson: U, keys: {
|
|
50
53
|
devDependencies?: (keyof U["dependencies"] | keyof U["devDependencies"])[];
|
|
@@ -54,4 +57,4 @@ declare function setScripts<T extends PackageJsonScripts>(packageJson: T, script
|
|
|
54
57
|
|
|
55
58
|
declare function withIcon(icon: string, iconColor?: Color, indentLevel?: number): (str: string) => string;
|
|
56
59
|
|
|
57
|
-
export {
|
|
60
|
+
export { ContentGetter, PackageJsonDeps, PackageJsonScriptOption, PackageJsonScriptOptions, PackageJsonScripts, Transformer, TransformerProps, VikeMeta, addDependency, loadAsJson, loadAsMagicast, loadRelativeFileAsMagicast, renderSquirrelly, setScripts, transformAstAndGenerate, withIcon };
|