Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jaywcjlove/compile-less
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.1
Choose a base ref
...
head repository: jaywcjlove/compile-less
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.8.2
Choose a head ref
  • 6 commits
  • 9 files changed
  • 1 contributor

Commits on Aug 31, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1034692 View commit details
  2. chore: update .gitignore

    jaywcjlove committed Aug 31, 2021
    Copy the full SHA
    8df6245 View commit details
  3. Copy the full SHA
    641fbe1 View commit details
  4. Copy the full SHA
    d118fea View commit details
  5. Copy the full SHA
    0bd19ae View commit details
  6. released v1.8.2

    jaywcjlove committed Aug 31, 2021
    Copy the full SHA
    c596556 View commit details
Showing with 29 additions and 40 deletions.
  1. +0 −9 .github/workflows/ci.yml
  2. +1 −0 .gitignore
  3. +9 −12 package.json
  4. +7 −3 src/compile.ts
  5. +1 −0 src/executeLess.ts
  6. +0 −8 src/global.d.ts
  7. +0 −1 src/{cli.ts → index.ts}
  8. +9 −0 src/tsconfig.json
  9. +2 −7 tsconfig.json
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -8,15 +8,6 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Look Changelog
uses: jaywcjlove/changelog-generator@v1.4.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{steps.create_tag.outputs.version}}
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot)
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- uses: actions/setup-node@v2
with:
node-version: 14
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ test/out
npm-debug.log*
lerna-debug.log
yarn-error.log
package-lock.json

.DS_Store
.cache
21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"name": "compile-less-cli",
"version": "1.8.1",
"version": "1.8.2",
"description": "All `.less` files are compiled into `.css` files.",
"main": "lib/compile.js",
"bin": {
"compile-less": "lib/cli.js"
"compile-less": "lib/index.js"
},
"scripts": {
"prepare": "npm run build",
"watch": "npm run watch:ts & npm run build:types -- --watch",
"watch:ts": "tsbb watch",
"build": "npm run build:ts && npm run build:types",
"build:ts": "tsbb build",
"build:types": "tsbb types",
"test": "node ./lib/cli.js -d test/src -o test/out",
"test:watch": "node ./lib/cli.js -d test/src -o test/out --combine test/out/dist.css --watch",
"test:watch2": "node ./lib/cli.js -d test/src -o test/out --watch --exclude-css"
"watch": "tsbb watch --disable-babel --no-esm",
"build": "tsbb build --disable-babel --no-esm",
"test": "node ./lib/index.js -d test/src -o test/out",
"test:watch": "node ./lib/index.js -d test/src -o test/out --combine test/out/dist.css --watch",
"test:watch2": "node ./lib/index.js -d test/src -o test/out --watch --exclude-css"
},
"repository": {
"type": "git",
@@ -39,13 +36,13 @@
"src"
],
"devDependencies": {
"tsbb": "2.3.1"
"tsbb": "3.0.0"
},
"dependencies": {
"@types/fs-extra": "9.0.12",
"@types/less": "3.0.3",
"@types/minimist": "1.2.2",
"@types/node": "16.6.1",
"@types/node": "16.7.8",
"chokidar": "3.5.2",
"directory-tree": "2.3.1",
"fs-extra": "10.0.0",
10 changes: 7 additions & 3 deletions src/compile.ts
Original file line number Diff line number Diff line change
@@ -23,8 +23,12 @@ export default async function compile(dir: string, option: ICompileOtion) {
if (combine) {
const outputCssFile = path.join(process.cwd(), combine);
const cssStr: Array<string> = lessSource.map((item: IOutputFile) => item.css);
await fs.outputFile(outputCssFile, cssStr.join(''));
console.log('♻️ \x1b[32m =>\x1b[0m:', 'Output one file: ->', outputCssFile);
if (!!cssStr.join('').trim()) {
await fs.outputFile(outputCssFile, cssStr.join(''));
console.log('♻️ \x1b[32m =>\x1b[0m:', 'Output one file: ->', outputCssFile);
} else {
console.log('🚧\x1b[33m No content is output.\x1b[0m');
}
} else {
const outputDir = path.join(process.cwd(), out);
await Promise.all(lessSource.map(async (item: IOutputFile) => {
@@ -44,7 +48,7 @@ export async function outputFile(data: IOutputFile, inputDir: string, outputDir:
console.log('♻️ \x1b[32m =>\x1b[0m:', logPathIn, '->', logPathOut);
await fs.outputFile(data.path, data.css);
if (data.imports && data.imports.length > 0) {
console.log('\x1b[35m imports \x1b[0m:', data.imports);
// console.log('\x1b[35m imports-> \x1b[0m:', data.imports);
}
} catch (error) {
throw error;
1 change: 1 addition & 0 deletions src/executeLess.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'fs-extra';
import less from 'less';
import { spawn } from 'child_process';
// @ts-ignore
import LessPluginAutoPrefix from 'less-plugin-autoprefix';

const autoprefixPlugin = new LessPluginAutoPrefix({
8 changes: 0 additions & 8 deletions src/global.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/cli.ts → src/index.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ function outputHelp() {
console.log(' -r, --rm-global,', 'Remove ":global" and ":global(className)".');
exampleHelp();
}

const argvs = minimist(process.argv.slice(2));
if (argvs.h || argvs.help) {
outputHelp()
9 changes: 9 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

{
"extends": "../tsconfig",
"include": ["../src"],
"compilerOptions": {
"baseUrl": ".",
"noEmit": false
}
}
9 changes: 2 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"baseUrl": "./lib",
"baseUrl": ".",
"target": "es5",
"lib": [
"es2015",
@@ -24,10 +24,5 @@
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"node_modules",
".bin",
"lib"
]
}
}