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 initcommand 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 initcommand is supposed to do (more than creating the config file?) - The JSON schema link to be valid
- The
sdk-jsnot to be deprecated ifparaglide-jsis not ready yet? Can I use Inlang without paraglide? - The docs to potentially include a
Migrationpage - 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
- #1448 fix schema url in docs — committed to opral/monorepo by felixhaeberle 9 months ago
- improve: delete manually creating a project De-facto can a project not be manually created. The project settings are app/library/plugin specific. Stating that a project can be manually created is mis... — committed to opral/monorepo by samuelstroschein 9 months ago
- refactor: remove `project init` command De-facto can a project not be manually created. The project settings are app/library/plugin specific. Stating that a project can be manually created is mislead... — committed to opral/monorepo by samuelstroschein 9 months ago
- #1448 remove `project init` from website & blogs — committed to opral/monorepo by felixhaeberle 9 months ago
- #1448 add $schema to Getting Started — committed to opral/monorepo by felixhaeberle 9 months ago
Hey @WarningImHack3r,
Thank you for the elaborate issue.
Stay on the SDK-JS for another week or so. Paraglide is nearing completion.
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
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.
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! 😃
Added the
$schemato https://inlang.com/documentation/project