forked from simple-icons/simple-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
630 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"singleQuote": true | ||
"singleQuote": true, | ||
"bracketSpacing": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"prettier": true, | ||
"space": 2, | ||
"plugins": ["import"], | ||
"rules": { | ||
"n/no-unsupported-features": "off", | ||
"n/no-unsupported-features/node-builtins": "off", | ||
"n/file-extension-in-import": "off", | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
"ignoreCase": false, | ||
"ignoreDeclarationSort": true, | ||
"ignoreMemberSort": false, | ||
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"], | ||
"allowSeparatedGroups": false | ||
} | ||
], | ||
"import/no-named-as-default": "off", | ||
"import/extensions": "off", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": ["builtin", "external", "parent", "sibling", "index"], | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
}, | ||
"warnOnUnassignedImports": true, | ||
"newlines-between": "never" | ||
} | ||
] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["sdk.mjs", "sdk.d.ts"], | ||
"nodeVersion": ">=14" | ||
}, | ||
{ | ||
"files": [ | ||
"scripts/**/*", | ||
"tests/**/*", | ||
"svglint.config.mjs", | ||
"svgo.config.mjs" | ||
], | ||
"nodeVersion": ">=18" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
#!/usr/bin/env node | ||
/** | ||
* @fileoverview | ||
* Clean files built by the build process. | ||
*/ | ||
|
||
import fs from 'node:fs'; | ||
import fs from 'node:fs/promises'; | ||
import path from 'node:path'; | ||
import { getDirnameFromImportMeta } from '../../sdk.mjs'; | ||
import process from 'node:process'; | ||
import {getDirnameFromImportMeta} from '../../sdk.mjs'; | ||
|
||
const __dirname = getDirnameFromImportMeta(import.meta.url); | ||
const rootDirectory = path.resolve(__dirname, '..', '..'); | ||
const files = ['index.js', 'index.mjs', 'index.d.ts', 'sdk.js']; | ||
|
||
const fileExists = (fpath) => | ||
new Promise((r) => fs.access(fpath, fs.constants.F_OK, (e) => r(!e))); | ||
fs | ||
.access(fpath, fs.constants.F_OK) | ||
.then(() => true) | ||
.catch(() => false); | ||
|
||
Promise.all( | ||
files.map(async (file) => { | ||
const filepath = path.join(rootDirectory, file); | ||
if (!(await fileExists(filepath))) { | ||
console.error(`File ${file} does not exist, skipping...`); | ||
return; | ||
} | ||
return fs.promises.unlink(filepath); | ||
}), | ||
).catch((error) => { | ||
console.error(`Error cleaning files: ${error.message}`); | ||
try { | ||
Promise.all( | ||
files.map(async (file) => { | ||
const filepath = path.join(rootDirectory, file); | ||
if (!(await fileExists(filepath))) { | ||
console.error(`File ${file} does not exist, skipping...`); | ||
return; | ||
} | ||
|
||
return fs.unlink(filepath); | ||
}), | ||
); | ||
} catch (error) { | ||
console.error('Error cleaning files:', error); | ||
process.exit(1); | ||
}); | ||
} |
Oops, something went wrong.