Skip to content

Commit

Permalink
Format directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Apr 11, 2021
1 parent 58c1187 commit 770d5a7
Show file tree
Hide file tree
Showing 35 changed files with 4,814 additions and 346 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverage
stats
*.log
packages/**/src/icons/*.js
packages/**/src/icons/*.ts
2 changes: 1 addition & 1 deletion packages/lucide-angular/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ Thumbs.db

#npm-yarn
package-lock.json
yarn.lock
src/createElement.js
15 changes: 15 additions & 0 deletions packages/lucide-angular/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2020, Lucide Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
File renamed without changes.
22 changes: 11 additions & 11 deletions packages/lucide-angular/angular.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"newProjectRoot": "",
"projects": {
"lucide-angular": {
"projectType": "library",
"root": "projects/lucide-angular",
"sourceRoot": "projects/lucide-angular/src",
"root": "",
"sourceRoot": "src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/lucide-angular/tsconfig.lib.json",
"project": "projects/lucide-angular/ng-package.json"
"tsConfig": "tsconfig.lib.json",
"project": "ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/lucide-angular/tsconfig.lib.prod.json"
"tsConfig": "tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/lucide-angular/src/test.ts",
"tsConfig": "projects/lucide-angular/tsconfig.spec.json",
"karmaConfig": "projects/lucide-angular/karma.conf.js"
"main": "src/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/lucide-angular/tsconfig.lib.json",
"projects/lucide-angular/tsconfig.spec.json"
"tsconfig.lib.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable import/no-extraneous-dependencies, global-require, func-names */
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
Expand All @@ -11,7 +12,7 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
jasmine: {
Expand All @@ -20,18 +21,15 @@ module.exports = function (config) {
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
suppressAll: true, // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, '../../coverage/lucide-angular'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
reporters: [{ type: 'html' }, { type: 'text-summary' }],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
Expand All @@ -42,10 +40,10 @@ module.exports = function (config) {
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
flags: ['--no-sandbox'],
},
},
singleRun: false,
restartOnFileChange: true
restartOnFileChange: true,
});
};
7 changes: 7 additions & 0 deletions packages/lucide-angular/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"dest": "dist",
"lib": {
"entryFile": "src/lucide.ts"
}
}
20 changes: 11 additions & 9 deletions packages/lucide-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"repository": {
"type": "git",
"url": "https://github.com/lucide-icons/lucide.git",
"directory": "packages/lucide-vue"
"directory": "packages/lucide-angular"
},
"keywords": [
"Lucide",
Expand All @@ -22,26 +22,28 @@
"Font Awesome"
],
"scripts": {
"build": "yarn clean && yarn build:js && yarn build:icons && yarn build:iconsindex && yarn build:ng",
"clean": "rm -rf dist && rm -rf projects/lucide-angular/build",
"build:js": "mkdir -p projects/lucide-angular/build && cp -av ../lucide/src/createElement.js projects/lucide-angular/build/",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-angular/projects/lucide-angular/build --templateSrc=../packages/lucide-angular/scripts/exportTemplate && for f in projects/lucide-angular/build/icons/*.js; do mv -- \"$f\" \"${f%.js}.ts\"; done",
"build:iconsindex": "yarn --cwd ../../ babel-node packages/lucide-angular/scripts/buildIconsIndex.js",
"build": "yarn clean && yarn build:icons && yarn build:ng",
"clean": "rm -rf dist && rm -rf ./src/icons/*.ts",
"build:icons": "yarn --cwd ../../ build:icons --output=../packages/lucide-angular/src --templateSrc=../packages/lucide-angular/scripts/exportTemplate --iconFileExtention=.ts --exportFileName=index.ts",
"build:ng": "ng build --prod",
"test:headless": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^11.2.6",
"@angular/core": "^11.2.6"
},
"devDependencies": {
"@angular/common": "~11.2.6",
"@angular/compiler": "~11.2.6",
"@angular/core": "~11.2.6",
"@angular/platform-browser": "~11.2.6",
"@angular/platform-browser-dynamic": "~11.2.6",
"tslib": "^2.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.5",
"@angular/cli": "~11.2.5",
"@angular/compiler-cli": "~11.2.6",
Expand Down

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions packages/lucide-angular/projects/lucide-angular/lib-index.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/lucide-angular/projects/lucide-angular/lucide.ts

This file was deleted.

This file was deleted.

31 changes: 0 additions & 31 deletions packages/lucide-angular/projects/lucide-angular/package.json

This file was deleted.

17 changes: 0 additions & 17 deletions packages/lucide-angular/projects/lucide-angular/tslint.json

This file was deleted.

39 changes: 0 additions & 39 deletions packages/lucide-angular/scripts/buildIconsIndex.js

This file was deleted.

8 changes: 5 additions & 3 deletions packages/lucide-angular/scripts/exportTemplate.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export default ({ componentName, children }) => `
import { IconData } from '../../lucide';
import defaultAttributes from '../../default-attributes';
import { IconData } from './types';
import defaultAttributes from './constants/default-attributes';
export const ${componentName}: IconData = [
const ${componentName}: IconData = [
'svg',
defaultAttributes,
${JSON.stringify(children)}
];
export default ${componentName};
`;
26 changes: 26 additions & 0 deletions packages/lucide-angular/src/create-element.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { IconData } from './icons/types'

/**
* Creates a new SVGElement from icon node
* @param {string} tag
* @param {object} attrs
* @param {array} children
* @returns {SVGElement}
*/
export const createElement = ([tag, attrs, children = []]: IconData): SVGElement => {
const element = document.createElementNS('http://www.w3.org/2000/svg', tag);

Object.keys(attrs).forEach(name => {
element.setAttribute(name, attrs[name]);
});

if (children.length) {
children.forEach((child: IconData) => {
const childElement = createElement(child);

element.appendChild(childElement);
});
}

return element;
};
8 changes: 8 additions & 0 deletions packages/lucide-angular/src/icons/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ngPackage": {
"dest": "dist",
"lib": {
"entryFile": "./index.ts"
}
}
}
3 changes: 3 additions & 0 deletions packages/lucide-angular/src/icons/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type IconNode = readonly [string, object];
export type IconData = readonly [string, object, IconNode[]? ];
export type Icons = { [key: string]: IconData }
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export class Icons {
constructor(private icons: object) {}
}
export class Icons {
constructor(private icons: object) {}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LucideAngularModule } from './lucide-angular.module';

import { LucideAngularComponent } from './lucide-angular.component';

describe('LucideAngularComponent', () => {
Expand Down
Loading

0 comments on commit 770d5a7

Please sign in to comment.