Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ https://securetoken.google.com/
file:///home/runner/work/solidui/solidui/lib/src/utils/scheme
https://pods.example.au/john-doe/profile/card#me
https://github.com/gjwgit/myapp/blob/main/README.md
https://github.com/anusii/solidpod/blob/main/solidpodeg/README.md
https://server/POD_NAME/APP_NAME/data/FILE_PATH

# 20260605 gjw Failing solid servers

Expand Down
2 changes: 2 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ARCHIVE
ignore
pubspec.yaml.*

!templates/solidpod/pubspec.yaml.tmpl

.flutter-plugins*

qtest_*.txt
Expand Down
62 changes: 57 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,71 @@ of a `flutter create --template=solidpod`, which stock Flutter cannot offer
because the `--template` flag only accepts a fixed set of built-in types. We
provide a small generator instead.

From any checkout that depends on `solidpod`:
The recommended way is to activate the generator once and then run it from any
directory:

```bash
dart run solidpod:create my_pod_app
flutter pub global activate solidpod
solidpod create my_pod_app
```

Or activate it once and use it anywhere:
Alternatively, `dart run solidpod:create` works **only from within a package
that already depends on `solidpod`** (for example a clone of the `solidpod`
repository), because `dart run` must resolve the `solidpod:create` executable
through that project's `pubspec.yaml`:

```bash
flutter pub global activate solidpod
solidpod create my_pod_app
dart run solidpod:create my_pod_app
```

Running `dart run solidpod:create` from an unrelated directory fails with
`Found no pubspec.yaml file in <folder> or parent directories` — use the global
activation above instead.

### Running from a local checkout (before publishing)

If you are working on a branch of `solidpod` that is not yet published to
pub.dev, you can still generate an app from any directory without publishing.
Replace `/path/to/solidpod` below with the path to your local checkout.

- Run the generator script directly. This always uses your current working tree
— both `bin/create.dart` and the template files — so it picks up your edits
on every run:

```bash
dart run /path/to/solidpod/bin/create.dart my_pod_app
```

- Or activate the local checkout and use the short `solidpod create` command
anywhere:

```bash
flutter pub global activate --source path /path/to/solidpod
solidpod create my_pod_app
```

Note that this takes a snapshot of `bin/create.dart`, so re-run the
`activate` command after editing the generator itself; edits to the template
files are picked up without re-activating.

For Windows users, command `solidpod` can be added to the system by the
following steps:

- Run **PowerShell**
- Run the following commands:

```shell
$pubCacheBin = "$env:LOCALAPPDATA\Pub\Cache\bin"
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")

if ($userPath -notlike "*$pubCacheBin*") {
[Environment]::SetEnvironmentVariable("Path", "$userPath;$pubCacheBin", "User")
}
```

- Close **Powershell**
- Open **Command Prompter** or **PowerShell** and use `solidpod` command.

The generator runs `flutter create` to lay down the platform folders, overlays
the template (substituting your app name), and runs `flutter pub get`. Useful
options:
Expand Down
18 changes: 14 additions & 4 deletions bin/create.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ Future<void> main(List<String> arguments) async {
await _runProcess('flutter', ['pub', 'get'], outputDir.path);
}

_printNextSteps(stdout, outputDir.path, runFlutterCreate: args.runFlutterCreate);
_printNextSteps(
stdout,
outputDir.path,
runFlutterCreate: args.runFlutterCreate,
);
}

// ── Template rendering ─────────────────────────────────────────────────────
Expand Down Expand Up @@ -284,7 +288,8 @@ void _patchAndroidRedirectScheme(Directory output, String scheme) {
if (content.contains(placeholder)) return;
final patched = content.replaceFirstMapped(
RegExp(r'versionName flutterVersionName\n'),
(m) => '${m[0]} manifestPlaceholders = [$placeholder: "$scheme"]\n',
(m) =>
'${m[0]} manifestPlaceholders = [$placeholder: "$scheme"]\n',
);
if (patched != content) {
groovy.writeAsStringSync(patched);
Expand Down Expand Up @@ -403,7 +408,8 @@ Future<bool> _runProcess(
);
final code = await process.exitCode;
if (code != 0) {
stderr.writeln('Error: `$executable ${args.join(' ')}` exited with $code.');
stderr
.writeln('Error: `$executable ${args.join(' ')}` exited with $code.');
return false;
}
return true;
Expand Down Expand Up @@ -563,7 +569,11 @@ Example:
''');
}

void _printNextSteps(IOSink out, String path, {required bool runFlutterCreate}) {
void _printNextSteps(
IOSink out,
String path, {
required bool runFlutterCreate,
}) {
out.writeln('''

Done! Your Solid Pod app is ready in $path/
Expand Down
Loading