kist 0.0.0 → 0.1.31
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/LICENSE +21 -0
- package/README.md +298 -3
- package/js/actions/CoreActions.d.ts +6 -0
- package/js/actions/CoreActions.js +47 -0
- package/js/actions/DirectoryCleanAction/DirectoryCleanAction.d.ts +36 -0
- package/js/actions/DirectoryCleanAction/DirectoryCleanAction.js +123 -0
- package/js/actions/DirectoryCleanAction/index.d.ts +2 -0
- package/js/actions/DirectoryCleanAction/index.js +8 -0
- package/js/actions/DirectoryCopyAction/DirectoryCopyAction.d.ts +42 -0
- package/js/actions/DirectoryCopyAction/DirectoryCopyAction.js +118 -0
- package/js/actions/DirectoryCopyAction/index.d.ts +2 -0
- package/js/actions/DirectoryCopyAction/index.js +8 -0
- package/js/actions/DirectoryCreateAction/DirectoryCreateAction.d.ts +30 -0
- package/js/actions/DirectoryCreateAction/DirectoryCreateAction.js +85 -0
- package/js/actions/DirectoryCreateAction/index.d.ts +2 -0
- package/js/actions/DirectoryCreateAction/index.js +8 -0
- package/js/actions/DocumentationAction/DocumentationAction.d.ts +23 -0
- package/js/actions/DocumentationAction/DocumentationAction.js +88 -0
- package/js/actions/DocumentationAction/index.d.ts +2 -0
- package/js/actions/DocumentationAction/index.js +8 -0
- package/js/actions/FileCopyAction/FileCopyAction.d.ts +42 -0
- package/js/actions/FileCopyAction/FileCopyAction.js +127 -0
- package/js/actions/FileCopyAction/index.d.ts +2 -0
- package/js/actions/FileCopyAction/index.js +8 -0
- package/js/actions/FileRenameAction/FileRenameAction.d.ts +30 -0
- package/js/actions/FileRenameAction/FileRenameAction.js +84 -0
- package/js/actions/FileRenameAction/index.d.ts +2 -0
- package/js/actions/FileRenameAction/index.js +8 -0
- package/js/actions/JavaScriptMinifyAction/JavaScriptMinifyAction.d.ts +31 -0
- package/js/actions/JavaScriptMinifyAction/JavaScriptMinifyAction.js +98 -0
- package/js/actions/JavaScriptMinifyAction/index.d.ts +2 -0
- package/js/actions/JavaScriptMinifyAction/index.js +8 -0
- package/js/actions/JavaScriptMinifyAction/terser.config.d.ts +27 -0
- package/js/actions/JavaScriptMinifyAction/terser.config.js +119 -0
- package/js/actions/LintAction/LintAction.d.ts +17 -0
- package/js/actions/LintAction/LintAction.js +63 -0
- package/js/actions/LintAction/index.d.ts +2 -0
- package/js/actions/LintAction/index.js +8 -0
- package/js/actions/PackageManagerAction/PackageManagerAction.d.ts +57 -0
- package/js/actions/PackageManagerAction/PackageManagerAction.js +161 -0
- package/js/actions/PackageManagerAction/index.d.ts +2 -0
- package/js/actions/PackageManagerAction/index.js +8 -0
- package/js/actions/PackageManagerAction/package.config.d.ts +16 -0
- package/js/actions/PackageManagerAction/package.config.js +91 -0
- package/js/actions/StyleProcessingAction/StyleProcessingAction.d.ts +34 -0
- package/js/actions/StyleProcessingAction/StyleProcessingAction.js +164 -0
- package/js/actions/StyleProcessingAction/index.d.ts +2 -0
- package/js/actions/StyleProcessingAction/index.js +8 -0
- package/js/actions/StyleProcessingAction/postcss.config.compressed.d.ts +10 -0
- package/js/actions/StyleProcessingAction/postcss.config.compressed.js +31 -0
- package/js/actions/StyleProcessingAction/postcss.config.expanded.d.ts +16 -0
- package/js/actions/StyleProcessingAction/postcss.config.expanded.js +45 -0
- package/js/actions/SvgPackagerAction/SvgPackagerAction.d.ts +68 -0
- package/js/actions/SvgPackagerAction/SvgPackagerAction.js +186 -0
- package/js/actions/SvgPackagerAction/index.d.ts +2 -0
- package/js/actions/SvgPackagerAction/index.js +8 -0
- package/js/actions/SvgReaderAction/SvgReaderAction.d.ts +32 -0
- package/js/actions/SvgReaderAction/SvgReaderAction.js +87 -0
- package/js/actions/SvgReaderAction/index.d.ts +2 -0
- package/js/actions/SvgReaderAction/index.js +8 -0
- package/js/actions/SvgSpriteAction/SvgSpriteAction.d.ts +37 -0
- package/js/actions/SvgSpriteAction/SvgSpriteAction.js +114 -0
- package/js/actions/SvgSpriteAction/index.d.ts +2 -0
- package/js/actions/SvgSpriteAction/index.js +8 -0
- package/js/actions/SvgSpriteAction/svgsprite.config.d.ts +3 -0
- package/js/actions/SvgSpriteAction/svgsprite.config.js +117 -0
- package/js/actions/SvgToPngAction/SvgToPngAction.d.ts +28 -0
- package/js/actions/SvgToPngAction/SvgToPngAction.js +108 -0
- package/js/actions/SvgToPngAction/index.d.ts +2 -0
- package/js/actions/SvgToPngAction/index.js +8 -0
- package/js/actions/TypeScriptCompilerAction/TypeScriptCompilerAction.d.ts +28 -0
- package/js/actions/TypeScriptCompilerAction/TypeScriptCompilerAction.js +96 -0
- package/js/actions/TypeScriptCompilerAction/index.d.ts +2 -0
- package/js/actions/TypeScriptCompilerAction/index.js +8 -0
- package/js/actions/VersionWriteAction/VersionWriteAction.d.ts +45 -0
- package/js/actions/VersionWriteAction/VersionWriteAction.js +147 -0
- package/js/actions/VersionWriteAction/index.d.ts +2 -0
- package/js/actions/VersionWriteAction/index.js +8 -0
- package/js/cli/ArgumentParser.d.ts +62 -0
- package/js/cli/ArgumentParser.js +118 -0
- package/js/cli.d.ts +6 -0
- package/js/cli.js +58 -0
- package/js/core/abstract/AbstractProcess.d.ts +62 -0
- package/js/core/abstract/AbstractProcess.js +96 -0
- package/js/core/abstract/AbstractValidator.d.ts +72 -0
- package/js/core/abstract/AbstractValidator.js +128 -0
- package/js/core/config/ConfigLoader.d.ts +47 -0
- package/js/core/config/ConfigLoader.js +130 -0
- package/js/core/config/ConfigStore.d.ts +53 -0
- package/js/core/config/ConfigStore.js +136 -0
- package/js/core/config/defaultConfig.d.ts +5 -0
- package/js/core/config/defaultConfig.js +131 -0
- package/js/core/pipeline/Action.d.ts +60 -0
- package/js/core/pipeline/Action.js +77 -0
- package/js/core/pipeline/ActionRegistry.d.ts +80 -0
- package/js/core/pipeline/ActionRegistry.js +180 -0
- package/js/core/pipeline/Pipeline.d.ts +42 -0
- package/js/core/pipeline/Pipeline.js +107 -0
- package/js/core/pipeline/PipelineManager.d.ts +55 -0
- package/js/core/pipeline/PipelineManager.js +164 -0
- package/js/core/pipeline/Stage.d.ts +45 -0
- package/js/core/pipeline/Stage.js +110 -0
- package/js/core/pipeline/Step.d.ts +26 -0
- package/js/core/pipeline/Step.js +85 -0
- package/js/core/validation/OptionsValidator.d.ts +43 -0
- package/js/core/validation/OptionsValidator.js +123 -0
- package/js/index.d.ts +3 -0
- package/js/index.js +36 -0
- package/js/interface/ActionInterface.d.ts +57 -0
- package/js/interface/ActionInterface.js +5 -0
- package/js/interface/ActionPlugin.d.ts +4 -0
- package/js/interface/ActionPlugin.js +5 -0
- package/js/interface/ConfigInterface.d.ts +43 -0
- package/js/interface/ConfigInterface.js +5 -0
- package/js/interface/LiveOptionsInterface.d.ts +42 -0
- package/js/interface/LiveOptionsInterface.js +2 -0
- package/js/interface/MetadataInterface.d.ts +95 -0
- package/js/interface/MetadataInterface.js +2 -0
- package/js/interface/OptionsInterface.d.ts +45 -0
- package/js/interface/OptionsInterface.js +5 -0
- package/js/interface/PipelineOptionsInterface.d.ts +66 -0
- package/js/interface/PipelineOptionsInterface.js +5 -0
- package/js/interface/StageInterface.d.ts +79 -0
- package/js/interface/StageInterface.js +5 -0
- package/js/interface/StepInterface.d.ts +66 -0
- package/js/interface/StepInterface.js +5 -0
- package/js/interface/StepOptionsInterface.d.ts +38 -0
- package/js/interface/StepOptionsInterface.js +21 -0
- package/js/interface/index.d.ts +7 -0
- package/js/interface/index.js +3 -0
- package/js/kist.d.ts +58 -0
- package/js/kist.js +145 -0
- package/js/live/LiveServer.d.ts +95 -0
- package/js/live/LiveServer.js +233 -0
- package/js/live/LiveWatcher.d.ts +45 -0
- package/js/live/LiveWatcher.js +140 -0
- package/js/logger/Logger.d.ts +94 -0
- package/js/logger/Logger.js +151 -0
- package/js/logger/LoggerStyles.d.ts +23 -0
- package/js/logger/LoggerStyles.js +30 -0
- package/js/types/ActionOptionsType.d.ts +8 -0
- package/js/types/ActionOptionsType.js +2 -0
- package/js/types/index.d.ts +1 -0
- package/js/types/index.js +3 -0
- package/package.json +93 -7
- package/ts/actions/CoreActions.ts +64 -0
- package/ts/actions/DirectoryCleanAction/DirectoryCleanAction.ts +121 -0
- package/ts/actions/DirectoryCleanAction/index.ts +11 -0
- package/ts/actions/DirectoryCopyAction/DirectoryCopyAction.ts +118 -0
- package/ts/actions/DirectoryCopyAction/index.ts +11 -0
- package/ts/actions/DirectoryCreateAction/DirectoryCreateAction.ts +81 -0
- package/ts/actions/DirectoryCreateAction/index.ts +11 -0
- package/ts/actions/DocumentationAction/DocumentationAction.ts +100 -0
- package/ts/actions/DocumentationAction/index.ts +11 -0
- package/ts/actions/FileCopyAction/FileCopyAction.ts +125 -0
- package/ts/actions/FileCopyAction/index.ts +11 -0
- package/ts/actions/FileRenameAction/FileRenameAction.ts +82 -0
- package/ts/actions/FileRenameAction/index.ts +11 -0
- package/ts/actions/JavaScriptMinifyAction/JavaScriptMinifyAction.ts +109 -0
- package/ts/actions/JavaScriptMinifyAction/index.ts +11 -0
- package/ts/actions/JavaScriptMinifyAction/terser.config.ts +177 -0
- package/ts/actions/LintAction/LintAction.ts +67 -0
- package/ts/actions/LintAction/index.ts +11 -0
- package/ts/actions/PackageManagerAction/PackageManagerAction.ts +176 -0
- package/ts/actions/PackageManagerAction/index.ts +11 -0
- package/ts/actions/PackageManagerAction/package.config.ts +94 -0
- package/ts/actions/SassDocAction/SassDocAction.ts +66 -0
- package/ts/actions/SassDocAction/index.ts +11 -0
- package/ts/actions/StyleProcessingAction/StyleProcessingAction.ts +142 -0
- package/ts/actions/StyleProcessingAction/index.ts +11 -0
- package/ts/actions/StyleProcessingAction/postcss.config.compressed.ts +31 -0
- package/ts/actions/StyleProcessingAction/postcss.config.expanded.ts +47 -0
- package/ts/actions/SvgPackagerAction/SvgPackagerAction.ts +187 -0
- package/ts/actions/SvgPackagerAction/index.ts +11 -0
- package/ts/actions/SvgReaderAction/SvgReaderAction.ts +77 -0
- package/ts/actions/SvgReaderAction/index.ts +11 -0
- package/ts/actions/SvgSpriteAction/SvgSpriteAction.ts +127 -0
- package/ts/actions/SvgSpriteAction/index.ts +11 -0
- package/ts/actions/SvgSpriteAction/svgsprite.config.ts +123 -0
- package/ts/actions/SvgToPngAction/SvgToPngAction.ts +113 -0
- package/ts/actions/SvgToPngAction/index.ts +11 -0
- package/ts/actions/TypeScriptCompilerAction/TypeScriptCompilerAction.ts +117 -0
- package/ts/actions/TypeScriptCompilerAction/index.ts +11 -0
- package/ts/actions/VersionWriteAction/VersionWriteAction.ts +174 -0
- package/ts/actions/VersionWriteAction/index.ts +11 -0
- package/ts/actions/index.ts +0 -0
- package/ts/cli/ArgumentParser.ts +150 -0
- package/ts/cli/index.ts +1 -0
- package/ts/cli.ts +56 -0
- package/ts/core/abstract/AbstractProcess.ts +109 -0
- package/ts/core/abstract/AbstractSingleton.ts +46 -0
- package/ts/core/abstract/AbstractValidator.ts +167 -0
- package/ts/core/abstract/index.ts +0 -0
- package/ts/core/config/ConfigLoader.ts +141 -0
- package/ts/core/config/ConfigStore copy.ts +201 -0
- package/ts/core/config/ConfigStore.ts +157 -0
- package/ts/core/config/defaultConfig.ts +154 -0
- package/ts/core/config/index.ts +0 -0
- package/ts/core/index.ts +34 -0
- package/ts/core/pipeline/Action.ts +101 -0
- package/ts/core/pipeline/ActionRegistry.ts +216 -0
- package/ts/core/pipeline/Pipeline.ts +121 -0
- package/ts/core/pipeline/PipelineManager.ts +170 -0
- package/ts/core/pipeline/Stage.ts +131 -0
- package/ts/core/pipeline/Step.ts +96 -0
- package/ts/core/pipeline/index.ts +0 -0
- package/ts/core/validation/ActionValidator.ts +97 -0
- package/ts/core/validation/ConfigValidator.ts +103 -0
- package/ts/core/validation/OptionsValidator.ts +179 -0
- package/ts/core/validation/StageValidator.ts +175 -0
- package/ts/core/validation/StepValidator.ts +203 -0
- package/ts/core/validation/index.ts +0 -0
- package/ts/index.ts +26 -0
- package/ts/interface/ActionInterface.ts +70 -0
- package/ts/interface/ActionPlugin.ts +14 -0
- package/ts/interface/ConfigInterface.ts +55 -0
- package/ts/interface/File.ts +24 -0
- package/ts/interface/LiveOptionsInterface.ts +46 -0
- package/ts/interface/MetadataInterface.ts +105 -0
- package/ts/interface/OptionsInterface.ts +58 -0
- package/ts/interface/PackageJson.ts +171 -0
- package/ts/interface/PipelineOptionsInterface.ts +74 -0
- package/ts/interface/SVG.ts +84 -0
- package/ts/interface/StageInterface.ts +96 -0
- package/ts/interface/StepInterface.ts +83 -0
- package/ts/interface/StepOptionsInterface.ts +57 -0
- package/ts/interface/index.ts +9 -0
- package/ts/kist.ts +161 -0
- package/ts/live/LiveServer.ts +311 -0
- package/ts/live/LiveWatcher.ts +150 -0
- package/ts/live/index.ts +11 -0
- package/ts/logger/Logger.ts +187 -0
- package/ts/logger/LoggerStyles.ts +28 -0
- package/ts/logger/index.ts +0 -0
- package/ts/types/ActionOptionsType.ts +10 -0
- package/ts/types/index.ts +3 -0
- package/index.js +0 -3
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Import
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Constants
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
// https://terser.org/docs/api-reference/
|
|
10
|
+
|
|
11
|
+
const terserConfig = {
|
|
12
|
+
parse: {
|
|
13
|
+
// parse options
|
|
14
|
+
},
|
|
15
|
+
compress: {
|
|
16
|
+
// compress options
|
|
17
|
+
drop_console: true, // Remove console.log statements
|
|
18
|
+
drop_debugger: true, // Remove debugger statements
|
|
19
|
+
pure_funcs: ["console.info", "console.debug", "console.warn"], // Remove specific console functions
|
|
20
|
+
|
|
21
|
+
// defaults (default: true) -- Pass false to disable most default enabled compress transforms. Useful when you only want to enable a few compress options while disabling the rest.
|
|
22
|
+
|
|
23
|
+
// Class and object literal methods are converted will also be
|
|
24
|
+
// converted to arrow expressions if the resultant code is shorter:
|
|
25
|
+
// m(){return x} becomes m:()=>x. To do this to regular ES5 functions
|
|
26
|
+
// which don't use this or arguments, see unsafe_arrows.
|
|
27
|
+
arrows: true, // (default: true)
|
|
28
|
+
|
|
29
|
+
// arguments (default: false) -- replace arguments[index] with function parameter name whenever possible.
|
|
30
|
+
|
|
31
|
+
// booleans (default: true) -- various optimizations for boolean context, for example !!a ? b : c → a ? b : c
|
|
32
|
+
|
|
33
|
+
// booleans_as_integers (default: false) -- Turn booleans into 0 and 1, also makes comparisons with booleans use == and != instead of === and !==.
|
|
34
|
+
|
|
35
|
+
// collapse_vars (default: true) -- Collapse single-use non-constant variables, side effects permitting.
|
|
36
|
+
|
|
37
|
+
// comparisons (default: true) -- apply certain optimizations to binary nodes, e.g. !(a <= b) → a > b (only when unsafe_comps), attempts to negate binary nodes, e.g. a = !b && !c && !d && !e → a=!(b||c||d||e) etc. Note: comparisons works best with lhs_constants enabled.
|
|
38
|
+
|
|
39
|
+
// computed_props (default: true) -- Transforms constant computed properties into regular ones: {["computed"]: 1} is converted to {computed: 1}.
|
|
40
|
+
|
|
41
|
+
// conditionals (default: true) -- apply optimizations for if-s and conditional expressions
|
|
42
|
+
|
|
43
|
+
// dead_code (default: true) -- remove unreachable code
|
|
44
|
+
|
|
45
|
+
// directives (default: true) -- remove redundant or non-standard directives
|
|
46
|
+
|
|
47
|
+
// drop_console (default: false) -- Pass true to discard calls to console.* functions. If you only want to discard a portion of console, you can pass an array like this ['log', 'info'], which will only discard console.log、 console.info.
|
|
48
|
+
|
|
49
|
+
// drop_debugger (default: true) -- remove debugger; statements
|
|
50
|
+
|
|
51
|
+
// ecma (default: 5) -- Pass 2015 or greater to enable compress options that will transform ES5 code into smaller ES6+ equivalent forms.
|
|
52
|
+
|
|
53
|
+
// evaluate (default: true) -- attempt to evaluate constant expressions
|
|
54
|
+
|
|
55
|
+
// expression (default: false) -- Pass true to preserve completion values from terminal statements without return, e.g. in bookmarklets.
|
|
56
|
+
|
|
57
|
+
// global_defs (default: {}) -- see conditional compilation
|
|
58
|
+
|
|
59
|
+
// hoist_funs (default: false) -- hoist function declarations
|
|
60
|
+
|
|
61
|
+
// hoist_props (default: true) -- hoist properties from constant object and array literals into regular variables subject to a set of constraints. For example: var o={p:1, q:2}; f(o.p, o.q); is converted to f(1, 2);. Note: hoist_props works best with mangle enabled, the compress option passes set to 2 or higher, and the compress option toplevel enabled.
|
|
62
|
+
|
|
63
|
+
// hoist_vars (default: false) -- hoist var declarations (this is false by default because it seems to increase the size of the output in general)
|
|
64
|
+
|
|
65
|
+
// if_return (default: true) -- optimizations for if/return and if/continue
|
|
66
|
+
|
|
67
|
+
// inline (default: true) -- inline calls to function with simple/return statement:
|
|
68
|
+
|
|
69
|
+
// false -- same as 0
|
|
70
|
+
// 0 -- disabled inlining
|
|
71
|
+
// 1 -- inline simple functions
|
|
72
|
+
// 2 -- inline functions with arguments
|
|
73
|
+
// 3 -- inline functions with arguments and variables
|
|
74
|
+
// true -- same as 3
|
|
75
|
+
// join_vars (default: true) -- join consecutive var, let and const statements
|
|
76
|
+
|
|
77
|
+
// keep_classnames (default: false) -- Pass true to prevent the compressor from discarding class names. Pass a regular expression to only keep class names matching that regex. See also: the keep_classnames mangle option.
|
|
78
|
+
|
|
79
|
+
// keep_fargs (default: true) -- Prevents the compressor from discarding unused function arguments. You need this for code which relies on Function.length.
|
|
80
|
+
|
|
81
|
+
// keep_fnames (default: false) -- Pass true to prevent the compressor from discarding function names. Pass a regular expression to only keep function names matching that regex. Useful for code relying on Function.prototype.name. See also: the keep_fnames mangle option.
|
|
82
|
+
|
|
83
|
+
// keep_infinity (default: false) -- Pass true to prevent Infinity from being compressed into 1/0, which may cause performance issues on Chrome.
|
|
84
|
+
|
|
85
|
+
// lhs_constants (default: true) -- Moves constant values to the left-hand side of binary nodes. foo == 42 → 42 == foo
|
|
86
|
+
|
|
87
|
+
// loops (default: true) -- optimizations for do, while and for loops when we can statically determine the condition.
|
|
88
|
+
|
|
89
|
+
// module (default false) -- Pass true when compressing an ES6 module. Strict mode is implied and the toplevel option as well.
|
|
90
|
+
|
|
91
|
+
// negate_iife (default: true) -- negate "Immediately-Called Function Expressions" where the return value is discarded, to avoid the parens that the code generator would insert.
|
|
92
|
+
|
|
93
|
+
// passes (default: 1) -- The maximum number of times to run compress. In some cases more than one pass leads to further compressed code. Keep in mind more passes will take more time.
|
|
94
|
+
|
|
95
|
+
// properties (default: true) -- rewrite property access using the dot notation, for example foo["bar"] → foo.bar
|
|
96
|
+
|
|
97
|
+
// pure_funcs (default: null) -- You can pass an array of names and Terser will assume that those functions do not produce side effects. DANGER: will not check if the name is redefined in scope. An example case here, for instance var q = Math.floor(a/b). If variable q is not used elsewhere, Terser will drop it, but will still keep the Math.floor(a/b), not knowing what it does. You can pass pure_funcs: [ 'Math.floor' ] to let it know that this function won't produce any side effect, in which case the whole statement would get discarded. The current implementation adds some overhead (compression will be slower).
|
|
98
|
+
|
|
99
|
+
// pure_getters (default: "strict") -- If you pass true for this, Terser will assume that object property access (e.g. foo.bar or foo["bar"]) doesn't have any side effects. Specify "strict" to treat foo.bar as side-effect-free only when foo is certain to not throw, i.e. not null or undefined.
|
|
100
|
+
|
|
101
|
+
// pure_new (default: false) -- Set to true to assume new X() never has side effects.
|
|
102
|
+
|
|
103
|
+
// reduce_vars (default: true) -- Improve optimization on variables assigned with and used as constant values.
|
|
104
|
+
|
|
105
|
+
// reduce_funcs (default: true) -- Inline single-use functions when possible. Depends on reduce_vars being enabled. Disabling this option sometimes improves performance of the output code.
|
|
106
|
+
|
|
107
|
+
// sequences (default: true) -- join consecutive simple statements using the comma operator. May be set to a positive integer to specify the maximum number of consecutive comma sequences that will be generated. If this option is set to true then the default sequences limit is 200. Set option to false or 0 to disable. The smallest sequences length is 2. A sequences value of 1 is grandfathered to be equivalent to true and as such means 200. On rare occasions the default sequences limit leads to very slow compress times in which case a value of 20 or less is recommended.
|
|
108
|
+
|
|
109
|
+
// side_effects (default: true) -- Remove expressions which have no side effects and whose results aren't used.
|
|
110
|
+
|
|
111
|
+
// switches (default: true) -- de-duplicate and remove unreachable switch branches
|
|
112
|
+
|
|
113
|
+
// toplevel (default: false) -- drop unreferenced functions ("funcs") and/or variables ("vars") in the top level scope (false by default, true to drop both unreferenced functions and variables)
|
|
114
|
+
|
|
115
|
+
// top_retain (default: null) -- prevent specific toplevel functions and variables from unused removal (can be array, comma-separated, RegExp or function. Implies toplevel)
|
|
116
|
+
|
|
117
|
+
// typeofs (default: true) -- Transforms typeof foo == "undefined" into foo === void 0. Note: recommend to set this value to false for IE10 and earlier versions due to known issues.
|
|
118
|
+
|
|
119
|
+
// unsafe (default: false) -- apply "unsafe" transformations (details).
|
|
120
|
+
|
|
121
|
+
// unsafe_arrows (default: false) -- Convert ES5 style anonymous function expressions to arrow functions if the function body does not reference this. Note: it is not always safe to perform this conversion if code relies on the the function having a prototype, which arrow functions lack. This transform requires that the ecma compress option is set to 2015 or greater.
|
|
122
|
+
|
|
123
|
+
// unsafe_comps (default: false) -- Reverse < and <= to > and >= to allow improved compression. This might be unsafe when an at least one of two operands is an object with computed values due the use of methods like get, or valueOf. This could cause change in execution order after operands in the comparison are switching. Compression only works if both comparisons and unsafe_comps are both set to true.
|
|
124
|
+
|
|
125
|
+
// unsafe_Function (default: false) -- compress and mangle Function(args, code) when both args and code are string literals.
|
|
126
|
+
|
|
127
|
+
// unsafe_math (default: false) -- optimize numerical expressions like 2 * x * 3 into 6 * x, which may give imprecise floating point results.
|
|
128
|
+
|
|
129
|
+
// unsafe_symbols (default: false) -- removes keys from native Symbol declarations, e.g Symbol("kDog") becomes Symbol().
|
|
130
|
+
|
|
131
|
+
// unsafe_methods (default: false) -- Converts { m: function(){} } to { m(){} }. ecma must be set to 6 or greater to enable this transform. If unsafe_methods is a RegExp then key/value pairs with keys matching the RegExp will be converted to concise methods. Note: if enabled there is a risk of getting a "<method name> is not a constructor" TypeError should any code try to new the former function.
|
|
132
|
+
|
|
133
|
+
// unsafe_proto (default: false) -- optimize expressions like Array.prototype.slice.call(a) into [].slice.call(a)
|
|
134
|
+
|
|
135
|
+
// unsafe_regexp (default: false) -- enable substitutions of variables with RegExp values the same way as if they are constants.
|
|
136
|
+
|
|
137
|
+
// unsafe_undefined (default: false) -- substitute void 0 if there is a variable named undefined in scope (variable name will be mangled, typically reduced to a single character)
|
|
138
|
+
|
|
139
|
+
// unused (default: true) -- drop unreferenced functions and variables (simple direct variable assignments do not count as references unless set to "keep_assign")
|
|
140
|
+
},
|
|
141
|
+
mangle: {
|
|
142
|
+
// mangle options
|
|
143
|
+
// Mangle names for obfuscation and size reduction
|
|
144
|
+
properties: true, // Mangle property names
|
|
145
|
+
// properties: {
|
|
146
|
+
// // mangle property options // gives error messages
|
|
147
|
+
// // bare_returns: false, //support top level return statements
|
|
148
|
+
// html5_comments: true, // (default true)
|
|
149
|
+
// shebang: true, //(default true) -- support #!command as the first line
|
|
150
|
+
// spidermonkey: false, // (default false) -- accept a Spidermonkey (Mozilla) AST
|
|
151
|
+
// }
|
|
152
|
+
},
|
|
153
|
+
format: {
|
|
154
|
+
// format options (can also use `output` for backwards compatibility)
|
|
155
|
+
comments: false, // Remove comments to reduce file size
|
|
156
|
+
beautify: false, // Disable beautification for smaller file size
|
|
157
|
+
},
|
|
158
|
+
sourceMap: {
|
|
159
|
+
// source map options
|
|
160
|
+
},
|
|
161
|
+
// Define ECMAScript target version
|
|
162
|
+
ecma: 5, // specify one of: 5, 2015, 2016, etc.
|
|
163
|
+
enclose: false, // or specify true, or "args:values"
|
|
164
|
+
keep_classnames: false, // Remove class names
|
|
165
|
+
keep_fnames: false, // Remove function names
|
|
166
|
+
ie8: false,
|
|
167
|
+
module: false,
|
|
168
|
+
nameCache: null, // or specify a name cache object
|
|
169
|
+
safari10: false,
|
|
170
|
+
toplevel: true, // Enable top-level variable and function name mangling
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// ============================================================================
|
|
174
|
+
// Export
|
|
175
|
+
// ============================================================================
|
|
176
|
+
|
|
177
|
+
export default terserConfig;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Import
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
import { ESLint } from "eslint";
|
|
6
|
+
import { Action } from "../../core/pipeline/Action";
|
|
7
|
+
import { ActionOptionsType } from "../../types/ActionOptionsType";
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Classes
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* LintAction handles linting TypeScript and JavaScript files using ESLint.
|
|
15
|
+
* This action can be configured to run in strict mode or automatically fix issues.
|
|
16
|
+
*/
|
|
17
|
+
export class LintAction extends Action {
|
|
18
|
+
private eslint: ESLint;
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
super(); // Call the parent class constructor
|
|
22
|
+
this.eslint = new ESLint({}); // Initialize ESLint with default config
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async execute(options: ActionOptionsType): Promise<void> {
|
|
26
|
+
const {
|
|
27
|
+
targetFiles = ["src/**/*.ts"],
|
|
28
|
+
fix = false,
|
|
29
|
+
configPath = ".eslintrc.js",
|
|
30
|
+
} = options;
|
|
31
|
+
|
|
32
|
+
if (!targetFiles || targetFiles.length === 0) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
"Invalid options: 'targetFiles' is required and must contain at least one file or directory.",
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
this.logInfo(`Starting ESLint on: ${targetFiles.join(", ")}`);
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
// Update ESLint instance with correct configuration
|
|
42
|
+
this.eslint = new ESLint({ fix, overrideConfigFile: configPath });
|
|
43
|
+
const results = await this.eslint.lintFiles(targetFiles);
|
|
44
|
+
|
|
45
|
+
if (fix) {
|
|
46
|
+
await ESLint.outputFixes(results);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const formatter = await this.eslint.loadFormatter("stylish");
|
|
50
|
+
console.log(formatter.format(results));
|
|
51
|
+
|
|
52
|
+
this.logInfo("ESLint linting completed successfully.");
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.logError("ESLint encountered an error.", error);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Provides a description of the action.
|
|
61
|
+
*
|
|
62
|
+
* @returns A string description of the action.
|
|
63
|
+
*/
|
|
64
|
+
describe(): string {
|
|
65
|
+
return "Runs ESLint on specified files and directories, with optional auto-fixing.";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Import
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
import { LintAction } from "./LintAction";
|
|
6
|
+
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Export
|
|
9
|
+
// ============================================================================
|
|
10
|
+
|
|
11
|
+
export { LintAction };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Import
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
import fs from "fs/promises";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { Action } from "../../core/pipeline/Action";
|
|
8
|
+
import { ActionOptionsType } from "../../types/ActionOptionsType.js";
|
|
9
|
+
import packageConfig from "./package.config.js";
|
|
10
|
+
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Classes
|
|
13
|
+
// ============================================================================
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* PackageManagerAction handles reading, validating, and creating `package.json`
|
|
17
|
+
* files, supporting custom configurations and merging with selected fields.
|
|
18
|
+
*/
|
|
19
|
+
export class PackageManagerAction extends Action {
|
|
20
|
+
/**
|
|
21
|
+
* Executes the package management action.
|
|
22
|
+
* Reads an existing `package.json`, extracts selected fields, and writes a new one.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Options specifying input path, output directory, and fields to export.
|
|
25
|
+
* @returns A Promise that resolves when the action is completed successfully.
|
|
26
|
+
* @throws {Error} Throws an error if neither `packageJsonPath` nor `outputDir` is provided.
|
|
27
|
+
*/
|
|
28
|
+
async execute(options: ActionOptionsType): Promise<void> {
|
|
29
|
+
const {
|
|
30
|
+
packageJsonPath,
|
|
31
|
+
outputDir,
|
|
32
|
+
fields = [], // Specify which fields to copy
|
|
33
|
+
customConfig = {},
|
|
34
|
+
} = options;
|
|
35
|
+
|
|
36
|
+
if (!packageJsonPath) {
|
|
37
|
+
throw new Error("The 'packageJsonPath' option is required.");
|
|
38
|
+
}
|
|
39
|
+
if (!outputDir) {
|
|
40
|
+
throw new Error("The 'outputDir' option is required.");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const existingConfig = await this.readPackageJson(packageJsonPath);
|
|
44
|
+
const filteredConfig = this.filterFields(existingConfig, fields);
|
|
45
|
+
|
|
46
|
+
await this.createPackageJson(outputDir, filteredConfig, customConfig);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Reads and parses an existing `package.json`.
|
|
51
|
+
*
|
|
52
|
+
* @param packageJsonPath - Path to the `package.json` file.
|
|
53
|
+
* @returns Parsed JSON object.
|
|
54
|
+
* @throws {Error} If the file does not exist or contains invalid JSON.
|
|
55
|
+
*/
|
|
56
|
+
private async readPackageJson(
|
|
57
|
+
packageJsonPath: string,
|
|
58
|
+
): Promise<Record<string, unknown>> {
|
|
59
|
+
const fullPath = path.resolve(packageJsonPath);
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
const fileContent = await fs.readFile(fullPath, "utf-8");
|
|
63
|
+
const parsedContent = JSON.parse(fileContent);
|
|
64
|
+
this.logInfo(`Successfully read package.json from ${fullPath}`);
|
|
65
|
+
return parsedContent;
|
|
66
|
+
} catch (error: any) {
|
|
67
|
+
if (error.code === "ENOENT") {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`File not found at ${fullPath}. Please ensure the path is correct.`,
|
|
70
|
+
);
|
|
71
|
+
} else if (error.name === "SyntaxError") {
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Invalid JSON in ${fullPath}: ${error.message}`,
|
|
74
|
+
);
|
|
75
|
+
} else {
|
|
76
|
+
throw new Error(
|
|
77
|
+
`Unexpected error while reading ${fullPath}: ${error.message}`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Filters specified fields from a `package.json` object.
|
|
85
|
+
*
|
|
86
|
+
* @param config - The original package.json object.
|
|
87
|
+
* @param fields - List of fields to extract.
|
|
88
|
+
* @returns A new object containing only the selected fields.
|
|
89
|
+
*/
|
|
90
|
+
private filterFields(
|
|
91
|
+
config: Record<string, unknown>,
|
|
92
|
+
fields: string[],
|
|
93
|
+
): Record<string, unknown> {
|
|
94
|
+
if (!fields.length) {
|
|
95
|
+
return config; // If no fields are specified, return the full config.
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const filteredConfig: Record<string, unknown> = {};
|
|
99
|
+
for (const field of fields) {
|
|
100
|
+
if (config[field] !== undefined) {
|
|
101
|
+
filteredConfig[field] = config[field];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
this.logInfo(
|
|
106
|
+
`Filtered package.json fields: ${JSON.stringify(filteredConfig, null, 2)}`,
|
|
107
|
+
);
|
|
108
|
+
return filteredConfig;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Creates a `package.json` file with selected fields and custom overrides.
|
|
113
|
+
*
|
|
114
|
+
* @param outputDir - Directory where the new `package.json` will be created.
|
|
115
|
+
* @param filteredConfig - The filtered package.json fields.
|
|
116
|
+
* @param customConfig - Custom overrides to apply.
|
|
117
|
+
* @returns A Promise that resolves when the file has been successfully created.
|
|
118
|
+
* @throws {Error} If the file cannot be written.
|
|
119
|
+
*/
|
|
120
|
+
private async createPackageJson(
|
|
121
|
+
outputDir: string,
|
|
122
|
+
filteredConfig: Record<string, any>,
|
|
123
|
+
customConfig: Record<string, any>,
|
|
124
|
+
): Promise<void> {
|
|
125
|
+
const filePath = path.join(outputDir, "package.json");
|
|
126
|
+
|
|
127
|
+
// Merge default settings with filtered config and custom overrides
|
|
128
|
+
const finalConfig = {
|
|
129
|
+
...packageConfig,
|
|
130
|
+
...filteredConfig,
|
|
131
|
+
...customConfig,
|
|
132
|
+
};
|
|
133
|
+
const data = JSON.stringify(finalConfig, null, 2);
|
|
134
|
+
|
|
135
|
+
try {
|
|
136
|
+
await this.ensureDirectoryExists(outputDir);
|
|
137
|
+
await fs.writeFile(filePath, data, "utf-8");
|
|
138
|
+
this.logInfo(`package.json successfully created at ${filePath}`);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
this.logError("Error creating package.json", error);
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Ensures that the specified directory exists, creating it if it does not.
|
|
147
|
+
*
|
|
148
|
+
* @param dirPath - The path of the directory to verify or create.
|
|
149
|
+
* @returns A Promise that resolves once the directory is verified or created.
|
|
150
|
+
* @throws {Error} If the directory cannot be created.
|
|
151
|
+
*/
|
|
152
|
+
private async ensureDirectoryExists(dirPath: string): Promise<void> {
|
|
153
|
+
try {
|
|
154
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
155
|
+
} catch (error) {
|
|
156
|
+
if ((error as NodeJS.ErrnoException).code !== "EEXIST") {
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Provides a description of the action.
|
|
164
|
+
*
|
|
165
|
+
* @returns A string description of the action.
|
|
166
|
+
*/
|
|
167
|
+
describe(): string {
|
|
168
|
+
return "Reads an existing package.json, extracts selected fields, and creates a new one.";
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// ============================================================================
|
|
173
|
+
// Export
|
|
174
|
+
// ============================================================================
|
|
175
|
+
|
|
176
|
+
// export default PackageManagerAction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Import
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
import { PackageManagerAction } from "./PackageManagerAction";
|
|
6
|
+
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Export
|
|
9
|
+
// ============================================================================
|
|
10
|
+
|
|
11
|
+
export { PackageManagerAction };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Constants
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Configuration object for package.json properties, used to define metadata,
|
|
7
|
+
* file inclusions, and other necessary project configurations.
|
|
8
|
+
*/
|
|
9
|
+
const packageConfig = {
|
|
10
|
+
name: "example-project",
|
|
11
|
+
version: "0.1.0",
|
|
12
|
+
description: "",
|
|
13
|
+
keywords: "",
|
|
14
|
+
license: "MIT",
|
|
15
|
+
homepage: "https://www.example.com",
|
|
16
|
+
// funding: [
|
|
17
|
+
// {
|
|
18
|
+
// "type": "github",
|
|
19
|
+
// "url": "https://github.com/sponsors/scape-foundation"
|
|
20
|
+
// }
|
|
21
|
+
// ],
|
|
22
|
+
// type: "module",
|
|
23
|
+
// main: "js/index",
|
|
24
|
+
main: "js/index.js",
|
|
25
|
+
// types: "js/index",
|
|
26
|
+
types: "js/index.d.ts",
|
|
27
|
+
// "module": "dist/js/unit.gl.js",
|
|
28
|
+
// "style": "dist/css/unit.gl.css",
|
|
29
|
+
// "sass": "src/scss/index.scss",
|
|
30
|
+
// main: 'index.js',
|
|
31
|
+
files: [
|
|
32
|
+
"code-snippets/**/*.code-snippets",
|
|
33
|
+
"css/**/*.{css,map}",
|
|
34
|
+
"font/**/*.{eot,otf,ttf,woff,woff2}",
|
|
35
|
+
"inkscape/**/*.inkscape",
|
|
36
|
+
"jinja/**/*.jinja",
|
|
37
|
+
"js/**/*.d.ts",
|
|
38
|
+
"js/**/*.{js,map}",
|
|
39
|
+
"less/**/*.less",
|
|
40
|
+
"md/**/*.md",
|
|
41
|
+
"oco/**/*.oco",
|
|
42
|
+
"png/**/*.png",
|
|
43
|
+
"py/**/*.py",
|
|
44
|
+
"rcpx/**/*.rcpx",
|
|
45
|
+
"scss/**/*.scss",
|
|
46
|
+
"sketchpalette/**/*.sketchpalette",
|
|
47
|
+
"styl/**/*.styl",
|
|
48
|
+
"svg/**/*.svg",
|
|
49
|
+
"tex/**/*.tex",
|
|
50
|
+
"ts/**/*.ts",
|
|
51
|
+
"!.DS_Store",
|
|
52
|
+
],
|
|
53
|
+
// exports: {
|
|
54
|
+
// ".": {
|
|
55
|
+
// // "sass": "./src/scss/index.scss",
|
|
56
|
+
// // "import": "./dist/js/index.mjs",
|
|
57
|
+
// // "default": "./dist/js/index.js"
|
|
58
|
+
// "sass": "./scss/index.scss",
|
|
59
|
+
// "scss": "./scss/index.scss",
|
|
60
|
+
// "typescript": "./ts/index.ts",
|
|
61
|
+
// "default": "./js/index.js"
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
64
|
+
// repository: {
|
|
65
|
+
// type: pack.repository.type,
|
|
66
|
+
// url: pack.repository.url,
|
|
67
|
+
// },
|
|
68
|
+
|
|
69
|
+
// author?: string | {
|
|
70
|
+
// name: string;
|
|
71
|
+
// email?: string;
|
|
72
|
+
// url?: string;
|
|
73
|
+
// };
|
|
74
|
+
// bugs?: {
|
|
75
|
+
// url?: string;
|
|
76
|
+
// email?: string;
|
|
77
|
+
// };
|
|
78
|
+
|
|
79
|
+
// contributors?: Array<string | {
|
|
80
|
+
// name: string;
|
|
81
|
+
// email?: string;
|
|
82
|
+
// url?: string;
|
|
83
|
+
// }>;
|
|
84
|
+
// funding?: string | {
|
|
85
|
+
// type: string;
|
|
86
|
+
// url: string;
|
|
87
|
+
// };
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// Export
|
|
92
|
+
// ============================================================================
|
|
93
|
+
|
|
94
|
+
export default packageConfig;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// // ============================================================================
|
|
2
|
+
// // Imports
|
|
3
|
+
// // ============================================================================
|
|
4
|
+
|
|
5
|
+
// // @ts-ignore: Implicit any type for sassdoc module
|
|
6
|
+
// import path from "path";
|
|
7
|
+
// import sassdoc from "sassdoc";
|
|
8
|
+
// import { Action } from "../../core/pipeline/Action";
|
|
9
|
+
// import { ActionOptionsType } from "../../types/ActionOptionsType";
|
|
10
|
+
|
|
11
|
+
// // ============================================================================
|
|
12
|
+
// // Classes
|
|
13
|
+
// // ============================================================================
|
|
14
|
+
|
|
15
|
+
// /**
|
|
16
|
+
// * SassDocAction generates SASS documentation using SassDoc.
|
|
17
|
+
// * This action allows specifying source directories, destination paths, and additional options.
|
|
18
|
+
// */
|
|
19
|
+
// export class SassDocAction extends Action {
|
|
20
|
+
// /**
|
|
21
|
+
// * Executes the SASS documentation generation process.
|
|
22
|
+
// *
|
|
23
|
+
// * @param options - The options specifying source directories, output path, and SassDoc configurations.
|
|
24
|
+
// * @returns A Promise that resolves when the documentation generation is completed successfully.
|
|
25
|
+
// * @throws {Error} Throws an error if the documentation process fails.
|
|
26
|
+
// */
|
|
27
|
+
// async execute(options: ActionOptionsType): Promise<void> {
|
|
28
|
+
// const {
|
|
29
|
+
// sourcePaths = ["src/styles"],
|
|
30
|
+
// outputPath = "docs/sass",
|
|
31
|
+
// sassdocOptions = {},
|
|
32
|
+
// } = options;
|
|
33
|
+
|
|
34
|
+
// if (!Array.isArray(sourcePaths) || sourcePaths.length === 0) {
|
|
35
|
+
// throw new Error("Invalid options: 'sourcePaths' must be a non-empty array.");
|
|
36
|
+
// }
|
|
37
|
+
|
|
38
|
+
// this.logInfo(`Generating SASS documentation in ${outputPath}...`);
|
|
39
|
+
|
|
40
|
+
// try {
|
|
41
|
+
// // Merge custom options with default options
|
|
42
|
+
// const config: sassdoc.Options = {
|
|
43
|
+
// dest: path.resolve(outputPath),
|
|
44
|
+
// verbose: true,
|
|
45
|
+
// ...sassdocOptions,
|
|
46
|
+
// };
|
|
47
|
+
|
|
48
|
+
// // Run SassDoc to generate documentation
|
|
49
|
+
// await sassdoc(sourcePaths, config);
|
|
50
|
+
|
|
51
|
+
// this.logInfo(`SASS documentation successfully generated at: ${config.dest}`);
|
|
52
|
+
// } catch (error) {
|
|
53
|
+
// this.logError("An error occurred while generating SASS documentation.", error);
|
|
54
|
+
// throw error;
|
|
55
|
+
// }
|
|
56
|
+
// }
|
|
57
|
+
|
|
58
|
+
// /**
|
|
59
|
+
// * Provides a description of the action.
|
|
60
|
+
// *
|
|
61
|
+
// * @returns A string description of the action.
|
|
62
|
+
// */
|
|
63
|
+
// describe(): string {
|
|
64
|
+
// return "Generates SASS documentation using SassDoc.";
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Import
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
// import { SassDocAction } from "./SassDocAction";
|
|
6
|
+
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Export
|
|
9
|
+
// ============================================================================
|
|
10
|
+
|
|
11
|
+
// export { SassDocAction };
|