@wyw-in-js/shared 0.5.0 → 0.5.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/options/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/options/types.ts"],"sourcesContent":["import type { TransformOptions } from '@babel/core';\nimport type { File } from '@babel/types';\n\nimport type { IVariableContext } from '../IVariableContext';\nimport type { Core } from '../babel';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype VmContext = Record<string, any>; // It's Context from `vm`\n\nexport type ClassNameSlugVars = {\n dir: string;\n ext: string;\n file: string;\n hash: string;\n index: number;\n name: string;\n title: string;\n};\n\nexport type ClassNameFn = (\n hash: string,\n title: string,\n args: ClassNameSlugVars\n) => string;\n\nexport type VariableNameFn = (context: IVariableContext) => string;\n\nexport type EvaluatorConfig = {\n features: StrictOptions['features'];\n highPriorityPlugins: string[];\n onlyExports: string[];\n};\n\nexport type Evaluator = (\n evalConfig: TransformOptions,\n ast: File,\n code: string,\n config: EvaluatorConfig,\n babel: Core\n) => [\n ast: File,\n code: string,\n imports: Map<string, string[]> | null,\n exports?: string[] | null,\n];\n\nexport type EvalRule = {\n action: Evaluator | 'ignore' | string;\n babelOptions?: TransformOptions;\n test?: RegExp | ((path: string, code: string) => boolean);\n};\n\nexport type FeatureFlag = boolean | string | string[];\n\ntype AllFeatureFlags = {\n dangerousCodeRemover: FeatureFlag;\n globalCache: FeatureFlag;\n happyDOM: FeatureFlag;\n softErrors: FeatureFlag;\n useBabelConfigs: FeatureFlag;\n};\n\nexport type FeatureFlags<\n TOnly extends keyof AllFeatureFlags = keyof AllFeatureFlags,\n> = Pick<AllFeatureFlags, TOnly>;\n\nexport type StrictOptions = {\n babelOptions: TransformOptions;\n classNameSlug?: string | ClassNameFn;\n displayName: boolean;\n evaluate: boolean;\n extensions: string[];\n features: FeatureFlags;\n highPriorityPlugins: string[];\n ignore?: RegExp;\n overrideContext?: (\n context: Partial<VmContext>,\n filename: string\n ) => Partial<VmContext>;\n rules: EvalRule[];\n tagResolver?: (source: string, tag: string) => string | null;\n variableNameConfig?: 'var' | 'dashes' | 'raw';\n variableNameSlug?: string | VariableNameFn;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/options/types.ts"],"sourcesContent":["import type { TransformOptions } from '@babel/core';\nimport type { File } from '@babel/types';\n\nimport type { IVariableContext } from '../IVariableContext';\nimport type { Core } from '../babel';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype VmContext = Record<string, any>; // It's Context from `vm`\n\nexport type ClassNameSlugVars = {\n dir: string;\n ext: string;\n file: string;\n hash: string;\n index: number;\n name: string;\n title: string;\n};\n\nexport type ClassNameFn = (\n hash: string,\n title: string,\n args: ClassNameSlugVars\n) => string;\n\nexport type VariableNameFn = (context: IVariableContext) => string;\n\nexport type EvaluatorConfig = {\n features: StrictOptions['features'];\n highPriorityPlugins: string[];\n onlyExports: string[];\n};\n\nexport type Evaluator = (\n evalConfig: TransformOptions,\n ast: File,\n code: string,\n config: EvaluatorConfig,\n babel: Core\n) => [\n ast: File,\n code: string,\n imports: Map<string, string[]> | null,\n exports?: string[] | null,\n];\n\nexport type EvalRule = {\n action: Evaluator | 'ignore' | string;\n babelOptions?: TransformOptions;\n test?: RegExp | ((path: string, code: string) => boolean);\n};\n\nexport type FeatureFlag = boolean | string | string[];\n\ntype AllFeatureFlags = {\n dangerousCodeRemover: FeatureFlag;\n globalCache: FeatureFlag;\n happyDOM: FeatureFlag;\n softErrors: FeatureFlag;\n useBabelConfigs: FeatureFlag;\n useWeakRefInEval: FeatureFlag;\n};\n\nexport type FeatureFlags<\n TOnly extends keyof AllFeatureFlags = keyof AllFeatureFlags,\n> = Pick<AllFeatureFlags, TOnly>;\n\nexport type StrictOptions = {\n babelOptions: TransformOptions;\n classNameSlug?: string | ClassNameFn;\n displayName: boolean;\n evaluate: boolean;\n extensions: string[];\n features: FeatureFlags;\n highPriorityPlugins: string[];\n ignore?: RegExp;\n overrideContext?: (\n context: Partial<VmContext>,\n filename: string\n ) => Partial<VmContext>;\n rules: EvalRule[];\n tagResolver?: (source: string, tag: string) => string | null;\n variableNameConfig?: 'var' | 'dashes' | 'raw';\n variableNameSlug?: string | VariableNameFn;\n};\n"],"mappings":""}
|
package/lib/options/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/options/types.ts"],"sourcesContent":["import type { TransformOptions } from '@babel/core';\nimport type { File } from '@babel/types';\n\nimport type { IVariableContext } from '../IVariableContext';\nimport type { Core } from '../babel';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype VmContext = Record<string, any>; // It's Context from `vm`\n\nexport type ClassNameSlugVars = {\n dir: string;\n ext: string;\n file: string;\n hash: string;\n index: number;\n name: string;\n title: string;\n};\n\nexport type ClassNameFn = (\n hash: string,\n title: string,\n args: ClassNameSlugVars\n) => string;\n\nexport type VariableNameFn = (context: IVariableContext) => string;\n\nexport type EvaluatorConfig = {\n features: StrictOptions['features'];\n highPriorityPlugins: string[];\n onlyExports: string[];\n};\n\nexport type Evaluator = (\n evalConfig: TransformOptions,\n ast: File,\n code: string,\n config: EvaluatorConfig,\n babel: Core\n) => [\n ast: File,\n code: string,\n imports: Map<string, string[]> | null,\n exports?: string[] | null,\n];\n\nexport type EvalRule = {\n action: Evaluator | 'ignore' | string;\n babelOptions?: TransformOptions;\n test?: RegExp | ((path: string, code: string) => boolean);\n};\n\nexport type FeatureFlag = boolean | string | string[];\n\ntype AllFeatureFlags = {\n dangerousCodeRemover: FeatureFlag;\n globalCache: FeatureFlag;\n happyDOM: FeatureFlag;\n softErrors: FeatureFlag;\n useBabelConfigs: FeatureFlag;\n};\n\nexport type FeatureFlags<\n TOnly extends keyof AllFeatureFlags = keyof AllFeatureFlags,\n> = Pick<AllFeatureFlags, TOnly>;\n\nexport type StrictOptions = {\n babelOptions: TransformOptions;\n classNameSlug?: string | ClassNameFn;\n displayName: boolean;\n evaluate: boolean;\n extensions: string[];\n features: FeatureFlags;\n highPriorityPlugins: string[];\n ignore?: RegExp;\n overrideContext?: (\n context: Partial<VmContext>,\n filename: string\n ) => Partial<VmContext>;\n rules: EvalRule[];\n tagResolver?: (source: string, tag: string) => string | null;\n variableNameConfig?: 'var' | 'dashes' | 'raw';\n variableNameSlug?: string | VariableNameFn;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/options/types.ts"],"sourcesContent":["import type { TransformOptions } from '@babel/core';\nimport type { File } from '@babel/types';\n\nimport type { IVariableContext } from '../IVariableContext';\nimport type { Core } from '../babel';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype VmContext = Record<string, any>; // It's Context from `vm`\n\nexport type ClassNameSlugVars = {\n dir: string;\n ext: string;\n file: string;\n hash: string;\n index: number;\n name: string;\n title: string;\n};\n\nexport type ClassNameFn = (\n hash: string,\n title: string,\n args: ClassNameSlugVars\n) => string;\n\nexport type VariableNameFn = (context: IVariableContext) => string;\n\nexport type EvaluatorConfig = {\n features: StrictOptions['features'];\n highPriorityPlugins: string[];\n onlyExports: string[];\n};\n\nexport type Evaluator = (\n evalConfig: TransformOptions,\n ast: File,\n code: string,\n config: EvaluatorConfig,\n babel: Core\n) => [\n ast: File,\n code: string,\n imports: Map<string, string[]> | null,\n exports?: string[] | null,\n];\n\nexport type EvalRule = {\n action: Evaluator | 'ignore' | string;\n babelOptions?: TransformOptions;\n test?: RegExp | ((path: string, code: string) => boolean);\n};\n\nexport type FeatureFlag = boolean | string | string[];\n\ntype AllFeatureFlags = {\n dangerousCodeRemover: FeatureFlag;\n globalCache: FeatureFlag;\n happyDOM: FeatureFlag;\n softErrors: FeatureFlag;\n useBabelConfigs: FeatureFlag;\n useWeakRefInEval: FeatureFlag;\n};\n\nexport type FeatureFlags<\n TOnly extends keyof AllFeatureFlags = keyof AllFeatureFlags,\n> = Pick<AllFeatureFlags, TOnly>;\n\nexport type StrictOptions = {\n babelOptions: TransformOptions;\n classNameSlug?: string | ClassNameFn;\n displayName: boolean;\n evaluate: boolean;\n extensions: string[];\n features: FeatureFlags;\n highPriorityPlugins: string[];\n ignore?: RegExp;\n overrideContext?: (\n context: Partial<VmContext>,\n filename: string\n ) => Partial<VmContext>;\n rules: EvalRule[];\n tagResolver?: (source: string, tag: string) => string | null;\n variableNameConfig?: 'var' | 'dashes' | 'raw';\n variableNameSlug?: string | VariableNameFn;\n};\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wyw-in-js/shared",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"debug": "^4.3.4",
|
|
6
6
|
"find-up": "^5.0.0",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"@types/debug": "^4.1.9",
|
|
13
13
|
"@types/node": "^16.18.55",
|
|
14
14
|
"typescript": "^5.2.2",
|
|
15
|
-
"@wyw-in-js/babel-config": "0.5.
|
|
16
|
-
"@wyw-in-js/eslint-config": "0.5.
|
|
17
|
-
"@wyw-in-js/jest-preset": "0.5.
|
|
18
|
-
"@wyw-in-js/ts-config": "0.5.
|
|
15
|
+
"@wyw-in-js/babel-config": "0.5.1",
|
|
16
|
+
"@wyw-in-js/eslint-config": "0.5.1",
|
|
17
|
+
"@wyw-in-js/jest-preset": "0.5.1",
|
|
18
|
+
"@wyw-in-js/ts-config": "0.5.1"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=16.0.0"
|
package/types/options/types.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ type AllFeatureFlags = {
|
|
|
37
37
|
happyDOM: FeatureFlag;
|
|
38
38
|
softErrors: FeatureFlag;
|
|
39
39
|
useBabelConfigs: FeatureFlag;
|
|
40
|
+
useWeakRefInEval: FeatureFlag;
|
|
40
41
|
};
|
|
41
42
|
export type FeatureFlags<TOnly extends keyof AllFeatureFlags = keyof AllFeatureFlags> = Pick<AllFeatureFlags, TOnly>;
|
|
42
43
|
export type StrictOptions = {
|