monorepo: [bug] Creating a project through the CLI fails

Problem

A lot has changed since our last discussions and the sad event that hit us a few weeks ago.
sdk-js is deprecated, the docs have changed, and the armageddon seems to have been merged.

I’m trying to upgrade my project to the newest Inlang, so I started by running pnpx @inlang/cli@latest project init. Sadly, it did not work, throwing the following error:

ℹ Could not auto generate project settings. Go to https://inlang.com/new to create a project.

I dug into the source code to figure out a possible cause, but all I could understand was what seemed to be a lot of abstractions over the creation of the project.inlang.json file.
So I switched to the manual creation following the docs, which led me from this:

/**
 * @type {import("@inlang/core/config").DefineConfig}
 */
export async function defineConfig(env) {
	const { default: pluginJson } = await env.$import(
		"https://cdn.jsdelivr.net/npm/@inlang/plugin-json@3/dist/index.js"
	);

	const { default: sdkPlugin } = await env.$import(
		"https://cdn.jsdelivr.net/npm/@inlang/sdk-js-plugin@0.11.8/dist/index.js"
	);

	const { default: standardLintRules } = await env.$import(
		"https://cdn.jsdelivr.net/npm/@inlang/plugin-standard-lint-rules@3/dist/index.js"
	);

	return {
		referenceLanguage: "en",
		plugins: [
			pluginJson({
				pathPattern: "./src/locales/{language}/*.json",
				variableReferencePattern: ["{", "}"]
			}),
			sdkPlugin({
				languageNegotiation: {
					strategies: [{ type: "localStorage" }]
				}
			}),
			standardLintRules()
		]
	};
}

to that:

{
	"$schema": "https://inlang.com/project-config-schema",
	"sourceLanguageTag": "en",
	"languageTags": ["en", "fr"],
	"modules": ["https://cdn.jsdelivr.net/npm/@inlang/plugin-json@4/dist/index.js"],
	"settings": {
		"plugin.inlang.json": {
			"pathPattern": "./src/locales/{languageTag}/*.json"
		}
	}
}

As far as I could tell, the sdk-js replacement is coming soon as paraglide-js, so I guess I cannot fully migrate for now.
As for the standardLintRules, I couldn’t find anything in the marketplace.

A second issue, introduced with this new config, is the fact that the schema link is a 404 page, so it’s not really helpful unfortunately 😕

Lastly, it would be great to have a dedicated Migration page in the docs, in order to explain in a few lines what’s changed from the pre-armageddon Inlang (about sdk-js deprecation - which you could link in the npmjs.org deprecation message, the new config, what’s gone, what’s new, how is it better, etc)

Good luck with the rest - Paraglide!

Expected behavior

  • The CLI’s project init command to work
    • Or at least the error to be more meaningful instead of redirecting to a inlang.com/new that does not exist, maybe suggesting to manually create that config file?
  • The docs to explain what this project init command is supposed to do (more than creating the config file?)
  • The JSON schema link to be valid
  • The sdk-js not to be deprecated if paraglide-js is not ready yet? Can I use Inlang without paraglide?
  • The docs to potentially include a Migration page
  • And what do I do for standardLintRules?

Reproduction

Follow the docs

Other information

macOS 14.0, Node.js 20.8.0, project link

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 24 (24 by maintainers)

Commits related to this issue

Most upvoted comments

Hey @WarningImHack3r,

Thank you for the elaborate issue.

Stay on the SDK-JS for another week or so. Paraglide is nearing completion.

  • remove “manually creating a project” from the documentation as setting up a project is app specific.
  • remove “inlang project init” from CLI for a similar reason

I thought this repo was “special” (hence the 30s wait)

Haha, I see 😄 We are working on lazy fetching of the translation files (https://github.com/inlang/monorepo/issues/1459). Until then, a repository only needs a few MBs to be “special” as we are currently cloning the entire repository.

Thank you for your patience 😃 ❤️

@WarningImHack3r via https://inlang.com/editor/github.com/inlang/monorepo

  1. sign in with your github account
  2. ignore the can’t access the repo for 30 seconds after signing in
  3. add a language in top right corner

the rest should be self-explanatory. if not, please open an issue(s)

Hi @WarningImHack3r,

As a matter of fact, yes. Inlang.com would welcome a french translation.

What about paraglide-js? Is the pre-release ready to replace sdk-js?

Ready but a bit of manual boilerplate needs to be written and there will be slight change today. We will announce Paraglide JS at the Svelte Summit on Nov 11. If you can wait, wait for the 11th! 😃