Skip to content

Commit 1f473da

Browse files
authored
Merge pull request #119 from interscript/astro-migration
feat: migrate site to Astro 7 + Vite 8 + Tailwind 4 + Vue 3
2 parents 0faf5e0 + a11bbc5 commit 1f473da

1,091 files changed

Lines changed: 3586065 additions & 28494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,32 @@ name: build
22

33
on:
44
push:
5+
branches: [main, astro-migration]
56
pull_request:
6-
repository_dispatch:
7-
types: [ 'interscript/interscript' ]
7+
workflow_dispatch:
88

99
jobs:
1010
build:
11-
name: Build
1211
runs-on: ubuntu-latest
1312
steps:
1413
- uses: actions/checkout@v7
1514
- name: Use Node
1615
uses: actions/setup-node@v7
1716
with:
18-
node-version: '18'
19-
cache: yarn
20-
- name: Install NPM dependencies
17+
node-version: "22"
18+
cache: npm
19+
- name: Clone interscript-ts (file: dependency)
2120
run: |
22-
yarn install --frozen-lockfile
23-
yarn global add asciidoctor@^2.2.4
21+
git clone --depth=1 --branch feat/imf-runtime-ts https://github.com/interscript/interscript-ts.git ../interscript-ts
22+
cd ../interscript-ts && npm ci && npm run build
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Type check
26+
run: npm run check
2427
- name: Build site
25-
run: |
26-
yarn adoc make
28+
run: npm run build
29+
- name: Upload artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: site
33+
path: dist

.github/workflows/deploy.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,14 @@ name: deploy
33
on:
44
push:
55
branches:
6-
- main
7-
# - staging
8-
pull_request:
6+
- main
97
workflow_dispatch:
10-
repository_dispatch:
11-
types: [ 'interscript/interscript' ]
128

13-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
149
permissions:
1510
contents: read
1611
pages: write
1712
id-token: write
1813

19-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2114
concurrency:
2215
group: ${{ github.workflow }}-${{ github.ref }}
2316
cancel-in-progress: false
@@ -34,21 +27,21 @@ jobs:
3427
- name: Use Node
3528
uses: actions/setup-node@v7
3629
with:
37-
node-version: '18'
38-
cache: yarn
39-
- name: Install NPM dependencies
30+
node-version: "22"
31+
cache: npm
32+
- name: Clone interscript-ts (file: dependency)
4033
run: |
41-
yarn install --frozen-lockfile
42-
yarn global add asciidoctor@^2.2.4
34+
git clone --depth=1 --branch feat/imf-runtime-ts https://github.com/interscript/interscript-ts.git ../interscript-ts
35+
cd ../interscript-ts && npm ci && npm run build
36+
- name: Install dependencies
37+
run: npm ci
4338
- name: Build site
44-
run: |
45-
yarn adoc make
39+
run: npm run build
4640
- name: Upload artifact
4741
uses: actions/upload-pages-artifact@v5
4842
with:
4943
path: dist
5044

51-
# Deployment job
5245
deploy:
5346
environment:
5447
name: github-pages

