@legendapp/create-spark 0.0.1-next.5 → 0.0.1-next.7
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
CHANGED
|
@@ -9,9 +9,27 @@ cd MyApp
|
|
|
9
9
|
npm run macos
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
Choose a channel explicitly with any supported package manager:
|
|
13
|
+
|
|
14
|
+
| Manager | Next preview | Latest |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| npm | `npm create @legendapp/spark@next MyApp -- --next` | `npm create @legendapp/spark@latest MyApp -- --latest` |
|
|
17
|
+
| Bun | `bun create @legendapp/spark@next MyApp --next` | `bun create @legendapp/spark@latest MyApp --latest` |
|
|
18
|
+
| pnpm | `pnpm create @legendapp/spark MyApp --next` | `pnpm create @legendapp/spark MyApp --latest` |
|
|
19
|
+
| Yarn (including Yarn 1) | `yarn create @legendapp/spark MyApp --next` | `yarn create @legendapp/spark MyApp --latest` |
|
|
20
|
+
|
|
21
|
+
pnpm can drop the creator tag, and Yarn 1 cannot take a tag in `yarn create`.
|
|
22
|
+
The self-contained creator resolves explicit channel flags through npm dist-tags.
|
|
23
|
+
It pins the SDK to its bundled release metadata. If the selected version differs,
|
|
24
|
+
it prints an exact `npx @legendapp/create-spark@<version>` command to run; version
|
|
25
|
+
selection downloads no SDK. `--spark-version <version|tag>` selects another release;
|
|
26
|
+
use only one selection flag. With no flag, the creator uses its own release.
|
|
27
|
+
These commands require the matching creator and release assets to be published.
|
|
28
|
+
|
|
12
29
|
The app opens in Spark Runner, downloaded from the matching GitHub release.
|
|
13
30
|
Bun is optional. Select another installed package manager with
|
|
14
|
-
`-- --package-manager bun|pnpm|yarn
|
|
31
|
+
`-- --package-manager bun|pnpm|yarn` with npm, or
|
|
32
|
+
`--package-manager npm|bun|pnpm|yarn` with other managers. Native builds require Xcode and CocoaPods.
|
|
15
33
|
|
|
16
34
|
Spark is experimental. Windows is a preview without a downloadable Runner.
|
|
17
35
|
See the [documentation](https://legend.so/spark) and
|
package/dist/index.js
CHANGED
|
@@ -174418,7 +174418,7 @@ var import_spark_window_options = __toESM(require_window_options(), 1);
|
|
|
174418
174418
|
var import_native_patches = __toESM(require_native_patches(), 1);
|
|
174419
174419
|
var import_config3 = __toESM(require_config(), 1);
|
|
174420
174420
|
import { createHash as createHash2 } from "node:crypto";
|
|
174421
|
-
var VERSION2 = "0.0.1-next.
|
|
174421
|
+
var VERSION2 = "0.0.1-next.7";
|
|
174422
174422
|
function digest(value) {
|
|
174423
174423
|
return createHash2("sha256").update(value).digest("hex");
|
|
174424
174424
|
}
|
|
@@ -174667,14 +174667,64 @@ async function create(root, archiveManifest, platform = hostPlatform(), universa
|
|
|
174667
174667
|
|
|
174668
174668
|
// packages/create-spark/src/create.ts
|
|
174669
174669
|
import path13 from "node:path";
|
|
174670
|
+
|
|
174671
|
+
// packages/create-spark/src/version.ts
|
|
174672
|
+
function creatorArguments(args) {
|
|
174673
|
+
const forwarded = [];
|
|
174674
|
+
let requested;
|
|
174675
|
+
for (let index = 0;index < args.length; index++) {
|
|
174676
|
+
const arg = args[index];
|
|
174677
|
+
if (arg === "--spark-version" || arg.startsWith("--spark-version=") || arg === "--next" || arg === "--latest") {
|
|
174678
|
+
if (requested !== undefined)
|
|
174679
|
+
throw new Error("Choose only one of --next, --latest, or --spark-version.");
|
|
174680
|
+
const value = arg === "--spark-version" ? args[++index] : arg.startsWith("--spark-version=") ? arg.slice(16) : arg.slice(2);
|
|
174681
|
+
if (!value || value.startsWith("-"))
|
|
174682
|
+
throw new Error("--spark-version requires a version or tag");
|
|
174683
|
+
requested = value;
|
|
174684
|
+
} else
|
|
174685
|
+
forwarded.push(arg);
|
|
174686
|
+
}
|
|
174687
|
+
return { requested, forwarded };
|
|
174688
|
+
}
|
|
174689
|
+
var exactVersion = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
174690
|
+
async function resolveCreatorVersion(requested, fetcher = fetch) {
|
|
174691
|
+
if (exactVersion.test(requested))
|
|
174692
|
+
return requested;
|
|
174693
|
+
if (!/^[a-zA-Z][\w.-]*$/.test(requested))
|
|
174694
|
+
throw new Error(`Invalid Spark version or tag: ${requested}`);
|
|
174695
|
+
const response = await fetcher("https://registry.npmjs.org/-/package/@legendapp%2fspark/dist-tags", { signal: AbortSignal.timeout(15000) });
|
|
174696
|
+
if (!response.ok)
|
|
174697
|
+
throw new Error(`Could not resolve Spark tag ${requested}: npm registry HTTP ${response.status}`);
|
|
174698
|
+
const tags = await response.json();
|
|
174699
|
+
const version = tags[requested];
|
|
174700
|
+
if (!version || !exactVersion.test(version))
|
|
174701
|
+
throw new Error(`npm has no exact Spark version for tag ${requested}`);
|
|
174702
|
+
return version;
|
|
174703
|
+
}
|
|
174704
|
+
async function checkCreatorVersion(requested, forwarded) {
|
|
174705
|
+
const resolved = await resolveCreatorVersion(requested);
|
|
174706
|
+
if (resolved !== VERSION2) {
|
|
174707
|
+
const args = forwarded.filter((arg) => arg !== "--").map((arg) => "'" + arg.replaceAll("'", "'\\''") + "'").join(" ");
|
|
174708
|
+
throw new Error(`Spark ${requested} resolves to ${resolved}, but this creator bundles ${VERSION2}. Run the matching self-contained creator:
|
|
174709
|
+
npx @legendapp/create-spark@${resolved} ${args}`);
|
|
174710
|
+
}
|
|
174711
|
+
}
|
|
174712
|
+
|
|
174713
|
+
// packages/create-spark/src/create.ts
|
|
174670
174714
|
async function createSpark(args) {
|
|
174671
|
-
const {
|
|
174715
|
+
const { requested, forwarded } = creatorArguments(args);
|
|
174716
|
+
const { positionals, values } = cliArguments(["create", ...forwarded]);
|
|
174672
174717
|
if (values.help) {
|
|
174673
|
-
console.log("Usage: npm create @legendapp/spark@next MyApp -- [--universal] [--platform macos|windows|ios|android|web] [--example document-editor|notes-lite|music-lite|diff-lite] [--packages manifest.json] [--package-manager npm|pnpm|yarn|bun]");
|
|
174718
|
+
console.log("Usage: npm create @legendapp/spark@next MyApp -- [--next | --latest | --spark-version <version|tag>] [--universal] [--platform macos|windows|ios|android|web] [--example document-editor|notes-lite|music-lite|diff-lite] [--packages manifest.json] [--package-manager npm|pnpm|yarn|bun]");
|
|
174674
174719
|
return;
|
|
174675
174720
|
}
|
|
174676
174721
|
if (values.example && !examples.includes(values.example))
|
|
174677
174722
|
throw new Error(`Use --example ${examples.join(" | ")}`);
|
|
174723
|
+
if (requested) {
|
|
174724
|
+
if (values.packages)
|
|
174725
|
+
throw new Error("Release version flags cannot be combined with --packages.");
|
|
174726
|
+
await checkCreatorVersion(requested, forwarded);
|
|
174727
|
+
}
|
|
174678
174728
|
const platform = values.platform ?? hostPlatform();
|
|
174679
174729
|
process.env.SPARK_PLATFORM = platform;
|
|
174680
174730
|
try {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"version": "0.0.1-next.7",
|
|
4
|
+
"revision": "d750a9463e09c00bf390bb26de207586a3648d40",
|
|
5
|
+
"packages": {
|
|
6
|
+
"@react-native-runtimes/core": {
|
|
7
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.1-next.7/runtimes-985164a87eb0.tgz",
|
|
8
|
+
"size": 53886,
|
|
9
|
+
"sha256": "138644fcfaf60b172c9f206c66c6d160515dd8803c70264687d0f503294c9c0b"
|
|
10
|
+
},
|
|
11
|
+
"react-native-nitro-modules": {
|
|
12
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.1-next.7/react-native-nitro-modules-0.37.0-02b4dff54381.tgz",
|
|
13
|
+
"size": 145600,
|
|
14
|
+
"sha256": "02b4dff54381bbd4640eb4067e1dc82d7a79ff7e7f83b4357a4265177722d999"
|
|
15
|
+
},
|
|
16
|
+
"@op-engineering/op-sqlite": {
|
|
17
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.1-next.7/op-engineering-op-sqlite-18.2.1-dcc9490310bc.tgz",
|
|
18
|
+
"size": 112508535,
|
|
19
|
+
"sha256": "dcc9490310bc74c869ba7cf5e846a8966fab7c3871c4a536482c20be237894fd"
|
|
20
|
+
},
|
|
21
|
+
"react-native-webview": {
|
|
22
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.1-next.7/react-native-webview-16.0.0-b887e540eca8.tgz",
|
|
23
|
+
"size": 116289,
|
|
24
|
+
"sha256": "b887e540eca87c6817de6b38c4e8f4076e3a65e0f7fa63f0c5882e1155447a59"
|
|
25
|
+
},
|
|
26
|
+
"expo-audio": {
|
|
27
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.1-next.7/expo-audio-1.1.1-aff5604f2c4c.tgz",
|
|
28
|
+
"size": 381841,
|
|
29
|
+
"sha256": "aff5604f2c4cab23299a71e37e802a572b2e66e2e2250b20a261e664d5346693"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"runners": {
|
|
33
|
+
"macos-arm64": {
|
|
34
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.1-next.7/spark-runner-macos-arm64.zip",
|
|
35
|
+
"size": 20509043,
|
|
36
|
+
"sha256": "7441a17362d2be2f78bf5fbb1221b8eb88d988c7f9d877266ab680653f5e65b8",
|
|
37
|
+
"app": "SparkRunner.app",
|
|
38
|
+
"teamId": "56DD97VT22",
|
|
39
|
+
"fingerprint": "a0198a6ade8e3012beb792c8bc3f409e61de34a171035b52a10cc841d766fcb3"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"postinstall": "node node_modules/@legendapp/spark/init-template.cjs"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@legendapp/spark": "0.0.1-next.
|
|
16
|
+
"@legendapp/spark": "0.0.1-next.7",
|
|
17
17
|
"expo": "54.0.37",
|
|
18
18
|
"expo-desktop": "1.0.0",
|
|
19
19
|
"expo-desktop-prebuild-config": "1.1.0",
|