Skip to content

Commit

Permalink
maintenance: remove vite in favor of tsc to build paraglide js lib
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelstroschein committed Dec 25, 2024
1 parent 07007e2 commit 44ac447
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 486 deletions.
14 changes: 14 additions & 0 deletions .changeset/spicy-bottles-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@inlang/paraglide-js": minor
---

maintenance: remove vite in favor of tsc to build paraglide js lib

Closes https://github.com/opral/inlang-paraglide-js/issues/208

```diff
- "build": "vite build",
+ "build": "tsc",
```

Paraglide JS used vite to build the library. This change removes vite in favor of tsc to build the library. This change is made to simplify the build process and to make it easier to maintain the library in the future.
7 changes: 2 additions & 5 deletions packages/inlang-paraglide-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"./default"
],
"scripts": {
"dev": "vite build --mode development --watch",
"build": "npm run env-variables && vite build --mode production",
"dev": "tsc --watch",
"build": "npm run env-variables && tsc --build",
"test": "tsc --noEmit && vitest run --coverage ./src/**/*",
"test:watch": "vitest --watch ./src/**/*",
"env-variables": "node ./src/services/env-variables/createIndexFile.js",
Expand Down Expand Up @@ -74,9 +74,6 @@
"memfs": "4.6.0",
"rollup": "3.29.1",
"typescript": "^5.5.2",
"vite": "^4.5.2",
"vite-plugin-dts": "^3.8.1",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "2.0.5"
},
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions packages/inlang-paraglide-js/src/compiler/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { compileBundle, type Resource } from "./compileBundle.js";
import { jsIdentifier } from "../services/codegen/identifier.js";
import { createRuntime } from "./runtime.js";
import { createRegistry, DEFAULT_REGISTRY } from "./registry.js";
import { lookup } from "~/services/lookup.js";
import { type BundleNested, type ProjectSettings } from "@inlang/sdk";
import * as prettier from "prettier";
import { escapeForSingleQuoteString } from "~/services/codegen/escape.js";
import { escapeForSingleQuoteString } from "../services/codegen/escape.js";
import { lookup } from "../services/lookup.js";

const ignoreDirectory = `# ignore everything because the directory is auto-generated by inlang paraglide-js
# for more info visit https://inlang.com/m/gerre34r/paraglide-js
Expand Down
6 changes: 3 additions & 3 deletions packages/inlang-paraglide-js/src/compiler/compileBundle.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Bundle, BundleNested, Message } from "@inlang/sdk";
import { compileMessage } from "./compileMessage.js";
import type { Registry } from "./registry.js";
import { jsIdentifier } from "~/services/codegen/identifier.js";
import { isValidJSIdentifier } from "~/services/valid-js-identifier/index.js";
import { escapeForDoubleQuoteString } from "~/services/codegen/escape.js";
import { jsIdentifier } from "../services/codegen/identifier.js";
import { isValidJSIdentifier } from "../services/valid-js-identifier/index.js";
import { escapeForDoubleQuoteString } from "../services/codegen/escape.js";
import type { Compiled } from "./types.js";
import { jsDocBundleComment, jsDocMessageComment } from "./jsDocComment.js";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Declaration, Message, Variant } from "@inlang/sdk";
import type { Registry } from "./registry.js";
import { compilePattern } from "./compilePattern.js";
import { doubleQuote } from "~/services/codegen/quotes.js";
import type { Compiled } from "./types.js";
import { doubleQuote } from "../services/codegen/quotes.js";

/**
* Returns the compiled message as a string
Expand Down
50 changes: 0 additions & 50 deletions packages/inlang-paraglide-js/vite.config.js

This file was deleted.

Loading

0 comments on commit 44ac447

Please sign in to comment.