@salty-css/core 0.1.0-alpha.5 → 0.1.0-alpha.7
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/astro-component-5hrNTCJ5.js +4 -0
- package/astro-component-Dj3enX6K.cjs +4 -0
- package/bin/commands/build.d.ts +2 -0
- package/bin/commands/generate.d.ts +2 -0
- package/bin/commands/init.d.ts +2 -0
- package/bin/commands/update.d.ts +2 -0
- package/bin/commands/version.d.ts +2 -0
- package/bin/context.d.ts +19 -0
- package/bin/detection/css-file.d.ts +5 -0
- package/bin/frameworks/astro.d.ts +4 -0
- package/bin/frameworks/index.d.ts +13 -0
- package/bin/frameworks/react.d.ts +2 -0
- package/bin/frameworks/types.d.ts +27 -0
- package/bin/integrations/astro.d.ts +11 -0
- package/bin/integrations/eslint.d.ts +6 -0
- package/bin/integrations/index.d.ts +13 -0
- package/bin/integrations/next.d.ts +9 -0
- package/bin/integrations/types.d.ts +17 -0
- package/bin/integrations/vite.d.ts +8 -0
- package/bin/main.cjs +548 -332
- package/bin/main.d.ts +8 -0
- package/bin/main.js +548 -332
- package/bin/package-json.d.ts +21 -0
- package/bin/saltyrc.d.ts +31 -0
- package/bin/templates.d.ts +14 -0
- package/package.json +1 -1
- package/styled-file-BzmB9_Ez.cjs +12 -0
- package/{react-styled-file-U02jek-B.cjs → styled-file-CPd_rTW2.cjs} +2 -2
- package/{react-styled-file-B99mwk0w.js → styled-file-Cda3EeR6.js} +2 -2
- package/styled-file-DLcgYmGN.js +12 -0
- package/{react-vanilla-file-D9px70iK.js → vanilla-file-1kOqbCIM.js} +2 -2
- package/{react-vanilla-file-Bj6XC8GS.cjs → vanilla-file-r0fp2q_m.cjs} +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PathLike } from 'fs';
|
|
2
|
+
export declare const defaultPackageJsonPath: string;
|
|
3
|
+
export interface PackageJson {
|
|
4
|
+
name?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
scripts?: Record<string, string>;
|
|
7
|
+
dependencies?: Record<string, string>;
|
|
8
|
+
devDependencies?: Record<string, string>;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare const readPackageJson: (filePath?: PathLike) => Promise<PackageJson>;
|
|
12
|
+
export declare const updatePackageJson: (content: string | object, filePath?: PathLike) => Promise<void>;
|
|
13
|
+
export declare const readThisPackageJson: () => Promise<PackageJson>;
|
|
14
|
+
export declare const corePackages: {
|
|
15
|
+
core: (version: string) => string;
|
|
16
|
+
eslintConfigCore: (version: string) => string;
|
|
17
|
+
};
|
|
18
|
+
export declare const addPrepareScript: (pkg: PackageJson) => {
|
|
19
|
+
changed: boolean;
|
|
20
|
+
pkg: PackageJson;
|
|
21
|
+
};
|
package/bin/saltyrc.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RCFile } from '../types/cli-types';
|
|
2
|
+
import { FrameworkAdapter } from './frameworks';
|
|
3
|
+
export declare const SALTYRC_FILENAME = ".saltyrc.json";
|
|
4
|
+
export declare const SALTYRC_SCHEMA = "./node_modules/@salty-css/core/.saltyrc.schema.json";
|
|
5
|
+
export declare const SALTYRC_INFO = "This file is used to define projects and their configurations for Salty CSS cli. Do not delete, modify or add this file to .gitignore.";
|
|
6
|
+
export interface ProjectEntry {
|
|
7
|
+
dir: string;
|
|
8
|
+
framework: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare const saltyrcPath: (rootDir?: string) => string;
|
|
12
|
+
export declare const readRc: (rootDir?: string) => Promise<RCFile>;
|
|
13
|
+
export declare const readRawRc: (rootDir?: string) => Promise<string | undefined>;
|
|
14
|
+
export declare const getDefaultProject: (rootDir?: string) => Promise<string | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Pure transform: returns the new saltyrc content for an upsert. Does not touch the filesystem.
|
|
17
|
+
* - If `existingRaw` is undefined, returns a fresh file with the project as the only entry.
|
|
18
|
+
* - If the project entry already exists, returns the same content (no-op).
|
|
19
|
+
* - Otherwise appends the new entry and returns updated content.
|
|
20
|
+
*/
|
|
21
|
+
export declare const upsertProjectInRc: (existingRaw: string | undefined, relativeProjectPath: string, framework: FrameworkAdapter) => {
|
|
22
|
+
content: string;
|
|
23
|
+
changed: boolean;
|
|
24
|
+
created: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Writes the saltyrc file, creating or updating the project entry for the given dir.
|
|
28
|
+
* Returns true when a write occurred.
|
|
29
|
+
*/
|
|
30
|
+
export declare const writeProjectToRc: (cwd: string, relativeProjectPath: string, framework: FrameworkAdapter) => Promise<boolean>;
|
|
31
|
+
export declare const getProjectFramework: (rc: RCFile, relativeProjectPath: string) => string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const templateLoaders: {
|
|
2
|
+
readonly 'salty.config.ts': () => Promise<any>;
|
|
3
|
+
readonly 'saltygen/index.css': () => Promise<any>;
|
|
4
|
+
readonly 'react/styled-file.ts': () => Promise<any>;
|
|
5
|
+
readonly 'react/vanilla-file.ts': () => Promise<any>;
|
|
6
|
+
readonly 'astro/styled-file.ts': () => Promise<any>;
|
|
7
|
+
readonly 'astro/component.astro': () => Promise<any>;
|
|
8
|
+
};
|
|
9
|
+
export type TemplateKey = keyof typeof templateLoaders;
|
|
10
|
+
export declare const readTemplate: <T extends object>(key: TemplateKey, options?: T) => Promise<{
|
|
11
|
+
fileName: "salty.config.ts" | "saltygen/index.css" | "react/styled-file.ts" | "react/vanilla-file.ts" | "astro/styled-file.ts" | "astro/component.astro";
|
|
12
|
+
content: string;
|
|
13
|
+
}>;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const styledFile = `import { styled } from "@salty-css/astro/styled";
|
|
4
|
+
|
|
5
|
+
export const <%- name %> = styled('<%- tag %>', {
|
|
6
|
+
<% if(className) { %>className: '<%- className %>',<% } %>
|
|
7
|
+
base: {
|
|
8
|
+
// Add your styles here
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
`;
|
|
12
|
+
exports.default = styledFile;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const styledFile = `import { styled } from "@salty-css/react/styled";
|
|
4
4
|
|
|
5
5
|
export const <%- name %> = styled('<%- tag %>', {
|
|
6
6
|
<% if(className) { %>className: '<%- className %>',<% } %>
|
|
@@ -8,4 +8,4 @@ export const <%- name %> = styled('<%- tag %>', {
|
|
|
8
8
|
// Add your styles here
|
|
9
9
|
}
|
|
10
10
|
})`;
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = styledFile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const styledFile = `import { styled } from "@salty-css/react/styled";
|
|
2
2
|
|
|
3
3
|
export const <%- name %> = styled('<%- tag %>', {
|
|
4
4
|
<% if(className) { %>className: '<%- className %>',<% } %>
|
|
@@ -7,5 +7,5 @@ export const <%- name %> = styled('<%- tag %>', {
|
|
|
7
7
|
}
|
|
8
8
|
})`;
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
styledFile as default
|
|
11
11
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const styledFile = `import { styled } from "@salty-css/astro/styled";
|
|
2
|
+
|
|
3
|
+
export const <%- name %> = styled('<%- tag %>', {
|
|
4
|
+
<% if(className) { %>className: '<%- className %>',<% } %>
|
|
5
|
+
base: {
|
|
6
|
+
// Add your styles here
|
|
7
|
+
}
|
|
8
|
+
})
|
|
9
|
+
`;
|
|
10
|
+
export {
|
|
11
|
+
styledFile as default
|
|
12
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const vanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
|
|
2
2
|
|
|
3
3
|
interface <%- componentName %>Props {
|
|
4
4
|
text?: string;
|
|
@@ -14,5 +14,5 @@ export const <%- componentName %> = ({ text = 'Lorem ipsum' }: <%- componentName
|
|
|
14
14
|
|
|
15
15
|
export default <%- componentName %>;`;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
vanillaFile as default
|
|
18
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const vanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
|
|
4
4
|
|
|
5
5
|
interface <%- componentName %>Props {
|
|
6
6
|
text?: string;
|
|
@@ -15,4 +15,4 @@ export const <%- componentName %> = ({ text = 'Lorem ipsum' }: <%- componentName
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export default <%- componentName %>;`;
|
|
18
|
-
exports.default =
|
|
18
|
+
exports.default = vanillaFile;
|