forked from codinasion-archive/codinasion-monorepo
-
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.
Add @codinasion/language-data (codinasion-archive#4464)
- Loading branch information
1 parent
d5eb11c
commit 0f2c6cb
Showing
79 changed files
with
1,334 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.next | ||
dist | ||
program |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -23,4 +23,4 @@ | |
"engines": { | ||
"node": ">= 10.13.0" | ||
} | ||
} | ||
} |
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,12 +1,10 @@ | ||
{ | ||
"$schema": "https://openapi.vercel.sh/vercel.json", | ||
"regions": [ | ||
"bom1" | ||
], | ||
"regions": ["bom1"], | ||
"functions": { | ||
"api/**": { | ||
"memory": 1024, | ||
"maxDuration": 10 | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
"node-fetch": "2.6.6", | ||
"probot": "^12.2.4" | ||
}, | ||
|
||
"engines": { | ||
"node": ">= 10.13.0" | ||
} | ||
|
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,12 +1,10 @@ | ||
{ | ||
"$schema": "https://openapi.vercel.sh/vercel.json", | ||
"regions": [ | ||
"bom1" | ||
], | ||
"regions": ["bom1"], | ||
"functions": { | ||
"api/**": { | ||
"memory": 1024, | ||
"maxDuration": 10 | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -25,4 +25,4 @@ | |
"engines": { | ||
"node": ">= 10.13.0" | ||
} | ||
} | ||
} |
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,12 +1,10 @@ | ||
{ | ||
"$schema": "https://openapi.vercel.sh/vercel.json", | ||
"regions": [ | ||
"bom1" | ||
], | ||
"regions": ["bom1"], | ||
"functions": { | ||
"api/**": { | ||
"memory": 1024, | ||
"maxDuration": 10 | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
# @codinasion/language-data | ||
|
||
## 1.0.0 | ||
|
||
### Major Changes | ||
|
||
- Initial Package |
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,101 @@ | ||
# @codinasion/language-data | ||
|
||
Get programming language data. | ||
|
||
<div align="center"> | ||
<img src="https://raw.githubusercontent.com/codinasion/codinasion/master/assets/rainbow-hr.png" alt="rainbow hr" width="100%" height="70%"> | ||
</div> | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @codinasion/language-data | ||
# or | ||
yarn add @codinasion/language-data | ||
# or | ||
pnpm add @codinasion/language-data | ||
``` | ||
|
||
<div align="center"> | ||
<img src="https://raw.githubusercontent.com/codinasion/codinasion/master/assets/rainbow-hr.png" alt="rainbow hr" width="100%" height="70%"> | ||
</div> | ||
|
||
## Usage | ||
|
||
### `getLanguageData` | ||
|
||
```js | ||
// Import the `getLanguageData` function from the `@codinasion/language-data` package. | ||
import { getLanguageData } from "@codinasion/language-data"; | ||
|
||
// Call the `getLanguageData` function with the language name, or, file extension. | ||
const languageData = getLanguageData({ name: "Python" })[0]; | ||
|
||
// Use the `languageData` object to get the language data. | ||
console.log(languageData.name); // Python | ||
console.log(languageData.fileExtension[0]); // py | ||
console.log(languageData.namingConvention); // snake_case | ||
console.log(languageData.prismTag); // python | ||
console.log(languageData.logo); // https://github.com/codinasion/codinasion/assets/54644599/84788b04-f9ca-4201-b8fa-b097610ab2cf | ||
``` | ||
|
||
```js | ||
// Import the `getLanguageData` function from the `@codinasion/language-data` package. | ||
import { getLanguageData } from "@codinasion/language-data"; | ||
|
||
// Call the `getLanguageData` function with the language name, or, file extension. | ||
const languageData = getLanguageData({ | ||
prismTag: "csharp", | ||
})[0]; | ||
|
||
// // Use the `languageData` object to get the language data. | ||
console.log(languageData.name); // C# | ||
console.log(languageData.fileExtension[0]); // cs | ||
console.log(languageData.namingConvention); // PascalCase | ||
console.log(languageData.prismTag); // csharp | ||
console.log(languageData.logo); // https://github.com/codinasion/codinasion/assets/54644599/7c1c6b28-37ba-4871-afe0-3c8faee97b45 | ||
``` | ||
|
||
### `renameFile` | ||
|
||
```js | ||
// Import the `renameFile` function from the `@codinasion/language-data` package. | ||
import { renameFile } from "@codinasion/language-data"; | ||
|
||
// Call the `renameFile` function with the file name and the language name, or, file extension. | ||
const sampleFileName = "sample-file-name.py"; | ||
|
||
console.log(renameFile({ fileName: sampleFileName })); // sample_file_name.py | ||
``` | ||
|
||
> **Note:** Use `language name` with `file name` to rename file. Because multiple languages can have the same file extension. | ||
```js | ||
import { renameFile } from "@codinasion/language-data"; | ||
|
||
const sampleFileName = "sample-file-name.py"; | ||
|
||
console.log(renameFile({ fileName: sampleFileName, name: "python" })); // sample_file_name.py | ||
``` | ||
|
||
<div align="center"> | ||
<img src="https://raw.githubusercontent.com/codinasion/codinasion/master/assets/rainbow-hr.png" alt="rainbow hr" width="100%" height="70%"> | ||
</div> | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details. | ||
|
||
<div align="center"> | ||
<img src="https://raw.githubusercontent.com/codinasion/codinasion/master/assets/rainbow-hr.png" alt="rainbow hr" width="100%" height="70%"> | ||
</div> | ||
|
||
<br/> | ||
|
||
<p align="center"> | ||
Made with 💖 by Codinasion | ||
</p> | ||
|
||
<div align="center"> | ||
<img src="https://raw.githubusercontent.com/codinasion/codinasion/master/assets/rainbow-hr.png" alt="rainbow hr" width="100%" height="70%"> | ||
</div> |
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,8 @@ | ||
{ | ||
"transform": { | ||
"^.+\\.(t|j)sx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__test__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"], | ||
"testPathIgnorePatterns": ["dist"] | ||
} |
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,54 @@ | ||
{ | ||
"name": "@codinasion/language-data", | ||
"version": "1.0.0", | ||
"access": "public", | ||
"description": "Get programming language data", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"license": "MIT", | ||
"repository": "https://github.com/codinasion/codinasion", | ||
"homepage": "https://github.com/codinasion/codinasion/tree/master/packages/npm/language-data", | ||
"bugs": { | ||
"url": "https://github.com/codinasion/codinasion/issues", | ||
"email": "[email protected]" | ||
}, | ||
"author": { | ||
"name": "Harsh Raj", | ||
"email": "[email protected]", | ||
"url": "https://github.com/harshraj8843" | ||
}, | ||
"keywords": [ | ||
"codinasion", | ||
"language", | ||
"programming language", | ||
"typescript", | ||
"language data", | ||
"programming language data", | ||
"file extension", | ||
"naming convention", | ||
"programming language logo" | ||
], | ||
"scripts": { | ||
"lint": "eslint \"**/*.ts*\"", | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"check-types": "tsc --noEmit", | ||
"test": "jest --config jestconfig.json --maxWorkers=50%" | ||
}, | ||
"dependencies": { | ||
"@codinasion/tools": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.1", | ||
"eslint": "^7.32.0", | ||
"eslint-config-custom": "workspace:*", | ||
"jest": "^29.5.0", | ||
"ts-jest": "^29.1.0", | ||
"tsconfig": "workspace:*", | ||
"tsup": "^6.1.3", | ||
"typescript": "^4.9.4" | ||
} | ||
} |
Oops, something went wrong.