less 4.9.1 → 5.0.0-alpha.10
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/README.md +23 -5
- package/V5-STATUS.md +71 -0
- package/bin/lessc +302 -626
- package/dist/less-browser-dev.js +2550 -0
- package/dist/less-node.cjs +480 -14561
- package/index.cjs +5 -2
- package/lib/browser-dev.js +86 -0
- package/lib/index.js +164 -0
- package/lib/lessc-helper.js +64 -0
- package/lib/logger.js +76 -0
- package/lib/options.d.ts +82 -0
- package/lib/options.js +227 -0
- package/lib/types.js +20 -0
- package/lib/version.js +19 -0
- package/package.json +36 -40
- package/dist/less.cjs +0 -15218
- package/dist/less.js +0 -15218
- package/dist/less.min.js +0 -11
- package/dist/less.min.js.map +0 -1
- package/lib/less/constants.js +0 -13
- package/lib/less/contexts.js +0 -165
- package/lib/less/data/colors.js +0 -150
- package/lib/less/data/index.js +0 -4
- package/lib/less/data/unit-conversions.js +0 -21
- package/lib/less/default-options.js +0 -89
- package/lib/less/deprecation.js +0 -82
- package/lib/less/environment/abstract-file-manager.js +0 -140
- package/lib/less/environment/abstract-plugin-loader.js +0 -185
- package/lib/less/environment/environment-api.ts +0 -21
- package/lib/less/environment/environment.js +0 -59
- package/lib/less/environment/file-manager-api.ts +0 -77
- package/lib/less/functions/boolean.js +0 -29
- package/lib/less/functions/color-blending.js +0 -85
- package/lib/less/functions/color.js +0 -452
- package/lib/less/functions/data-uri.js +0 -74
- package/lib/less/functions/default.js +0 -26
- package/lib/less/functions/function-caller.js +0 -55
- package/lib/less/functions/function-registry.js +0 -36
- package/lib/less/functions/index.js +0 -35
- package/lib/less/functions/list.js +0 -158
- package/lib/less/functions/math-helper.js +0 -22
- package/lib/less/functions/math.js +0 -30
- package/lib/less/functions/number.js +0 -95
- package/lib/less/functions/string.js +0 -39
- package/lib/less/functions/style.js +0 -29
- package/lib/less/functions/svg.js +0 -87
- package/lib/less/functions/types.js +0 -70
- package/lib/less/import-manager.js +0 -183
- package/lib/less/index.js +0 -95
- package/lib/less/less-error.js +0 -166
- package/lib/less/logger.js +0 -34
- package/lib/less/parse-tree.js +0 -124
- package/lib/less/parse.js +0 -87
- package/lib/less/parser/lookup-pattern.js +0 -26
- package/lib/less/parser/parser-input.js +0 -400
- package/lib/less/parser/parser.js +0 -2998
- package/lib/less/plugin-manager.js +0 -168
- package/lib/less/render.js +0 -41
- package/lib/less/source-map-builder.js +0 -82
- package/lib/less/source-map-output.js +0 -151
- package/lib/less/transform-tree.js +0 -102
- package/lib/less/tree/anonymous.js +0 -61
- package/lib/less/tree/assignment.js +0 -48
- package/lib/less/tree/atrule-syntax.js +0 -8
- package/lib/less/tree/atrule.js +0 -340
- package/lib/less/tree/attribute.js +0 -63
- package/lib/less/tree/call.js +0 -132
- package/lib/less/tree/color.js +0 -285
- package/lib/less/tree/combinator.js +0 -38
- package/lib/less/tree/comment.js +0 -48
- package/lib/less/tree/condition.js +0 -65
- package/lib/less/tree/container.js +0 -104
- package/lib/less/tree/debug-info.js +0 -80
- package/lib/less/tree/declaration.js +0 -142
- package/lib/less/tree/detached-ruleset.js +0 -45
- package/lib/less/tree/dimension.js +0 -215
- package/lib/less/tree/element.js +0 -93
- package/lib/less/tree/expression.js +0 -100
- package/lib/less/tree/extend.js +0 -88
- package/lib/less/tree/import.js +0 -299
- package/lib/less/tree/index.js +0 -56
- package/lib/less/tree/interpolated-variable.js +0 -106
- package/lib/less/tree/javascript.js +0 -45
- package/lib/less/tree/js-eval-node.js +0 -80
- package/lib/less/tree/keyword.js +0 -28
- package/lib/less/tree/media.js +0 -90
- package/lib/less/tree/merge-rules.js +0 -47
- package/lib/less/tree/mixin-call.js +0 -283
- package/lib/less/tree/mixin-definition.js +0 -319
- package/lib/less/tree/namespace-value.js +0 -95
- package/lib/less/tree/negative.js +0 -37
- package/lib/less/tree/nested-at-rule.js +0 -239
- package/lib/less/tree/node.js +0 -310
- package/lib/less/tree/operation.js +0 -81
- package/lib/less/tree/paren.js +0 -41
- package/lib/less/tree/property.js +0 -96
- package/lib/less/tree/query-in-parens.js +0 -64
- package/lib/less/tree/quoted.js +0 -131
- package/lib/less/tree/ruleset.js +0 -1068
- package/lib/less/tree/selector.js +0 -201
- package/lib/less/tree/unicode-descriptor.js +0 -14
- package/lib/less/tree/unit.js +0 -170
- package/lib/less/tree/url.js +0 -83
- package/lib/less/tree/value.js +0 -60
- package/lib/less/tree/variable-call.js +0 -60
- package/lib/less/tree/variable.js +0 -85
- package/lib/less/utils.js +0 -126
- package/lib/less/visitors/extend-visitor.js +0 -505
- package/lib/less/visitors/import-sequencer.js +0 -56
- package/lib/less/visitors/import-visitor.js +0 -203
- package/lib/less/visitors/index.js +0 -15
- package/lib/less/visitors/join-selector-visitor.js +0 -65
- package/lib/less/visitors/set-tree-visibility-visitor.js +0 -57
- package/lib/less/visitors/to-css-visitor.js +0 -332
- package/lib/less/visitors/visitor.js +0 -165
- package/lib/less-browser/add-default-options.js +0 -53
- package/lib/less-browser/bootstrap.js +0 -67
- package/lib/less-browser/browser.js +0 -65
- package/lib/less-browser/cache.js +0 -43
- package/lib/less-browser/error-reporting.js +0 -170
- package/lib/less-browser/file-manager.js +0 -112
- package/lib/less-browser/image-size.js +0 -28
- package/lib/less-browser/index.js +0 -284
- package/lib/less-browser/log-listener.js +0 -42
- package/lib/less-browser/plugin-loader.js +0 -24
- package/lib/less-browser/utils.js +0 -30
- package/lib/less-node/environment.js +0 -43
- package/lib/less-node/file-manager.js +0 -156
- package/lib/less-node/fs.js +0 -14
- package/lib/less-node/image-size.js +0 -78
- package/lib/less-node/index.js +0 -31
- package/lib/less-node/lessc-helper.js +0 -95
- package/lib/less-node/plugin-loader.js +0 -62
- package/lib/less-node/url-file-manager.js +0 -60
package/lib/options.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options mapping between Less render options and Jess compiler config.
|
|
3
|
+
* @module less/lib/options
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import lessPlugin from '@jesscss/plugin-less';
|
|
7
|
+
import { lessCompatPlugin } from '@jesscss/plugin-less-compat';
|
|
8
|
+
import { logger } from './logger.js';
|
|
9
|
+
|
|
10
|
+
const unsupportedAlphaOptions = new Map([
|
|
11
|
+
['globalVars', 'global variable injection is not supported'],
|
|
12
|
+
['modifyVars', 'modify-var injection is not supported'],
|
|
13
|
+
['javascriptEnabled', 'JavaScript evaluation is not supported'],
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
function validateAlphaOptions(options) {
|
|
17
|
+
for (const [name, reason] of unsupportedAlphaOptions) {
|
|
18
|
+
// A falsy value is the 4.x default ("off") and requests nothing, so it is
|
|
19
|
+
// a no-op here; only an actual request for the feature is unsupported.
|
|
20
|
+
if (options[name]) {
|
|
21
|
+
throw new Error(`${name} is not supported: ${reason}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {any} value
|
|
28
|
+
* @param {WeakSet<object>} [seen]
|
|
29
|
+
* @returns {string}
|
|
30
|
+
*/
|
|
31
|
+
function stableStringify(value, seen = new WeakSet()) {
|
|
32
|
+
if (value == null || typeof value !== 'object') {
|
|
33
|
+
if (typeof value === 'function') {
|
|
34
|
+
return JSON.stringify(`[function ${value.name || 'anonymous'}]`);
|
|
35
|
+
}
|
|
36
|
+
return JSON.stringify(value);
|
|
37
|
+
}
|
|
38
|
+
if (seen.has(value)) {
|
|
39
|
+
return '"[Circular]"';
|
|
40
|
+
}
|
|
41
|
+
seen.add(value);
|
|
42
|
+
if (Array.isArray(value)) {
|
|
43
|
+
return `[${value.map((item) => stableStringify(item, seen)).join(',')}]`;
|
|
44
|
+
}
|
|
45
|
+
if (value.name && typeof value.name === 'string' && ('install' in value || 'parser' in value || 'opts' in value)) {
|
|
46
|
+
return stableStringify({
|
|
47
|
+
plugin: value.name,
|
|
48
|
+
opts: value.opts || {},
|
|
49
|
+
}, seen);
|
|
50
|
+
}
|
|
51
|
+
const entries = Object.keys(value)
|
|
52
|
+
.sort()
|
|
53
|
+
.map((key) => `${JSON.stringify(key)}:${stableStringify(value[key], seen)}`);
|
|
54
|
+
return `{${entries.join(',')}}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* `collapseNesting` accepts `false` (keep authored nesting — the v5 default),
|
|
59
|
+
* `'native'` (CSS Nesting desugaring: parent wrapped in `:is()`, child selector
|
|
60
|
+
* lists distributed, specificity-faithful), `'compact'` (like `'native'` but
|
|
61
|
+
* also folds same-combinator descendant runs into one `:is()`), or the
|
|
62
|
+
* deprecated boolean `true` (alias for `'native'`). Anything else is rejected.
|
|
63
|
+
* @param {unknown} value
|
|
64
|
+
* @returns {boolean|'native'|'compact'}
|
|
65
|
+
*/
|
|
66
|
+
function resolveCollapseNesting(value) {
|
|
67
|
+
if (value === false || value === true || value === 'native' || value === 'compact') {
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
throw new Error(
|
|
71
|
+
`collapseNesting must be false, 'native', 'compact', or true `
|
|
72
|
+
+ `(deprecated alias for 'native'); got ${JSON.stringify(value)}`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Build the compiler's `output.sourceMap` value from Less options. Source maps
|
|
78
|
+
* are enabled when `sourceMap` is truthy; the object form (or the flat legacy
|
|
79
|
+
* `sourceMap*` options) configures the details. Returns `undefined` when no
|
|
80
|
+
* source map is requested.
|
|
81
|
+
* @param {import('./options.js').LessRenderOptions} opts
|
|
82
|
+
* @returns {undefined | true | Record<string, unknown>}
|
|
83
|
+
*/
|
|
84
|
+
function resolveSourceMap(opts) {
|
|
85
|
+
if (!opts.sourceMap) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
const config = (typeof opts.sourceMap === 'object' && opts.sourceMap !== null)
|
|
89
|
+
? { ...opts.sourceMap }
|
|
90
|
+
: {};
|
|
91
|
+
// Fold the flat legacy `sourceMap*` options into the object form the compiler
|
|
92
|
+
// reads; an explicit object sub-option wins over its flat alias.
|
|
93
|
+
const flat = [
|
|
94
|
+
'sourceMapURL', 'sourceMapFilename', 'sourceMapFullFilename',
|
|
95
|
+
'sourceMapRootpath', 'sourceMapBasepath', 'sourceMapFileInline',
|
|
96
|
+
'sourceMapOutputFilename', 'outputSourceFiles', 'disableSourcemapAnnotation'
|
|
97
|
+
];
|
|
98
|
+
for (const key of flat) {
|
|
99
|
+
if (opts[key] !== undefined && config[key] === undefined) {
|
|
100
|
+
config[key] = opts[key];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return Object.keys(config).length > 0 ? config : true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Map Less render options to Jess compiler config.
|
|
108
|
+
* @param {import('./options.js').LessRenderOptions} [options] Less-style options
|
|
109
|
+
* @returns {{ configOptions: object, filePath?: string }}
|
|
110
|
+
*/
|
|
111
|
+
export function createLessOptions(options) {
|
|
112
|
+
const opts = options || {};
|
|
113
|
+
validateAlphaOptions(opts);
|
|
114
|
+
const filePath = opts.filename || undefined;
|
|
115
|
+
const lessPlugins = Array.isArray(opts.plugins) ? opts.plugins : [];
|
|
116
|
+
const skipLessCompat =
|
|
117
|
+
opts.__jessSkipLessCompatWhenPluginFree === true && lessPlugins.length === 0;
|
|
118
|
+
|
|
119
|
+
const math = /** @type {number|string|undefined} */ (opts.math);
|
|
120
|
+
const mathMode =
|
|
121
|
+
math === 0 || math === 'always' ? 'always' :
|
|
122
|
+
math === 2 || math === 'parens' || math === 'strict' ? 'parens' :
|
|
123
|
+
'parens-division';
|
|
124
|
+
|
|
125
|
+
// `unitMode` is the option ('loose' | 'preserve' | 'strict'); `strictUnits`
|
|
126
|
+
// is its deprecated boolean alias: true → 'strict'; false means "not strict",
|
|
127
|
+
// i.e. the default ('preserve') — never the Less 4.x 'loose' fold, which only
|
|
128
|
+
// an explicit `unitMode: 'loose'` selects. Any use warns so the mapping is
|
|
129
|
+
// never discovered by staring at output. Left unset so the compiler default applies.
|
|
130
|
+
const unitMode = opts.unitMode !== undefined ? opts.unitMode
|
|
131
|
+
: opts.strictUnits === true ? 'strict'
|
|
132
|
+
: undefined;
|
|
133
|
+
if (opts.strictUnits !== undefined && opts.unitMode === undefined) {
|
|
134
|
+
logger.warn(
|
|
135
|
+
`strictUnits is deprecated; use unitMode. strictUnits: ${String(opts.strictUnits)} now means `
|
|
136
|
+
+ `unitMode: '${unitMode ?? 'preserve'}'${opts.strictUnits ? '' : " (Less 4.x unit folding is unitMode: 'loose')"}`
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// URL rewriting lives on the Less plugin (it rewrites `url(...)` during
|
|
141
|
+
// serialization), not in `output`. Only forward keys the caller set so the
|
|
142
|
+
// plugin's own v5 defaults apply otherwise.
|
|
143
|
+
const lessPluginOptions = {};
|
|
144
|
+
if (opts.rootpath !== undefined) lessPluginOptions.rootpath = opts.rootpath;
|
|
145
|
+
if (opts.rewriteUrls !== undefined) lessPluginOptions.rewriteUrls = opts.rewriteUrls;
|
|
146
|
+
if (opts.urlArgs !== undefined) lessPluginOptions.urlArgs = opts.urlArgs;
|
|
147
|
+
|
|
148
|
+
const plugins = [lessPlugin(lessPluginOptions)];
|
|
149
|
+
if (!skipLessCompat) {
|
|
150
|
+
plugins.push(lessCompatPlugin({ plugins: lessPlugins }));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The projection/serialization options the compiler reads off `output`:
|
|
154
|
+
// `collapseNesting` (nesting flatten mode), `compress` (minified output), and
|
|
155
|
+
// `sourceMap`. Emitted as a single file-less array entry so an explicit render
|
|
156
|
+
// option overrides a file-local styles.config for every key (the config merge
|
|
157
|
+
// appends it as the override default); left `{}` when the caller set none.
|
|
158
|
+
const outputEntry = {};
|
|
159
|
+
if (opts.collapseNesting !== undefined) {
|
|
160
|
+
outputEntry.collapseNesting = resolveCollapseNesting(opts.collapseNesting);
|
|
161
|
+
}
|
|
162
|
+
if (opts.compress !== undefined) {
|
|
163
|
+
outputEntry.compress = opts.compress;
|
|
164
|
+
}
|
|
165
|
+
const sourceMap = resolveSourceMap(opts);
|
|
166
|
+
if (sourceMap !== undefined) {
|
|
167
|
+
outputEntry.sourceMap = sourceMap;
|
|
168
|
+
}
|
|
169
|
+
const output = Object.keys(outputEntry).length > 0 ? [outputEntry] : {};
|
|
170
|
+
|
|
171
|
+
const configOptions = {
|
|
172
|
+
compile: {
|
|
173
|
+
searchPaths: opts.paths || [],
|
|
174
|
+
mathMode,
|
|
175
|
+
...(unitMode !== undefined && { unitMode }),
|
|
176
|
+
plugins,
|
|
177
|
+
},
|
|
178
|
+
output,
|
|
179
|
+
language: {},
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
return { configOptions, filePath };
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Stable compiler cache key for a Jess compiler configured from Less options.
|
|
187
|
+
* @param {object} configOptions Jess compiler config
|
|
188
|
+
* @returns {string}
|
|
189
|
+
*/
|
|
190
|
+
export function getCompilerCacheKey(configOptions) {
|
|
191
|
+
return stableStringify(configOptions);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Map Jess render result to Less-style result.
|
|
196
|
+
* @param {import('./options.js').JessRenderResult} result Jess compiler result
|
|
197
|
+
* @param {import('./options.js').LessRenderOptions} [options] Original Less options
|
|
198
|
+
* @returns {import('./options.js').LessRenderResult}
|
|
199
|
+
*/
|
|
200
|
+
export function mapRenderResult(result, options) {
|
|
201
|
+
const opts = options || {};
|
|
202
|
+
/** @type {import('./options.js').LessRenderResult} */
|
|
203
|
+
const out = {
|
|
204
|
+
css: result.css ?? '',
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// Less 4.x returns the source map as `result.map` (a JSON string) when one was
|
|
208
|
+
// requested; forward it so `less.render(src, { sourceMap: true })` behaves the
|
|
209
|
+
// same. The compiler writes the `sourceMappingURL` annotation into `css` itself.
|
|
210
|
+
if (result.map !== undefined) {
|
|
211
|
+
out.map = result.map;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (result.imports && Array.isArray(result.imports)) {
|
|
215
|
+
out.imports = result.imports;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Structured Jess warnings (e.g. selector/parentless-ampersand). Exposed so
|
|
219
|
+
// callers and tests can assert them, mirroring how errors surface.
|
|
220
|
+
if (result.warnings && Array.isArray(result.warnings)) {
|
|
221
|
+
out.warnings = result.warnings;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return out;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export default { createLessOptions, getCompilerCacheKey, mapRenderResult };
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSDoc type definitions for Less.js v5 (Jess wrapper).
|
|
3
|
+
* @module less/lib/types
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {import('./options.js').LessRenderResult} LessRenderResult
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {Object} LessStatic
|
|
12
|
+
* @property {number[]} version Less-compatible version tuple
|
|
13
|
+
* @property {function(string, import('./options.js').LessRenderOptions?, function?): Promise<LessRenderResult>} render Render Less to CSS
|
|
14
|
+
* @property {function(string, import('./options.js').LessRenderOptions?): Promise<LessRenderResult>} renderFile Render Less file to CSS
|
|
15
|
+
* @property {import('./logger.js').default} logger Logger instance
|
|
16
|
+
* @property {import('./lessc-helper.js').default} lesscHelper CLI helper
|
|
17
|
+
* @property {object} Compiler Jess Compiler class
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export {};
|
package/lib/version.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version info for Less.js v5 (Jess wrapper).
|
|
3
|
+
* @module less/lib/version
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { createRequire } from 'module';
|
|
7
|
+
import parseNodeVersion from 'parse-node-version';
|
|
8
|
+
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const pkg = require('../package.json');
|
|
11
|
+
const semver = pkg.version || '5.0.0-alpha.0';
|
|
12
|
+
const parsed = parseNodeVersion(`v${semver}`);
|
|
13
|
+
|
|
14
|
+
export const version = {
|
|
15
|
+
semver,
|
|
16
|
+
array: [parsed.major, parsed.minor, parsed.patch],
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "less",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.10",
|
|
4
4
|
"description": "Leaner CSS",
|
|
5
5
|
"homepage": "http://lesscss.org",
|
|
6
6
|
"author": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/less/less.js.git"
|
|
18
|
+
"url": "git+https://github.com/less/less.js.git"
|
|
19
19
|
},
|
|
20
20
|
"master": {
|
|
21
21
|
"url": "https://github.com/less/less.js/blob/master/",
|
|
@@ -24,21 +24,17 @@
|
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"bin": {
|
|
27
|
-
"lessc": "
|
|
27
|
+
"lessc": "bin/lessc"
|
|
28
28
|
},
|
|
29
29
|
"main": "./dist/less-node.cjs",
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
|
-
"
|
|
33
|
-
"import": "./lib/less-node/index.js",
|
|
32
|
+
"import": "./lib/index.js",
|
|
34
33
|
"require": "./dist/less-node.cjs",
|
|
35
|
-
"default": "./lib/
|
|
34
|
+
"default": "./lib/index.js"
|
|
36
35
|
},
|
|
37
36
|
"./lib/*": "./lib/*",
|
|
38
|
-
"./dist/less-node.cjs": "./dist/less-node.cjs"
|
|
39
|
-
"./dist/less.cjs": "./dist/less.cjs",
|
|
40
|
-
"./dist/less.js": "./dist/less.js",
|
|
41
|
-
"./dist/less.min.js": "./dist/less.min.js"
|
|
37
|
+
"./dist/less-node.cjs": "./dist/less-node.cjs"
|
|
42
38
|
},
|
|
43
39
|
"directories": {
|
|
44
40
|
"test": "./test"
|
|
@@ -49,32 +45,29 @@
|
|
|
49
45
|
"!lib/**/*.map",
|
|
50
46
|
"dist",
|
|
51
47
|
"index.cjs",
|
|
52
|
-
"README.md"
|
|
48
|
+
"README.md",
|
|
49
|
+
"V5-STATUS.md"
|
|
53
50
|
],
|
|
54
|
-
"browser": "./dist/less.js",
|
|
55
51
|
"engines": {
|
|
56
|
-
"node": ">=
|
|
52
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
57
53
|
},
|
|
58
54
|
"scripts": {
|
|
59
|
-
"quicktest": "
|
|
60
|
-
"test": "
|
|
61
|
-
"test:
|
|
62
|
-
"test
|
|
63
|
-
"
|
|
55
|
+
"quicktest": "npm run test:legacy-node",
|
|
56
|
+
"test:alpha": "npm run typecheck && npm run build && npm run test:lessc && node test/jess-alpha-fast-path.mjs && node test/alpha-support.mjs && node test/alpha-sourcemaps.mjs && node test/alpha-fixtures.mjs",
|
|
57
|
+
"test:lessc": "node test/lessc-alpha.mjs",
|
|
58
|
+
"test": "npm run test:alpha",
|
|
59
|
+
"test:module": "node test/test-es6.js && node test/test-cjs.cjs",
|
|
60
|
+
"test:legacy-node": "node test/index.js",
|
|
61
|
+
"test:node": "npm run test:module",
|
|
62
|
+
"test:coverage": "c8 -r lcov -r json-summary -r text-summary -r html --include=\"lib/**/*.js\" --include=\"bin/**/*.js\" --exclude=\"dist/**\" --exclude=\"**/*.test.js\" --exclude=\"**/*.spec.js\" --exclude=\"test/**\" --exclude=\"tmp/**\" --exclude=\"**/abstract-file-manager.js\" --exclude=\"**/abstract-plugin-loader.js\" npm run test:legacy-node && node scripts/coverage-report.js && node scripts/coverage-lines.js",
|
|
64
63
|
"lint": "eslint '**/*.{ts,js}'",
|
|
65
64
|
"lint:fix": "eslint '**/*.{ts,js}' --fix",
|
|
66
65
|
"typecheck": "tsc --noEmit",
|
|
67
66
|
"build": "node build/rollup.js --dist",
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
"graceful-fs": "^4.1.2",
|
|
73
|
-
"probe-image-size": "^7.2.3",
|
|
74
|
-
"make-dir": "^5.1.0",
|
|
75
|
-
"mime": "^1.4.1",
|
|
76
|
-
"needle": "^3.1.0",
|
|
77
|
-
"source-map": "~0.6.0"
|
|
67
|
+
"build:browser": "node build/browser-dev.mjs --minify",
|
|
68
|
+
"benchmark": "node benchmark/benchmark-runner.cjs",
|
|
69
|
+
"benchmark:all": "node benchmark/run-and-compare.mjs",
|
|
70
|
+
"prepublishOnly": "npm run typecheck && npm run build && npm run build:browser && npm run test:lessc"
|
|
78
71
|
},
|
|
79
72
|
"devDependencies": {
|
|
80
73
|
"@less/test-data": "workspace:*",
|
|
@@ -92,21 +85,13 @@
|
|
|
92
85
|
"chalk": "^4.1.2",
|
|
93
86
|
"cosmiconfig": "~9.0.0",
|
|
94
87
|
"cross-env": "^7.0.3",
|
|
88
|
+
"esbuild": "^0.25.0",
|
|
95
89
|
"eslint": "^7.29.0",
|
|
96
90
|
"fs-extra": "^8.1.0",
|
|
97
|
-
"git-rev": "^0.2.1",
|
|
98
91
|
"glob": "~11.0.3",
|
|
99
92
|
"globby": "^10.0.1",
|
|
100
|
-
"grunt": "^1.5.0",
|
|
101
|
-
"grunt-cli": "^1.3.2",
|
|
102
|
-
"grunt-contrib-clean": "^1.0.0",
|
|
103
|
-
"grunt-contrib-connect": "^1.0.2",
|
|
104
|
-
"grunt-eslint": "^23.0.0",
|
|
105
|
-
"grunt-saucelabs": "^9.0.1",
|
|
106
|
-
"grunt-shell": "^1.3.0",
|
|
107
93
|
"html-template-tag": "^3.2.0",
|
|
108
94
|
"jest-diff": "~30.1.2",
|
|
109
|
-
"jit-grunt": "^0.10.0",
|
|
110
95
|
"less-plugin-autoprefix": "^1.5.1",
|
|
111
96
|
"less-plugin-clean-css": "^1.6.0",
|
|
112
97
|
"minimist": "^1.2.0",
|
|
@@ -114,15 +99,14 @@
|
|
|
114
99
|
"mocha-teamcity-reporter": "^3.0.0",
|
|
115
100
|
"npm-run-all": "^4.1.5",
|
|
116
101
|
"performance-now": "^0.2.0",
|
|
117
|
-
"phin": "^2.2.3",
|
|
118
102
|
"playwright": "1.50.1",
|
|
119
103
|
"promise": "^7.1.1",
|
|
120
104
|
"read-glob": "^3.0.0",
|
|
121
105
|
"resolve": "^1.17.0",
|
|
122
106
|
"rollup": "^2.52.2",
|
|
123
107
|
"rollup-plugin-terser": "^5.1.1",
|
|
108
|
+
"semver": "^6.3.0",
|
|
124
109
|
"shx": "^0.3.2",
|
|
125
|
-
"time-grunt": "^1.3.0",
|
|
126
110
|
"typescript": "^5.7.0",
|
|
127
111
|
"uikit": "2.27.4",
|
|
128
112
|
"url": "^0.11.4",
|
|
@@ -158,8 +142,20 @@
|
|
|
158
142
|
"rawcurrent": "https://raw.github.com/less/less.js/v",
|
|
159
143
|
"sourcearchive": "https://github.com/less/less.js/archive/v",
|
|
160
144
|
"dependencies": {
|
|
161
|
-
"
|
|
145
|
+
"@jesscss/compiler": "2.0.0-alpha.23",
|
|
146
|
+
"@jesscss/core": "2.0.0-alpha.23",
|
|
147
|
+
"@jesscss/plugin-less": "2.0.0-alpha.23",
|
|
148
|
+
"@jesscss/plugin-less-compat": "2.0.0-alpha.23",
|
|
149
|
+
"@jesscss/plugin-node-modules": "2.0.0-alpha.23",
|
|
162
150
|
"parse-node-version": "^1.0.1"
|
|
163
151
|
},
|
|
152
|
+
"peerDependencies": {
|
|
153
|
+
"@jesscss/plugin-js": "2.0.0-alpha.23"
|
|
154
|
+
},
|
|
155
|
+
"peerDependenciesMeta": {
|
|
156
|
+
"@jesscss/plugin-js": {
|
|
157
|
+
"optional": true
|
|
158
|
+
}
|
|
159
|
+
},
|
|
164
160
|
"gitHead": "1df9072ee9ebdadc791bf35dfb1dbc3ef9f1948f"
|
|
165
161
|
}
|