@flutterlocalisation/cli 0.0.0-stage → 1.23.1
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.
- package/README.md +23 -2
- package/bin/fl.js +3 -0
- package/bin/fl_mcp.js +3 -0
- package/bin/launch.js +40 -0
- package/package.json +39 -4
- package/targets.json +7 -0
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @flutterlocalisation/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `fl` command and the `fl_mcp` MCP server of [FlutterLocalisation](https://flutterlocalisation.com),
|
|
4
|
+
for Flutter, iOS and Angular apps, as native binaries. No Dart needed.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install --save-dev @flutterlocalisation/cli
|
|
8
|
+
npx fl init # API key, project, folders
|
|
9
|
+
npx fl pull # translated files into the repo
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
In an Angular app, `ng add @flutterlocalisation/angular` installs this package and sets up
|
|
13
|
+
`@angular/localize` for you.
|
|
14
|
+
|
|
15
|
+
MCP clients (Claude, GitHub Copilot) start the server with:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{ "command": "npx", "args": ["-y", "--package", "@flutterlocalisation/cli", "fl_mcp"], "env": { "FL_API_TOKEN": "flk_live_..." } }
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
npm installs the one binary package that matches the machine
|
|
22
|
+
(`@flutterlocalisation/cli-darwin-arm64`, `-darwin-x64`, `-linux-x64`, `-linux-arm64`,
|
|
23
|
+
`-win32-x64`). The same commands come with Dart: `dart pub global activate flutter_localisation_cli`.
|
|
24
|
+
Full documentation: https://pub.dev/packages/flutter_localisation_cli
|
package/bin/fl.js
ADDED
package/bin/fl_mcp.js
ADDED
package/bin/launch.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Runs the native `fl` or `fl_mcp` binary that npm installed for this
|
|
3
|
+
// machine as one of the optional @flutterlocalisation/cli-<os>-<cpu>
|
|
4
|
+
// packages (the esbuild pattern: no download at install time, no Dart).
|
|
5
|
+
const { spawnSync } = require('node:child_process');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
|
|
8
|
+
const targets = require('../targets.json');
|
|
9
|
+
|
|
10
|
+
function binaryPath(name) {
|
|
11
|
+
if (process.env.FL_BINARY_DIR) {
|
|
12
|
+
return path.join(process.env.FL_BINARY_DIR, name + (process.platform === 'win32' ? '.exe' : ''));
|
|
13
|
+
}
|
|
14
|
+
const target = targets.find(t => t.os === process.platform && t.cpu === process.arch);
|
|
15
|
+
if (!target) {
|
|
16
|
+
fail(`No ${name} binary is published for ${process.platform}-${process.arch}.`);
|
|
17
|
+
}
|
|
18
|
+
const pkg = `@flutterlocalisation/cli-${target.os}-${target.cpu}`;
|
|
19
|
+
const file = `bin/${name}${target.os === 'win32' ? '.exe' : ''}`;
|
|
20
|
+
try {
|
|
21
|
+
return require.resolve(`${pkg}/${file}`);
|
|
22
|
+
} catch {
|
|
23
|
+
fail(`${pkg} is not installed. It is an optional dependency of @flutterlocalisation/cli; ` +
|
|
24
|
+
'reinstall without --no-optional / --omit=optional.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function fail(message) {
|
|
29
|
+
console.error(`${message}\nThe same commands come with Dart: dart pub global activate flutter_localisation_cli`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = function launch(name) {
|
|
34
|
+
const result = spawnSync(binaryPath(name), process.argv.slice(2), {
|
|
35
|
+
stdio: 'inherit',
|
|
36
|
+
env: { ...process.env, FL_INSTALLED_BY: 'npm' },
|
|
37
|
+
});
|
|
38
|
+
if (result.error) fail(`Could not start ${name}: ${result.error.message}`);
|
|
39
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flutterlocalisation/cli",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "The fl command and the fl_mcp MCP server of FlutterLocalisation, for Flutter, iOS and Angular apps. No Dart needed.",
|
|
4
|
+
"version": "1.23.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://flutterlocalisation.com",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/tajaouart/flutter_localisation_cli"
|
|
10
|
+
},
|
|
11
|
+
"author": "Aylan Technologies LLC",
|
|
12
|
+
"bin": {
|
|
13
|
+
"fl": "bin/fl.js",
|
|
14
|
+
"fl_mcp": "bin/fl_mcp.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin",
|
|
18
|
+
"targets.json",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@flutterlocalisation/cli-darwin-arm64": "1.23.1",
|
|
26
|
+
"@flutterlocalisation/cli-darwin-x64": "1.23.1",
|
|
27
|
+
"@flutterlocalisation/cli-linux-x64": "1.23.1",
|
|
28
|
+
"@flutterlocalisation/cli-linux-arm64": "1.23.1",
|
|
29
|
+
"@flutterlocalisation/cli-win32-x64": "1.23.1"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"i18n",
|
|
33
|
+
"l10n",
|
|
34
|
+
"localization",
|
|
35
|
+
"translation",
|
|
36
|
+
"angular",
|
|
37
|
+
"flutter",
|
|
38
|
+
"arb",
|
|
39
|
+
"mcp"
|
|
40
|
+
]
|
|
41
|
+
}
|
package/targets.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "os": "darwin", "cpu": "arm64", "runner": "macos-15" },
|
|
3
|
+
{ "os": "darwin", "cpu": "x64", "runner": "macos-15-intel" },
|
|
4
|
+
{ "os": "linux", "cpu": "x64", "runner": "ubuntu-latest" },
|
|
5
|
+
{ "os": "linux", "cpu": "arm64", "runner": "ubuntu-24.04-arm" },
|
|
6
|
+
{ "os": "win32", "cpu": "x64", "runner": "windows-latest" }
|
|
7
|
+
]
|