@najemi-software/typed-scss-modules 13.3.0 → 13.4.0-alpha.52.1
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/esm/core/alerts.d.ts +6 -0
- package/esm/core/alerts.js +3 -0
- package/esm/core/types.d.ts +10 -2
- package/esm/implementations/implementations.d.ts +5 -1
- package/esm/implementations/implementations.js +2 -1
- package/esm/index.d.ts +4 -1
- package/esm/index.js +1 -0
- package/esm/main.d.ts +3 -0
- package/esm/main.js +3 -0
- package/esm/sass/file-to-class-names.d.ts +6 -0
- package/esm/sass/importer.d.ts +13 -1
- package/esm/tsdoc-metadata.json +11 -0
- package/esm/typed-scss-modules.d.ts +116 -0
- package/esm/typescript/class-names-to-type-definition.d.ts +6 -0
- package/package.json +4 -2
package/esm/core/alerts.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
1
4
|
export declare const LOG_LEVELS: readonly ["verbose", "error", "info", "silent"];
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
2
8
|
export type LogLevel = (typeof LOG_LEVELS)[number];
|
|
3
9
|
export declare const logLevelDefault: LogLevel;
|
|
4
10
|
export declare const setAlertsLogLevel: (logLevel: LogLevel) => void;
|
package/esm/core/alerts.js
CHANGED
package/esm/core/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { SASSOptions } from "../sass/file-to-class-names.js";
|
|
2
2
|
import type { ExportType, LogLevel, QuoteType } from "../typescript/index.js";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type CLIOnlyOptions = Extract<keyof SASSOptions, "importer">;
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
4
10
|
export interface CLIOptions extends Exclude<SASSOptions, CLIOnlyOptions> {
|
|
5
11
|
banner: string;
|
|
6
12
|
ignore: string[];
|
|
@@ -16,6 +22,8 @@ export interface CLIOptions extends Exclude<SASSOptions, CLIOnlyOptions> {
|
|
|
16
22
|
outputFolder: string | null;
|
|
17
23
|
allowArbitraryExtensions: boolean;
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
19
28
|
export interface ConfigOptions extends CLIOptions, SASSOptions {
|
|
20
29
|
}
|
|
21
|
-
export {};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import sass, { AsyncCompiler as SassAsyncCompiler, Compiler as SassCompiler } from "sass";
|
|
2
2
|
import sassEmbedded, { AsyncCompiler as SassEmbeddedAsyncCompiler, Compiler as SassEmbeddedCompiler } from "sass-embedded";
|
|
3
3
|
/**
|
|
4
|
+
* @public
|
|
4
5
|
* A list of all possible SASS package implementations that can be used to
|
|
5
6
|
* perform the compilation and parsing of the SASS files. The expectation is
|
|
6
7
|
* that they provide a nearly identical API so they can be swapped out but
|
|
7
|
-
* all
|
|
8
|
+
* all the same logic can be reused.
|
|
8
9
|
*/
|
|
9
10
|
export declare const IMPLEMENTATIONS: readonly ["sass", "sass-embedded"];
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
10
14
|
export type Implementations = (typeof IMPLEMENTATIONS)[number];
|
|
11
15
|
export type Implementation = typeof sass | typeof sassEmbedded;
|
|
12
16
|
export type SyncCompiler = SassCompiler | SassEmbeddedCompiler;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import sass, { AsyncCompiler as SassAsyncCompiler, Compiler as SassCompiler } from "sass";
|
|
2
2
|
import sassEmbedded, { AsyncCompiler as SassEmbeddedAsyncCompiler, Compiler as SassEmbeddedCompiler, } from "sass-embedded";
|
|
3
3
|
/**
|
|
4
|
+
* @public
|
|
4
5
|
* A list of all possible SASS package implementations that can be used to
|
|
5
6
|
* perform the compilation and parsing of the SASS files. The expectation is
|
|
6
7
|
* that they provide a nearly identical API so they can be swapped out but
|
|
7
|
-
* all
|
|
8
|
+
* all the same logic can be reused.
|
|
8
9
|
*/
|
|
9
10
|
export const IMPLEMENTATIONS = ["sass", "sass-embedded"];
|
|
10
11
|
/**
|
package/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export type { ConfigOptions } from "./core/types.js";
|
|
1
|
+
export type { CLIOnlyOptions, CLIOptions, ConfigOptions } from "./core/types.js";
|
|
2
|
+
export { LOG_LEVELS, type ExportType, type LogLevel, type QuoteType } from "./typescript/index.js";
|
|
3
|
+
export type { InternalSassOptions, SASSOptions } from "./sass/file-to-class-names.js";
|
|
4
|
+
export type { Aliases, Importer, SASSImporterOptions, SyncMode } from "./sass/importer.js";
|
|
2
5
|
export { IMPLEMENTATIONS, type Implementations } from "./implementations/implementations.js";
|
|
3
6
|
export { main as default } from "./main.js";
|
package/esm/index.js
CHANGED
package/esm/main.d.ts
CHANGED
package/esm/main.js
CHANGED
|
@@ -4,6 +4,9 @@ import slash from "slash";
|
|
|
4
4
|
import { generate, listDifferent, setAlertsLogLevel, watch } from "./core/index.js";
|
|
5
5
|
import { disposeAllCompilers } from "./implementations/compilers.js";
|
|
6
6
|
import { loadConfig, mergeOptions } from "./load.js";
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
7
10
|
export const main = async (pattern, cliOptions) => {
|
|
8
11
|
const configOptions = await loadConfig();
|
|
9
12
|
const options = mergeOptions(cliOptions, configOptions);
|
|
@@ -14,7 +14,13 @@ declare const transformersMap: {
|
|
|
14
14
|
type NameFormatWithTransformer = keyof typeof transformersMap;
|
|
15
15
|
export declare const NAME_FORMATS: readonly [...("camel" | "dashes" | "kebab" | "none" | "param" | "snake")[], "all"];
|
|
16
16
|
export type NameFormat = (typeof NAME_FORMATS)[number];
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
17
20
|
export type InternalSassOptions = Pick<Options<SyncMode>, "style" | "loadPaths" | "silenceDeprecations">;
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
18
24
|
export interface SASSOptions extends SASSImporterOptions, InternalSassOptions {
|
|
19
25
|
nameFormat?: string | string[];
|
|
20
26
|
implementation: Implementations;
|
package/esm/sass/importer.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { FileImporter, Importer as SassImporter } from "sass";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type SyncMode = "sync" | "async";
|
|
3
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export type Importer<TSync extends SyncMode = "sync"> = SassImporter<TSync> | FileImporter<TSync>;
|
|
4
10
|
type AsyncImporter = Importer<"async">;
|
|
5
11
|
export type { AsyncImporter as SASSAsyncImporter, Importer as SASSImporter };
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
6
15
|
export interface Aliases {
|
|
7
16
|
[index: string]: string;
|
|
8
17
|
}
|
|
@@ -15,6 +24,9 @@ interface AliasImporterOptions {
|
|
|
15
24
|
*/
|
|
16
25
|
export declare const aliasResolver: ({ aliases, aliasPrefixes }: AliasImporterOptions) => (url: string) => string | null;
|
|
17
26
|
export declare const aliasImporter: <TSync extends SyncMode = "sync">({ aliases, aliasPrefixes, }: AliasImporterOptions) => FileImporter<TSync>;
|
|
27
|
+
/**
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
18
30
|
export interface SASSImporterOptions {
|
|
19
31
|
aliases?: Aliases;
|
|
20
32
|
aliasPrefixes?: Aliases;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.58.9"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { FileImporter } from 'sass';
|
|
2
|
+
import type { Importer as Importer_2 } from 'sass';
|
|
3
|
+
import { Options } from 'sass';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare interface Aliases {
|
|
9
|
+
[index: string]: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare type CLIOnlyOptions = Extract<keyof SASSOptions, "importer">;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare interface CLIOptions extends Exclude<SASSOptions, CLIOnlyOptions> {
|
|
21
|
+
banner: string;
|
|
22
|
+
ignore: string[];
|
|
23
|
+
ignoreInitial: boolean;
|
|
24
|
+
exportType: ExportType;
|
|
25
|
+
exportTypeName: string;
|
|
26
|
+
exportTypeInterface: string;
|
|
27
|
+
listDifferent: boolean;
|
|
28
|
+
quoteType: QuoteType;
|
|
29
|
+
updateStaleOnly: boolean;
|
|
30
|
+
watch: boolean;
|
|
31
|
+
logLevel: LogLevel;
|
|
32
|
+
outputFolder: string | null;
|
|
33
|
+
allowArbitraryExtensions: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare interface ConfigOptions extends CLIOptions, SASSOptions {
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare type ExportType = "named" | "default";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @public
|
|
49
|
+
* A list of all possible SASS package implementations that can be used to
|
|
50
|
+
* perform the compilation and parsing of the SASS files. The expectation is
|
|
51
|
+
* that they provide a nearly identical API so they can be swapped out but
|
|
52
|
+
* all the same logic can be reused.
|
|
53
|
+
*/
|
|
54
|
+
export declare const IMPLEMENTATIONS: readonly ["sass", "sass-embedded"];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export declare type Implementations = (typeof IMPLEMENTATIONS)[number];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export declare type Importer<TSync extends SyncMode = "sync"> = Importer_2<TSync> | FileImporter<TSync>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export declare type InternalSassOptions = Pick<Options<SyncMode>, "style" | "loadPaths" | "silenceDeprecations">;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare const LOG_LEVELS: readonly ["verbose", "error", "info", "silent"];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export declare type LogLevel = (typeof LOG_LEVELS)[number];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
declare const main: (pattern: string, cliOptions: Partial<CLIOptions>) => Promise<void>;
|
|
85
|
+
export default main;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export declare type QuoteType = "single" | "double";
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export declare interface SASSImporterOptions {
|
|
96
|
+
aliases?: Aliases;
|
|
97
|
+
aliasPrefixes?: Aliases;
|
|
98
|
+
importers?: Importer[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
export declare interface SASSOptions extends SASSImporterOptions, InternalSassOptions {
|
|
105
|
+
nameFormat?: string | string[];
|
|
106
|
+
implementation: Implementations;
|
|
107
|
+
async?: boolean;
|
|
108
|
+
importers?: Importer<SyncMode>[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
export declare type SyncMode = "sync" | "async";
|
|
115
|
+
|
|
116
|
+
export { }
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ClassName } from "../sass/file-to-class-names.js";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export type ExportType = "named" | "default";
|
|
3
6
|
export declare const EXPORT_TYPES: ExportType[];
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
4
10
|
export type QuoteType = "single" | "double";
|
|
5
11
|
export declare const QUOTE_TYPES: QuoteType[];
|
|
6
12
|
export interface TypeDefinitionOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@najemi-software/typed-scss-modules",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.4.0-alpha.52.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TypeScript type definition generator for SCSS CSS Modules",
|
|
6
6
|
"keywords": [
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
|
-
"
|
|
52
|
+
"api-extractor": "mkdir -p api && [ -z \"${CI}\" ] && (api-extractor run -l) || (api-extractor run)",
|
|
53
|
+
"build": "pnpm run clean && tsgo -p tsconfig.build.json && chmod +x esm/cli.js && pnpm run api-extractor",
|
|
53
54
|
"check:types": "tsgo --noEmit",
|
|
54
55
|
"clean": "rm -rf ./esm",
|
|
55
56
|
"format": "oxfmt --check",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"yargs": "^17.7.2"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
80
|
+
"@microsoft/api-extractor": "^7.55.2",
|
|
79
81
|
"@tsjam/eslint-config-recommended": "^0.2.4",
|
|
80
82
|
"@types/node": "^22.19.3",
|
|
81
83
|
"@types/reserved-words": "^0.1.0",
|