@inlang/paraglide-js 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +43 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -29398,6 +29398,13 @@ var version = (() => {
29398
29398
  import dedent2 from "dedent";
29399
29399
  import nodeFsPromises2 from "node:fs/promises";
29400
29400
  var DEFAULT_PROJECT_PATH = "./project.inlang";
29401
+ var ADAPTER_LINKS = {
29402
+ sveltekit: "https://inlang.com/m/dxnzrydw/library-inlang-paraglideJsAdapterSvelteKit",
29403
+ nextjs: "https://inlang.com/m/osslbuzt/library-inlang-paraglideJsAdapterNextJs",
29404
+ astro: "https://inlang.com/m/iljlwzfs/library-inlang-paraglideJsAdapterAstro",
29405
+ solidstart: "https://inlang.com/m/n860p17j/library-inlang-paraglideJsAdapterSolidStart",
29406
+ vite: "https://github.com/opral/monorepo/tree/main/inlang/source-code/paraglide/paraglide-js-adapter-vite"
29407
+ };
29401
29408
  var initCommand = new Command2().name("init").summary("Initializes inlang Paraglide-JS.").action(async () => {
29402
29409
  const repoRoot = await findRepoRoot({
29403
29410
  nodeishFs: nodeFsPromises2,
@@ -29426,17 +29433,32 @@ var initCommand = new Command2().name("init").summary("Initializes inlang Paragl
29426
29433
  telemetry.capture({ event: "PARAGLIDE-JS init finished" });
29427
29434
  const absoluteSettingsPath = resolve2(projectPath, "settings.json");
29428
29435
  const relativeSettingsFilePath = absoluteSettingsPath.replace(process.cwd(), ".");
29429
- ctx.logger.box(
29430
- dedent2`inlang Paraglide-JS has been set up sucessfully.
29436
+ let successMessage = dedent2`inlang Paraglide-JS has been set up sucessfully.
29431
29437
 
29432
29438
  1. Run your install command (npm i, yarn install, etc)
29433
29439
  2. Register all your languages in ${relativeSettingsFilePath}
29434
29440
  3. Run the build script (npm run build, or similar.)
29435
29441
  4. Done :) Happy paragliding 🪂
29436
29442
 
29443
+ `;
29444
+ const stackChoice = await promtStack();
29445
+ if (Object.keys(ADAPTER_LINKS).includes(stackChoice)) {
29446
+ successMessage += "\n\n";
29447
+ successMessage += dedent2`
29448
+ HINT:
29449
+ If you are using ${stackChoice} with paraglide, you will likely also want to use
29450
+
29451
+ \`@inlang/paraglide-js-adapter-${stackChoice}\`
29452
+
29453
+ Read the documentation at:
29454
+ ${ADAPTER_LINKS[stackChoice]}
29455
+ `;
29456
+ }
29457
+ successMessage += "\n\n";
29458
+ successMessage += dedent2`
29437
29459
  For questions and feedback, visit https://github.com/inlang/monorepo/discussions.
29438
- `
29439
- );
29460
+ `;
29461
+ ctx.logger.box(successMessage);
29440
29462
  });
29441
29463
  var initializeInlangProject = async (ctx) => {
29442
29464
  const existingProjectPath = await findExistingInlangProjectPath(ctx);
@@ -29776,6 +29798,23 @@ var maybeChangeTsConfigAllowJs = async (ctx) => {
29776
29798
  }
29777
29799
  }
29778
29800
  };
29801
+ async function promtStack() {
29802
+ return await promptSelection("Which tech stack are you using?", {
29803
+ options: [
29804
+ { label: "Other", value: "other" },
29805
+ { label: "Vanilla", value: "vanilla" },
29806
+ { label: "NextJS", value: "nextjs" },
29807
+ { label: "SvelteKit", value: "sveltekit" },
29808
+ { label: "Astro", value: "astro" },
29809
+ { label: "SolidStart", value: "solidstart" },
29810
+ { label: "Vite", value: "vite" }
29811
+ ],
29812
+ initial: "other"
29813
+ });
29814
+ }
29815
+ var promptSelection = async (message, options = { options: [] }) => {
29816
+ return prompt(message, { type: "select", ...options });
29817
+ };
29779
29818
  var prompt = async (message, options) => {
29780
29819
  const response = await consola2.prompt(message, options);
29781
29820
  if ((response == null ? void 0 : response.toString()) === "Symbol(clack:cancel)") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inlang/paraglide-js",
3
3
  "type": "module",
4
- "version": "1.2.7",
4
+ "version": "1.2.8",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -65,9 +65,9 @@
65
65
  "vitest": "0.34.3",
66
66
  "@inlang/env-variables": "0.2.0",
67
67
  "@inlang/sdk": "0.26.5",
68
- "@inlang/telemetry": "0.3.13",
69
- "@inlang/language-tag": "1.5.1",
70
68
  "@lix-js/client": "0.8.0",
69
+ "@inlang/language-tag": "1.5.1",
70
+ "@inlang/telemetry": "0.3.13",
71
71
  "@lix-js/fs": "0.6.0",
72
72
  "@inlang/plugin-message-format": "2.1.0"
73
73
  },