Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use explicit path #3712

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/less/src/less/contexts.js
@@ -1,6 +1,6 @@
const contexts = {};
export default contexts;
import * as Constants from './constants';
import * as Constants from './constants.js';

const copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {
if (!original) { return; }
Expand Down
4 changes: 2 additions & 2 deletions packages/less/src/less/data/index.js
@@ -1,4 +1,4 @@
import colors from './colors';
import unitConversions from './unit-conversions';
import colors from './colors.js';
import unitConversions from './unit-conversions.js';

export default { colors, unitConversions };
5 changes: 2 additions & 3 deletions packages/less/src/less/environment/abstract-plugin-loader.js
@@ -1,5 +1,5 @@
import functionRegistry from '../functions/function-registry';
import LessError from '../less-error';
import functionRegistry from '../functions/function-registry.js';
import LessError from '../less-error.js';

class AbstractPluginLoader {
constructor() {
Expand Down Expand Up @@ -182,4 +182,3 @@ class AbstractPluginLoader {
}

export default AbstractPluginLoader;

2 changes: 1 addition & 1 deletion packages/less/src/less/environment/environment.js
Expand Up @@ -3,7 +3,7 @@
* environment, file managers, and plugin manager
*/

import logger from '../logger';
import logger from '../logger.js';

class Environment {
constructor(externalEnvironment, fileManagers) {
Expand Down
4 changes: 2 additions & 2 deletions packages/less/src/less/functions/boolean.js
@@ -1,5 +1,5 @@
import Anonymous from '../tree/anonymous';
import Keyword from '../tree/keyword';
import Anonymous from '../tree/anonymous.js';
import Keyword from '../tree/keyword.js';

function boolean(condition) {
return condition ? Keyword.True : Keyword.False;
Expand Down
2 changes: 1 addition & 1 deletion packages/less/src/less/functions/color-blending.js
@@ -1,4 +1,4 @@
import Color from '../tree/color';
import Color from '../tree/color.js';

// Color Blending
// ref: http://www.w3.org/TR/compositing-1
Expand Down
16 changes: 8 additions & 8 deletions packages/less/src/less/functions/color.js
@@ -1,9 +1,9 @@
import Dimension from '../tree/dimension';
import Color from '../tree/color';
import Quoted from '../tree/quoted';
import Anonymous from '../tree/anonymous';
import Expression from '../tree/expression';
import Operation from '../tree/operation';
import Dimension from '../tree/dimension.js';
import Color from '../tree/color.js';
import Quoted from '../tree/quoted.js';
import Anonymous from '../tree/anonymous.js';
import Expression from '../tree/expression.js';
import Operation from '../tree/operation.js';
let colorFunctions;

function clamp(val) {
Expand All @@ -12,7 +12,7 @@ function clamp(val) {
function hsla(origColor, hsl) {
const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);
if (color) {
if (origColor.value &&
if (origColor.value &&
/^(rgb|hsl)/.test(origColor.value)) {
color.value = origColor.value;
} else {
Expand Down Expand Up @@ -68,7 +68,7 @@ colorFunctions = {
r = val[0]
g = val[1]
b = val[2]
/**
/**
* @todo - should this be normalized in
* function caller? Or parsed differently?
*/
Expand Down
12 changes: 6 additions & 6 deletions packages/less/src/less/functions/data-uri.js
@@ -1,11 +1,11 @@
import Quoted from '../tree/quoted';
import URL from '../tree/url';
import * as utils from '../utils';
import logger from '../logger';
import Quoted from '../tree/quoted.js';
import URL from '../tree/url.js';
import * as utils from '../utils.js';
import logger from '../logger.js';

export default environment => {
const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context);

const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context);

return { 'data-uri': function(mimetypeNode, filePathNode) {

Expand Down
2 changes: 1 addition & 1 deletion packages/less/src/less/functions/default.js
@@ -1,4 +1,4 @@
import Keyword from '../tree/keyword';
import Keyword from '../tree/keyword.js';
import * as utils from '../utils';

const defaultFunc = {
Expand Down
2 changes: 1 addition & 1 deletion packages/less/src/less/functions/function-caller.js
@@ -1,4 +1,4 @@
import Expression from '../tree/expression';
import Expression from '../tree/expression.js';

class functionCaller {
constructor(name, context, index, currentFileInfo) {
Expand Down
26 changes: 13 additions & 13 deletions packages/less/src/less/functions/index.js
@@ -1,17 +1,17 @@
import functionRegistry from './function-registry';
import functionCaller from './function-caller';
import functionRegistry from './function-registry.js';
import functionCaller from './function-caller.js';

import boolean from './boolean';
import defaultFunc from './default';
import color from './color';
import colorBlending from './color-blending';
import dataUri from './data-uri';
import list from './list';
import math from './math';
import number from './number';
import string from './string';
import svg from './svg';
import types from './types';
import boolean from './boolean.js';
import defaultFunc from './default.js';
import color from './color.js';
import colorBlending from './color-blending.js';
import dataUri from './data-uri.js';
import list from './list.js';
import math from './math.js';
import number from './number.js';
import string from './string.js';
import svg from './svg.js';
import types from './types.js';

export default environment => {
const functions = { functionRegistry, functionCaller };
Expand Down
24 changes: 12 additions & 12 deletions packages/less/src/less/functions/list.js
@@ -1,13 +1,13 @@
import Comment from '../tree/comment';
import Node from '../tree/node';
import Dimension from '../tree/dimension';
import Declaration from '../tree/declaration';
import Expression from '../tree/expression';
import Ruleset from '../tree/ruleset';
import Selector from '../tree/selector';
import Element from '../tree/element';
import Quote from '../tree/quoted';
import Value from '../tree/value';
import Comment from '../tree/comment.js';
import Node from '../tree/node.js';
import Dimension from '../tree/dimension.js';
import Declaration from '../tree/declaration.js';
import Expression from '../tree/expression.js';
import Ruleset from '../tree/ruleset.js';
import Selector from '../tree/selector.js';
import Element from '../tree/element.js';
import Quote from '../tree/quoted.js';
import Value from '../tree/value.js';

const getItemsFromNode = node => {
// handle non-array values as an array of length 1
Expand Down Expand Up @@ -40,10 +40,10 @@ export default {
/**
* Creates a Less list of incremental values.
* Modeled after Lodash's range function, also exists natively in PHP
*
*
* @param {Dimension} [start=1]
* @param {Dimension} end - e.g. 10 or 10px - unit is added to output
* @param {Dimension} [step=1]
* @param {Dimension} [step=1]
*/
range: function(start, end, step) {
let from;
Expand Down
2 changes: 1 addition & 1 deletion packages/less/src/less/functions/math-helper.js
@@ -1,4 +1,4 @@
import Dimension from '../tree/dimension';
import Dimension from '../tree/dimension.js';

const MathHelper = (fn, unit, n) => {
if (!(n instanceof Dimension)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/less/src/less/functions/number.js
@@ -1,5 +1,5 @@
import Dimension from '../tree/dimension';
import Anonymous from '../tree/anonymous';
import Dimension from '../tree/dimension.js';
import Anonymous from '../tree/anonymous.js';
import mathHelper from './math-helper.js';

const minMax = function (isMin, args) {
Expand Down
6 changes: 3 additions & 3 deletions packages/less/src/less/functions/string.js
@@ -1,6 +1,6 @@
import Quoted from '../tree/quoted';
import Anonymous from '../tree/anonymous';
import JavaScript from '../tree/javascript';
import Quoted from '../tree/quoted.js';
import Anonymous from '../tree/anonymous.js';
import JavaScript from '../tree/javascript.js';

export default {
e: function (str) {
Expand Down
10 changes: 5 additions & 5 deletions packages/less/src/less/functions/svg.js
@@ -1,8 +1,8 @@
import Dimension from '../tree/dimension';
import Color from '../tree/color';
import Expression from '../tree/expression';
import Quoted from '../tree/quoted';
import URL from '../tree/url';
import Dimension from '../tree/dimension.js';
import Color from '../tree/color.js';
import Expression from '../tree/expression.js';
import Quoted from '../tree/quoted.js';
import URL from '../tree/url.js';

export default environment => {
return { 'svg-gradient': function(direction) {
Expand Down
16 changes: 8 additions & 8 deletions packages/less/src/less/functions/types.js
@@ -1,11 +1,11 @@
import Keyword from '../tree/keyword';
import DetachedRuleset from '../tree/detached-ruleset';
import Dimension from '../tree/dimension';
import Color from '../tree/color';
import Quoted from '../tree/quoted';
import Anonymous from '../tree/anonymous';
import URL from '../tree/url';
import Operation from '../tree/operation';
import Keyword from '../tree/keyword.js';
import DetachedRuleset from '../tree/detached-ruleset.js';
import Dimension from '../tree/dimension.js';
import Color from '../tree/color.js';
import Quoted from '../tree/quoted.js';
import Anonymous from '../tree/anonymous.js';
import URL from '../tree/url.js';
import Operation from '../tree/operation.js';

const isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;
const isunit = (n, unit) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/less/src/less/import-manager.js
@@ -1,8 +1,8 @@
import contexts from './contexts';
import Parser from './parser/parser';
import LessError from './less-error';
import * as utils from './utils';
import logger from './logger';
import contexts from './contexts.js';
import Parser from './parser/parser.js';
import LessError from './less-error.js';
import * as utils from './utils.js';
import logger from './logger.js';

export default function(environment) {
// FileInfo = {
Expand Down
42 changes: 21 additions & 21 deletions packages/less/src/less/index.js
@@ -1,23 +1,23 @@
import Environment from './environment/environment';
import data from './data';
import tree from './tree';
import AbstractFileManager from './environment/abstract-file-manager';
import AbstractPluginLoader from './environment/abstract-plugin-loader';
import visitors from './visitors';
import Parser from './parser/parser';
import functions from './functions';
import contexts from './contexts';
import LessError from './less-error';
import transformTree from './transform-tree';
import * as utils from './utils';
import PluginManager from './plugin-manager';
import logger from './logger';
import SourceMapOutput from './source-map-output';
import SourceMapBuilder from './source-map-builder';
import ParseTree from './parse-tree';
import ImportManager from './import-manager';
import Parse from './parse';
import Render from './render';
import Environment from './environment/environment.js';
import data from './data/index.js';
import tree from './tree/index.js';
import AbstractFileManager from './environment/abstract-file-manager.js';
import AbstractPluginLoader from './environment/abstract-plugin-loader.js';
import visitors from './visitors/index.js';
import Parser from './parser/parser.js';
import functions from './functions/index.js';
import contexts from './contexts.js';
import LessError from './less-error.js';
import transformTree from './transform-tree.js';
import * as utils from './utils.js';
import PluginManager from './plugin-manager.js';
import logger from './logger.js';
import SourceMapOutput from './source-map-output.js';
import SourceMapBuilder from './source-map-builder.js';
import ParseTree from './parse-tree.js';
import ImportManager from './import-manager.js';
import Parse from './parse.js';
import Render from './render.js';
import { version } from '../../package.json';
import parseVersion from 'parse-node-version';

Expand Down Expand Up @@ -88,7 +88,7 @@ export default function(environment, fileManagers) {
/**
* Some of the functions assume a `this` context of the API object,
* which causes it to fail when wrapped for ES6 imports.
*
*
* An assumed `this` should be removed in the future.
*/
initial.parse = initial.parse.bind(api);
Expand Down
4 changes: 2 additions & 2 deletions packages/less/src/less/less-error.js
@@ -1,4 +1,4 @@
import * as utils from './utils';
import * as utils from './utils.js';

const anonymousFunc = /(<anonymous>|Function):(\d+):(\d+)/;

Expand Down Expand Up @@ -52,7 +52,7 @@ const LessError = function(e, fileContentMap, currentFilename) {
/**
* We have to figure out how this environment stringifies anonymous functions
* so we can correctly map plugin errors.
*
*
* Note, in Node 8, the output of anonymous funcs varied based on parameters
* being present or not, so we inject dummy params.
*/
Expand Down
8 changes: 4 additions & 4 deletions packages/less/src/less/parse-tree.js
@@ -1,6 +1,6 @@
import LessError from './less-error';
import transformTree from './transform-tree';
import logger from './logger';
import LessError from './less-error.js';
import transformTree from './transform-tree.js';
import logger from './logger.js';

export default function(SourceMapBuilder) {
class ParseTree {
Expand All @@ -22,7 +22,7 @@ export default function(SourceMapBuilder) {
try {
const compress = Boolean(options.compress);
if (compress) {
logger.warn('The compress option has been deprecated. ' +
logger.warn('The compress option has been deprecated. ' +
'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');
}

Expand Down
10 changes: 5 additions & 5 deletions packages/less/src/less/parse.js
@@ -1,8 +1,8 @@
import contexts from './contexts';
import Parser from './parser/parser';
import PluginManager from './plugin-manager';
import LessError from './less-error';
import * as utils from './utils';
import contexts from './contexts.js';
import Parser from './parser/parser.js';
import PluginManager from './plugin-manager.js';
import LessError from './less-error.js';
import * as utils from './utils.js';

export default function(environment, ParseTree, ImportManager) {
const parse = function (input, options, callback) {
Expand Down
4 changes: 2 additions & 2 deletions packages/less/src/less/parser/parser-input.js
@@ -1,4 +1,4 @@
import chunker from './chunker';
import chunker from './chunker.js';

export default () => {
let // Less input string
Expand Down Expand Up @@ -235,7 +235,7 @@ export default () => {
loop = false
} else {
if (inComment) {
if (nextChar === '*' &&
if (nextChar === '*' &&
input.charAt(i + 1) === '/') {
i++;
blockDepth--;
Expand Down