.gitignore

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
tmp
2-
artifacts
3-
node_modules
4-
dist
1+
# Build output
2+
dist/
3+
.astro/
4+
5+
# Dependencies
6+
node_modules/
7+
8+
# Logs
9+
*.log
10+
npm-debug.log*
11+
yarn-debug.log*
512
yarn-error.log
6-
.idea
7-
public/maps/**
8-
!public/maps/.gitkeep
9-
map/*
10-
!map/.gitkeep
13+
14+
# Environment
15+
.env
16+
.env.production
17+
18+
# Editor / OS
19+
.DS_Store
20+
.idea/
21+
.vscode/
22+
*.swp
23+
24+
# Legacy react-static (kept in _legacy-content for reference)
25+
test-results/
26+
playwright-report/

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Interscript.org v2
2+
3+
Astro 7 + Vite 8 + Tailwind 4 + Vue 3 islands. Uses `interscript-ts` for live map exploration.
4+
5+
## Status
6+
7+
🚧 **Under active development.** Replaces the legacy `interscript/interscript.github.io` react-static site once feature parity is reached.
8+
9+
## Stack
10+
11+
- **Astro 7** — static site framework
12+
- **Vite 8** — bundler
13+
- **Tailwind 4** — styling (CSS-first config via `@theme` in `src/styles/global.css`)
14+
- **Vue 3** — interactive islands (`@astrojs/vue`)
15+
- **TypeScript 5.6**`astro check` for type safety
16+
17+
## Development
18+
19+
```bash
20+
npm ci
21+
npm run dev # http://localhost:4321
22+
npm run build # outputs to dist/
23+
npm run preview # preview build locally
24+
```
25+
26+
## Project structure
27+
28+
```
29+
src/
30+
├── layouts/
31+
│ └── Base.astro # HTML shell, nav, footer
32+
├── components/
33+
│ └── MapExplorer.vue # Vue island: live transliteration
34+
├── pages/
35+
│ ├── index.astro # Home
36+
│ ├── maps/index.astro # Map explorer
37+
│ └── docs/index.astro # Docs hub
38+
└── styles/
39+
└── global.css # Tailwind import + theme tokens
40+
```
41+
42+
## Roadmap
43+
44+
See [TODO.complete](https://github.com/interscript/interscript/tree/main/TODO.complete) for the migration checklist from the legacy site.
45+
46+
## License
47+
48+
BSD-2-Clause — Ribose Inc.

TODO.complete/01-e2e-tests.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# 03 — E2E tests for interscript.org website
2+
3+
## Priority: P0
4+
5+
## Problem
6+
The website has integration tests (Vitest) that test individual modules,
7+
but no browser-based E2E tests that validate the actual user experience:
8+
loading pages, typing in transliteration inputs, seeing output.
9+
10+
## Solution: Playwright
11+
12+
### Setup
13+
```bash
14+
cd interscript.org
15+
npm install -D @playwright/test
16+
npx playwright install
17+
```
18+
19+
### Structure
20+
```
21+
e2e/
22+
playwright.config.ts
23+
home.spec.ts # Landing page loads, CTA works
24+
detect.spec.ts # Detect panel: input → system suggestion
25+
compare.spec.ts # Compare two systems side by side
26+
batch.spec.ts # Batch transliteration
27+
maps.spec.ts # Browse maps, search, filter
28+
api-docs.spec.ts # API documentation interactive
29+
worker.spec.ts # Web Worker loads and transliterates
30+
```
31+
32+
### Key Test Cases
33+
34+
#### Worker transliteration (critical path)
35+
```typescript
36+
test("worker transliterates Ukrainian", async ({ page }) => {
37+
await page.goto("/")
38+
const input = page.locator("[data-testid='translit-input']")
39+
const output = page.locator("[data-testid='translit-output']")
40+
await input.fill("Антон")
41+
await expect(output).toContainText("Anton")
42+
})
43+
```
44+
45+
#### Map browser
46+
```typescript
47+
test("browse maps by script", async ({ page }) => {
48+
await page.goto("/maps")
49+
await page.click("text=Cyrillic")
50+
await expect(page.locator(".map-card")).toHaveCount.greaterThan(10)
51+
})
52+
```
53+
54+
#### API playground
55+
```typescript
56+
test("API playground returns JSON", async ({ page }) => {
57+
await page.goto("/api")
58+
await page.fill("[data-testid='api-input']", '{"system":"bgnpcgn-ukr-Cyrl-Latn-2019","input":"Київ"}')
59+
await page.click("[data-testid='api-run']")
60+
await expect(page.locator("[data-testid='api-output']")).toContainText("Kyiv")
61+
})
62+
```
63+
64+
### CI Integration
65+
```yaml
66+
# .github/workflows/e2e.yml
67+
- name: Build site
68+
run: npm run build
69+
- name: Run Playwright
70+
run: npx playwright test
71+
- name: Upload report
72+
if: always()
73+
uses: actions/upload-artifact@v3
74+
with:
75+
name: playwright-report
76+
path: playwright-report/
77+
```
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
= Integration with Ruby Applications
2+
3+
Interscript can be used as a Ruby Gem library to be integrated with other Ruby
4+
applications.
5+
6+
== Gemfile
7+
8+
You need to make sure your Gemfile contains the following lines:
9+
10+
[source,ruby]
11+
----
12+
source "https://rubygems.org"
13+
14+
gem "interscript", "~>2.0"
15+
----
16+
17+
== Requiring
18+
19+
In your codebase, if you don't do `Bundler.require`, you will need to add the
20+
following line:
21+
22+
[source,ruby]
23+
----
24+
require "interscript"
25+
----
26+
27+
== Listing all available maps
28+
29+
To list all available maps, one must execute the following code:
30+
31+
[source,ruby]
32+
----
33+
maps = Interscript.maps
34+
----
35+
36+
`maps` will be an array containing all Interscript maps by their name.
37+
38+
== Transliterating text
39+
40+
To transliterate test using a given map, like `bas-rus-Cyrl-Latn-2017-bss`,
41+
one must execute:
42+
43+
[source,ruby]
44+
----
45+
cache = {}
46+
input = "Хелло"
47+
output = Interscript.transliterate("bas-rus-Cyrl-Latn-2017-bss",
48+
input,
49+
cache)
50+
----
51+
52+
You should preserve the `cache` variable for performance reasons. It is optional,
53+
you don't need to (but should) supply it.
54+
55+
=== Using Ruby compiler
56+
57+
If performance is of utmost performance for your application and you want to
58+
sacrifice a little bit of loading time for much better performance, you can use
59+
`Interscript::Compiler::Ruby` instead of `Interscript::Interpreter` (which is
60+
used by default).
61+
62+
[source,ruby]
63+
----
64+
require "interscript/compiler/ruby"
65+
66+
cache = {}
67+
input = "Хелло"
68+
output = Interscript.transliterate("bas-rus-Cyrl-Latn-2017-bss",
69+
input,
70+
cache,
71+
compiler: Interscript::Compiler::Ruby)
72+
----
73+
74+
=== Transliterating in reverse
75+
76+
To reverse a given string using a map with a name of a form:
77+
`bas-rus-Cyrl-Latn-2017-bss`, change places for Cyrl and Latn.
78+
79+
To reverse a given string using a map with a name of a form:
80+
`var-swe-Latn-Latn-2021`, append `-reverse` to its name.
81+
82+
Please note: this only works for Ruby implementation. Other implementations
83+
depend on the Ruby implementation for the purpose of compilation. For those,
84+
you need to compile the map using the Ruby implementation, but the name has
85+
to be given according to the above hint.

0 commit comments

Comments
 (0)