Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
with:
node-version: "22"
cache: npm
- name: Clone interscript-ts (file dependency)
run: |
git clone --depth=1 --branch main https://github.com/interscript/interscript-ts.git ../interscript-ts
cd ../interscript-ts && npm ci && npm run build
- name: Install dependencies
run: npm ci
- name: Type check
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
with:
node-version: "22"
cache: npm
- name: Clone interscript-ts (file dependency)
run: |
git clone --depth=1 --branch main https://github.com/interscript/interscript-ts.git ../interscript-ts
cd ../interscript-ts && npm ci && npm run build
- name: Install dependencies
run: npm ci
- name: Build site
Expand Down
54 changes: 48 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@iso24229/iso639-data": "^0.2.0",
"@tailwindcss/vite": "^4.0.0",
"astro": "^7.0.0",
"interscript-ts": "file:../interscript-ts",
"tailwindcss": "^4.0.0",
"vue": "^3.5.0"
"vue": "^3.5.0",
"interscript": "^3.0.0"
},
"devDependencies": {
"@astrojs/check": "^0.9.10",
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-catalogue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { readFileSync, readdirSync, writeFileSync } from "node:fs"
import { join, resolve, dirname } from "node:path"
import { fileURLToPath } from "node:url"
import { parseIsc } from "interscript-ts"
import { parseIsc } from "interscript"

const __dirname = dirname(fileURLToPath(import.meta.url))
const ROOT = resolve(__dirname, "..")
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeroMorph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ let transliterateFn: ((code: string, input: string) => string) | null = null
async function ensureEngine() {
if (transliterateFn) return
try {
const mod = await import("interscript-ts")
const mod = await import("interscript")
const wanted = new Set<string>(morphs.map((m) => m.system))
const maps: Record<string, unknown> = {}
const fetchOne = async (code: string) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/MapPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function ensureEngine() {
}
engine.value = "loading"
try {
const mod = await import("interscript-ts")
const mod = await import("interscript")
// Fetch this system + its transitive deps. import.meta.glob can't
// see public/ files in dev.
const wanted = new Set<string>([props.systemCode])
Expand Down Expand Up @@ -96,7 +96,7 @@ gem install interscript
interscript -s {{ systemCode }} input.txt

# TypeScript (after npm install interscript-ts)
import {{ '{' }} transliterate {{ '}' }} from "interscript-ts"
import {{ '{' }} transliterate {{ '}' }} from "interscript"
transliterate("{{ systemCode }}", "your input")</code></pre>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/QuickBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let transliterateFn: ((code: string, input: string) => string) | null = null
async function ensureEngine() {
if (transliterateFn) return
try {
const mod = await import("interscript-ts")
const mod = await import("interscript")
const wanted = new Set<string>(systems.map((s) => s.code))
const sources: Record<string, string> = {}
const libJsons: Record<string, unknown> = {}
Expand Down
2 changes: 1 addition & 1 deletion src/components/RuleViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ onMounted(async () => {
const res = await fetch(`/maps/${props.systemCode}.isc`)
if (!res.ok) throw new Error(`HTTP ${res.status}`)
const text = await res.text()
const mod = await import("interscript-ts")
const mod = await import("interscript")
const doc = mod.parseIsc(text, `${props.systemCode}.isc`)
stages.value = doc.stages.map((s) => ({
name: s.name,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScriptMosaic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ let transliterateFn: ((code: string, input: string) => string) | null = null
async function ensureEngine() {
if (transliterateFn) return
try {
const mod = await import("interscript-ts")
const mod = await import("interscript")
// Collect every system code referenced by the mosaic, plus their
// transitive dependencies. fetch() each one — import.meta.glob
// doesn't see files under public/ in dev.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/server-map-strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
import { readFileSync } from "node:fs"
import { resolve } from "node:path"
import { iscStrategy, type LoadStrategy } from "interscript-ts"
import { filesystemStrategy } from "interscript-ts/loaders.node"
import { iscStrategy, type LoadStrategy } from "interscript"
import { filesystemStrategy } from "interscript/loaders.node"

const MAPS_DIR = resolve(process.cwd(), "public/maps")

Expand Down
6 changes: 3 additions & 3 deletions src/pages/api.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ curl -G 'https://interscript.org/api/transliterate' \\
<span class="runtime-badge">TypeScript / JavaScript</span>
<h3>npm</h3>
</header>
<pre><code>npm install interscript-ts</code></pre>
<pre><code set:html={`import { transliterate } from "interscript-ts"
<pre><code>npm install interscript</code></pre>
<pre><code set:html={`import { transliterate } from "interscript"

const out = transliterate(
"bgnpcgn-ukr-Cyrl-Latn-2019",
Expand Down Expand Up @@ -84,7 +84,7 @@ out = Interscript.transliterate(
<span class="runtime-badge">Browser</span>
<h3>CDN</h3>
</header>
<pre><code>npm install interscript-ts
<pre><code>npm install interscript
# or: https://esm.sh/interscript-ts</code></pre>
<pre><code set:html={`import {
transliterateAsync,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/api/transliterate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
reset,
transliterateAsync,
// filesystemStrategy is server-only (node:fs) — import directly.
} from "interscript-ts"
} from "interscript"
import { serverMapStrategies } from "../../lib/server-map-strategies"
import { MapNotFoundError, InterscriptError } from "interscript-ts"
import { MapNotFoundError, InterscriptError } from "interscript"

export const prerender = false

Expand Down
4 changes: 2 additions & 2 deletions src/pages/api/transliterate/batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*/

import type { APIRoute } from "astro"
import { configure, reset, transliterateAsync } from "interscript-ts"
import { configure, reset, transliterateAsync } from "interscript"
import { serverMapStrategies } from "../../../lib/server-map-strategies"
import { MapNotFoundError, InterscriptError } from "interscript-ts"
import { MapNotFoundError, InterscriptError } from "interscript"

export const prerender = false

Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interscript -s bgnpcgn-ukr-Cyrl-Latn-2019 &lt;&lt;&lt; "Антон"
<div class="tile card">
<h3>TypeScript</h3>
<pre><code>npm install interscript-ts</code></pre>
<pre><code>import &#123; transliterate &#125; from "interscript-ts"
<pre><code>import &#123; transliterate &#125; from "interscript"
transliterate("bgnpcgn-ukr-Cyrl-Latn-2019", "Антон")
// =&gt; "Anton"</code></pre>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/api-playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* type input, see output, and copy the equivalent curl/JS/Ruby call.
*/

import { configure, reset, transliterateAsync, httpStrategy } from "interscript-ts"
import { configure, reset, transliterateAsync, httpStrategy } from "interscript"

interface System {
code: string
Expand Down Expand Up @@ -42,7 +42,7 @@ const state: State = {
}

function snippetJs(s: State): string {
return `import { transliterate } from "interscript-ts"
return `import { transliterate } from "interscript"

const result = transliterate(
"${s.system}",
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/map-strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* the .iml libraries (posix, unicode, var-Cyrl, var-kor), which have
* no ISC form — maps depending on them would otherwise fail to load.
*/
import { httpStrategy, iscStrategy, type LoadStrategy } from "interscript-ts"
import { httpStrategy, iscStrategy, type LoadStrategy } from "interscript"

export function mapStrategies(): LoadStrategy[] {
return [
Expand Down
8 changes: 1 addition & 7 deletions src/scripts/transliteration-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
* `new Worker(new URL('./transliteration-worker.ts', import.meta.url), { type: 'module' })`.
*/

import {
configure,
reset,
transliterateAsync,
loadMapAsync,
type LoadStrategy,
} from "interscript-ts"
import { configure, reset, transliterateAsync, loadMapAsync, type LoadStrategy } from "interscript"
import { mapStrategies } from "./map-strategies"

interface RpcRequest {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* no full catalogue bundle, no main-thread jank.
*/

import { configure, reset, transliterateAsync } from "interscript-ts"
import { configure, reset, transliterateAsync } from "interscript"
import { mapStrategies } from "./map-strategies"

// Configure once with HTTP loader + persistent cache.
Expand Down
2 changes: 1 addition & 1 deletion test/catalogue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { describe, it, expect, vi } from "vitest"
import { mount } from "@vue/test-utils"
import MapCatalogue from "../src/components/MapCatalogue.vue"

vi.mock("interscript-ts", () => ({
vi.mock("interscript", () => ({
reset: vi.fn(),
configure: vi.fn(),
transliterate: vi.fn(),
Expand Down
2 changes: 1 addition & 1 deletion test/components.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import QuickBox from "../src/components/QuickBox.vue"

// Mock the dynamic import of interscript-ts so tests don't need
// Vite's import.meta.glob polyfill.
vi.mock("interscript-ts", () => ({
vi.mock("interscript", () => ({
reset: vi.fn(),
configure: vi.fn(),
transliterate: vi.fn((code: string, input: string) => `[${code}]${input}`),
Expand Down
2 changes: 1 addition & 1 deletion test/full-map-validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
parseIsc,
iscBundledStrategy,
bundledStrategy,
} from "interscript-ts"
} from "interscript"

const MAPS_DIR = resolve(process.cwd(), "public/maps")

Expand Down
2 changes: 1 addition & 1 deletion test/maps-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
parseIsc,
iscBundledStrategy,
type IscDocument,
} from "interscript-ts"
} from "interscript"

const MAPS_DIR = resolve(process.cwd(), "public/maps")

Expand Down
4 changes: 2 additions & 2 deletions test/script-mosaic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { mount } from "@vue/test-utils"
import ScriptMosaic from "../src/components/ScriptMosaic.vue"

// Mock the dynamic import of interscript-ts
vi.mock("interscript-ts", () => ({
vi.mock("interscript", () => ({
reset: vi.fn(),
configure: vi.fn(),
transliterate: vi.fn((code: string, input: string) => `[${code}]${input}`),
Expand Down Expand Up @@ -125,7 +125,7 @@ describe("ScriptMosaic", () => {

it("shows engine load failure state when interscript-ts throws", async () => {
// Re-mock with a failing import
vi.doMock("interscript-ts", () => {
vi.doMock("interscript", () => {
throw new Error("simulated failure")
})

Expand Down
2 changes: 1 addition & 1 deletion test/site.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe("demo page", () => {
const demo = readHtml("demo/index.html")

it("mentions interscript-ts", () => {
expect(demo).toMatch(/interscript-ts/)
expect(demo).toMatch(/interscript/)
})

it("includes the MapExplorer island", () => {
Expand Down
Loading