-
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.
### Changed - Renaming - Publish to npm via GitHub actions - Test in GitHub actions - Publish to npm via GitHub actions - Support Imperial Aramaic
- Loading branch information
Showing
29 changed files
with
520 additions
and
73 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Lint and Test | ||
|
||
on: | ||
push: | ||
branches: [ "main", "version/*" ] | ||
pull_request: | ||
|
||
jobs: | ||
lint-test: | ||
name: Lint & Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node-version: [ 20.x, 18.x, 16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
- run: yarn | ||
- run: yarn lint | ||
- run: yarn build | ||
- run: yarn test |
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,62 @@ | ||
name: Publish Latest | ||
on: | ||
release: | ||
types: [ released ] | ||
|
||
env: | ||
TAG_NAME: ${{ github.event.release.tag_name }} | ||
PACKAGE_VERSION: "" # to be filled later after checkout | ||
|
||
jobs: | ||
publish: | ||
name: Publish to npm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: fill package version | ||
run: | | ||
PACKAGE_VERSION=$(jq -r '.version' packages/abjad-convert/package.json) | ||
echo "🔢 Package version: $PACKAGE_VERSION" | ||
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | ||
- name: validate tag name | ||
run: | | ||
if [[ ! $TAG_NAME =~ ^v([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$ ]]; then | ||
echo "❌ Invalid tag name: $TAG_NAME not suitable for latest release" | ||
exit 1 | ||
else | ||
echo "✅ Valid tag name: $TAG_NAME" | ||
fi | ||
- name: validate version in package.json | ||
run: | | ||
if [[ ! $PACKAGE_VERSION =~ ^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$ ]]; then | ||
echo "❌ Invalid version name: $PACKAGE_VERSION not suitable for latest release" | ||
exit 1 | ||
else | ||
echo "✅ Valid version: $PACKAGE_VERSION" | ||
fi | ||
- name: check if version in package.json is matching tag name | ||
run: | | ||
if [[ "v$PACKAGE_VERSION" != $TAG_NAME ]]; then | ||
echo "❌ Version in package.json of abjad-convert: $PACKAGE_VERSION is not matching with tag name: $TAG_NAME" | ||
exit 1 | ||
else | ||
echo "✅ Version in package.json of abjad-convert is matching with tag name" | ||
fi | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
registry-url: https://registry.npmjs.org | ||
always-auth: true | ||
cache: yarn | ||
|
||
- run: yarn workspace abjad-convert install --frozen-lockfile | ||
|
||
- name: publish abjad-convert to npm | ||
run: yarn workspace abjad-convert publish --access public --no-git-tag-version --new-version $PACKAGE_VERSION --tag latest | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.ABJAD_CONVERT_PUBLISH_AUTH_TOKEN }} |
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,60 @@ | ||
name: Publish Next | ||
on: | ||
release: | ||
types: [ prereleased ] | ||
|
||
env: | ||
TAG_NAME: ${{ github.event.release.tag_name }} | ||
PACKAGE_VERSION: "" # to be filled later after checkout | ||
|
||
jobs: | ||
publish: | ||
name: Publish next to npm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: fill package version | ||
run: | | ||
PACKAGE_VERSION=$(jq -r '.version' packages/abjad-convert/package.json) | ||
echo "🔢 Package version: $PACKAGE_VERSION" | ||
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | ||
- name: validate tag name | ||
run: | | ||
if [[ ! $TAG_NAME =~ ^v([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)-next\.([0-9]|[1-9][0-9]*)$ ]]; then | ||
echo "❌ Invalid tag name: $TAG_NAME not suitable for next tag publish" | ||
exit 1 | ||
else | ||
echo "✅ Valid tag name: $TAG_NAME" | ||
fi | ||
- name: validate version in package.json | ||
run: | | ||
if [[ ! $PACKAGE_VERSION =~ ^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)-next\.([0-9]|[1-9][0-9]*)$ ]]; then | ||
echo "❌ Invalid version name: $PACKAGE_VERSION not suitable for next tag publish" | ||
exit 1 | ||
else | ||
echo "✅ Valid @next version: $PACKAGE_VERSION" | ||
fi | ||
- name: check if version in package.json is matching tag name | ||
run: | | ||
if [[ "v$PACKAGE_VERSION" != $TAG_NAME ]]; then | ||
echo "❌ Version in package.json of $PACKAGE_NAME: $PACKAGE_VERSION is not matching with tag name: $TAG_NAME" | ||
exit 1 | ||
else | ||
echo "✅ Version: $PACKAGE_VERSION in package.json of $PACKAGE_NAME is matching with tag name: $TAG_NAME" | ||
fi | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
registry-url: https://registry.npmjs.org | ||
always-auth: true | ||
cache: yarn | ||
|
||
- run: yarn workspace abjad-convert install --frozen-lockfile | ||
|
||
- name: publish abjad-convert @next to npm | ||
run: yarn workspace abjad-convert publish --access public --no-git-tag-version --new-version $PACKAGE_VERSION --tag next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.ABJAD_CONVERT_PUBLISH_AUTH_TOKEN }} |
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,11 @@ | ||
# Changelog | ||
<!-- https://keepachangelog.com/en/1.0.0/ --> | ||
|
||
## [0.0.2] 2024-01-05 | ||
### Changed | ||
- Renaming | ||
- Publish to npm via GitHub actions | ||
|
||
## [0.0.1] 2024-01-04 | ||
### Added | ||
- Root project structure |
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,5 +1,10 @@ | ||
# Abjad Convert Mono Repo | ||
# Abjad Mono Repo | ||
|
||
This is a monorepo for the Abjad Convert project. | ||
## Abajd Convert package | ||
[README](https://github.com/amerharb/abjad-convert/blob/main/packages/abjad-convert/README.md) | ||
|
||
## Packages | ||
### Abajd Convert | ||
[README](https://github.com/amerharb/abjad/blob/main/packages/abjad-convert/README.md) | ||
|
||
### Abjad Client | ||
example of a client for the abjad convert 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
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,18 @@ | ||
{ | ||
"name": "abjad-client", | ||
"private": true, | ||
"version": "0.0.2", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prebuild": "rm -rf dist", | ||
"build": "tsc", | ||
"start": "node dist/index.js", | ||
"test": "echo \"Error: no test specified\" && exit 0", | ||
"dev": "ts-node src/index.ts", | ||
"lint": "npx eslint . --max-warnings 0", | ||
"lint-fix": "npx eslint . --fix" | ||
}, | ||
"dependencies": { | ||
"abjad-convert": "next" | ||
} | ||
} |
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,38 @@ | ||
import { Abjad, convert } from 'abjad-convert' | ||
|
||
log('Abjad Convert') | ||
|
||
const arabic = 'ا ب ت ج د خ' | ||
log(`convert Arabic text ${arabic} to Ugaritic`) | ||
log(calmConvert(arabic, Abjad.Arabic, Abjad.Ugaritic)) | ||
log(`convert Arabic text ${arabic} to Phoenician`) | ||
log(calmConvert(arabic, Abjad.Arabic, Abjad.Phoenician)) | ||
|
||
const ugaritic = '𐎀 𐎁 𐎚 𐎂 𐎄 𐎃' | ||
log(`convert Ugaritic text ${ugaritic} to Arabic`) | ||
log(calmConvert(ugaritic, Abjad.Ugaritic, Abjad.Arabic)) | ||
log(`convert Ugaritic text ${ugaritic} to Phoenician`) | ||
log(calmConvert(ugaritic, Abjad.Ugaritic, Abjad.Phoenician)) | ||
|
||
const phoenician = '𐤀 𐤁 𐤂 𐤃 𐤄 𐤅' | ||
log(`convert Phoenician text ${phoenician} to Arabic`) | ||
log(calmConvert(phoenician, Abjad.Phoenician, Abjad.Arabic)) | ||
log(`convert Phoenician text ${phoenician} to Ugaritic`) | ||
log(calmConvert(phoenician, Abjad.Phoenician, Abjad.Ugaritic)) | ||
|
||
log(calmConvert('مرحبا', Abjad.Arabic, Abjad.Phoenician)) | ||
log(calmConvert('مرحبا', Abjad.Arabic, Abjad.Ugaritic)) | ||
log(calmConvert('مرحبا', Abjad.Arabic, Abjad.ImperialAramaic)) | ||
|
||
function calmConvert(source: string, from: Abjad, to: Abjad): string { | ||
try { | ||
return convert(source, from, to) | ||
} catch (e: any) { | ||
return e.message | ||
} | ||
} | ||
|
||
function log(message: string): void { | ||
// eslint-disable-next-line no-console | ||
console.log(message) | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,6 +1,12 @@ | ||
# Changelog | ||
<!-- https://keepachangelog.com/en/1.0.0/ --> | ||
|
||
## [0.0.2] 2024-01-05 | ||
### Added | ||
- Test in GitHub actions | ||
- Publish to npm via GitHub actions | ||
- Support Imperial Aramaic | ||
|
||
## [0.0.1] 2024-01-04 | ||
### Added | ||
- Initial project covert between 3 languages Arabic, Phoenician and Ugaritic |
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
Oops, something went wrong.