add paralel jobs

This commit is contained in:
Eric Fennis
2021-09-17 15:51:18 +02:00
parent f5175bd4b2
commit da7c09f66e
12 changed files with 51 additions and 36 deletions
+14 -5
View File
@@ -275,15 +275,24 @@ jobs:
- name: "Outline SVG"
run: yarn build:outline-icons
- name: Build 'Lucide'
- name: Build Icon Font
run: |
mkdir build
list=(_200 _300 "" _500 _600)
list=(-200 -300 "" -500 -600)
command=''
for name in "${list[@]}"
do
fontcustom compile "./converted_icons${name}" -h -n "Lucide${name}" -o ./tmp -F && mv ./tmp/* build
if [ -z "$command" ]
subcommand="(fontcustom compile "./converted_icons${name}" -h -n "lucide${name}" -o ./tmp -F && mv ./tmp/* build)"
then
command="$subcommand";
else
command="$command & $subcommand";
fi
done
eval $command
- name: 'Upload to Artifacts'
uses: actions/upload-artifact@v1
with:
@@ -325,10 +334,10 @@ jobs:
working-directory: packages/lucide-flutter
- name: Move the ttf file
run: mv lucide-font/Lucide.ttf packages/lucide-flutter/assets/Lucide.ttf
run: mv lucide-font/lucide.ttf packages/lucide-flutter/assets/Lucide.ttf
- name: Generate exports file
run: dart tool/generate_fonts.dart lucide-font/Lucide-preview.html
run: dart tool/generate_fonts.dart lucide-font/lucide-preview.html
working-directory: packages/lucide-flutter
- name: Update yaml
+1 -1
View File
@@ -19,7 +19,7 @@
"typings": "dist/lucide-preact.d.ts",
"sideEffects": false,
"scripts": {
"build": "yarn clean && yarn build:icons && yarn build:es && yarn build:types && yarn build:bundles",
"build": "yarn clean && yarn build:icons && (yarn build:es & yarn build:types & yarn build:bundles)",
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-preact/src --templateSrc=../packages/lucide-preact/scripts/exportTemplate --renderUniqueKey",
"build:es": "babel src -d dist/esm",
+1 -1
View File
@@ -19,7 +19,7 @@
"typings": "dist/lucide-react.d.ts",
"sideEffects": false,
"scripts": {
"build": "yarn clean && yarn build:icons && yarn build:es && yarn build:types && yarn build:bundles",
"build": "yarn clean && yarn build:icons && (yarn build:es & yarn build:types & yarn build:bundles)",
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-react/src --templateSrc=../packages/lucide-react/scripts/exportTemplate --renderUniqueKey",
"build:es": "babel src -d dist/esm",
+2 -2
View File
@@ -20,9 +20,9 @@
"typings": "dist/lucide-vue-next.d.ts",
"sideEffects": false,
"scripts": {
"build": "yarn clean && yarn build:icons && yarn build:es && yarn build:types && yarn build:bundles",
"build": "yarn clean && yarn build:icons && (yarn build:es & yarn build:types & yarn build:bundles)",
"clean": "rm -rf dist && rm -rf ./src/icons/*.js",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-vue-next/src --templateSrc=../packages/lucide-vue-next/scripts/exportTemplate",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-vue-next/src --templateSrc=../packages/lucide-vue-next/scripts/exportTemplate --renderUniqueKey",
"build:es": "babel src -d dist/esm",
"build:types": "yarn --cwd ../../ babel-node packages/lucide-vue-next/scripts/buildTypes.js",
"build:bundles": "yarn --cwd ../../ rollup -c packages/lucide-vue-next/rollup.config.js",
+6 -4
View File
@@ -1,12 +1,14 @@
const mainConfig = require('../../babel.config');
module.exports = {
presets: [
[
'@babel/preset-env',
'@babel/env',
{
targets: {
node: 'current',
},
loose: true,
modules: false,
},
],
],
env: mainConfig.env,
};
+6 -7
View File
@@ -1,12 +1,11 @@
import { join } from 'path'
export default function () {
import { join } from 'path';
export default function() {
this.nuxt.hook('components:dirs', dirs => {
dirs.push({
path: join(__dirname, 'dist', 'esm', 'icons'),
prefix: 'Icon',
ignore: ['**/index.js']
})
})
}
ignore: ['**/index.js'],
});
});
}
+1 -1
View File
@@ -19,7 +19,7 @@
"unpkg": "dist/umd/lucide-vue.min.js",
"sideEffects": false,
"scripts": {
"build": "yarn clean && yarn build:icons && yarn build:es && yarn build:bundles",
"build": "yarn clean && yarn build:icons && (yarn build:es & yarn build:bundles)",
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-vue/src --templateSrc=../packages/lucide-vue/scripts/exportTemplate",
"build:es": "babel src -d dist/esm",
@@ -8,7 +8,7 @@ import defaultAttributes from './defaultAttributes';
* @param {string} string
* @returns {string} A kebabized string
*/
export const toKebabCase = string => string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
export const toKebabCase = string => string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
export default (iconName, iconNode) => ({
name: iconName,
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Using lucide icon components should add a class to the element 1`] = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide-icon my-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide-icon lucide lucide-smile my-icon">
<circle cx="12" cy="12" r="10"></circle>
<path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
<line x1="9" y1="9" x2="9.01" y2="9"></line>
@@ -10,7 +10,7 @@ exports[`Using lucide icon components should add a class to the element 1`] = `
`;
exports[`Using lucide icon components should add a style attribute to the element 1`] = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="position: absolute" class="lucide-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="position: absolute" class="lucide-icon lucide lucide-smile">
<circle cx="12" cy="12" r="10"></circle>
<path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
<line x1="9" y1="9" x2="9.01" y2="9"></line>
@@ -19,7 +19,7 @@ exports[`Using lucide icon components should add a style attribute to the elemen
`;
exports[`Using lucide icon components should adjust the size, stroke color and stroke width 1`] = `
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="red" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="lucide-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="red" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="lucide-icon lucide lucide-smile">
<circle cx="12" cy="12" r="10"></circle>
<path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
<line x1="9" y1="9" x2="9.01" y2="9"></line>
@@ -28,7 +28,7 @@ exports[`Using lucide icon components should adjust the size, stroke color and s
`;
exports[`Using lucide icon components should render an component 1`] = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide-icon lucide lucide-smile">
<circle cx="12" cy="12" r="10"></circle>
<path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
<line x1="9" y1="9" x2="9.01" y2="9"></line>
+1 -2
View File
@@ -28,7 +28,7 @@ describe('Using lucide icon components', () => {
})
expect(wrapper).toMatchSnapshot();
expect(String(wrapper.classes())).toBe(String(['lucide-icon', 'my-icon']))
expect(String(wrapper.classes())).toBe(String(['lucide-icon','lucide','lucide-smile', 'my-icon']))
});
it('should add a style attribute to the element', () => {
@@ -36,7 +36,6 @@ describe('Using lucide icon components', () => {
attrs: {
style: 'position: absolute',
}
})
expect(wrapper).toMatchSnapshot();
+1 -1
View File
@@ -19,7 +19,7 @@
"typings": "dist/lucide.d.ts",
"sideEffects": false,
"scripts": {
"build": "yarn clean && yarn build:icons && yarn build:es && yarn build:types && yarn build:bundles",
"build": "yarn clean && yarn build:icons && (yarn build:es & yarn build:types & yarn build:bundles)",
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.js",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide/src",
"build:es": "babel src -d dist/esm",
+13 -7
View File
@@ -2,6 +2,7 @@
import fs from 'fs';
import path from 'path';
import prettier from 'prettier';
import { promises } from 'stream';
import { toPascalCase } from '../helpers';
export default function({ iconNodes, outputDirectory, template, showLog = true, iconFileExtention = '.js' }) {
@@ -12,7 +13,7 @@ export default function({ iconNodes, outputDirectory, template, showLog = true,
fs.mkdirSync(iconsDistDirectory);
}
icons.forEach(iconName => {
const writeIconFiles = icons.map(async iconName => {
const location = path.join(iconsDistDirectory, `${iconName}${iconFileExtention}`);
const componentName = toPascalCase(iconName);
@@ -21,11 +22,16 @@ export default function({ iconNodes, outputDirectory, template, showLog = true,
const elementTemplate = template({ componentName, iconName, children });
fs.writeFileSync(location, prettier.format(elementTemplate, { singleQuote: true, trailingComma: 'all', parser: 'babel' }), 'utf-8');
if(showLog) {
console.log('Successfully built', componentName);
}
await fs.promises.writeFile(location, prettier.format(elementTemplate, { singleQuote: true, trailingComma: 'all', parser: 'babel' }), 'utf-8');
});
Promise.all(writeIconFiles)
.then(() => {
if(showLog) {
console.log('Successfully built', icons.length, 'icons.');
}
})
.catch((error) => {
throw new Error(`Something went wrong generating icon files,\n ${error}`)
})
}