create-crossbind 2.0.0-beta.63 → 2.0.0-beta.64
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/package.json +1 -1
- package/src/index.js +7 -0
- package/src/readme.js +12 -0
- package/templates/backend-nodejs-native/package.json +3 -3
- package/templates/backend-nodejs-standalone/package.json +1 -1
- package/templates/backend-nodejs-wasm/package.json +2 -2
- package/templates/cloud-cloudflare-worker/package.json +2 -2
- package/templates/desktop-electron/package.json +3 -3
- package/templates/lib-cmake/package.json +1 -1
- package/templates/lib-prebuilt/README.md +1 -1
- package/templates/lib-prebuilt/package.json +2 -2
- package/templates/lib-source/package.json +1 -1
- package/templates/mobile-reactnative-cli/ci/crossbind-snapshot/cache.json +2 -2
- package/templates/mobile-reactnative-cli/package.json +6 -6
- package/templates/mobile-reactnative-expo/package-lock.json +1848 -2072
- package/templates/mobile-reactnative-expo/package.json +30 -30
- package/templates/mobile-reactnative-expo/src/components/animated-icon.tsx +1 -1
- package/templates/mobile-reactnative-expo/src/components/app-tabs.tsx +2 -2
- package/templates/mobile-reactnative-expo/src/components/app-tabs.web.tsx +1 -1
- package/templates/mobile-reactnative-expo/src/hooks/use-theme.ts +1 -1
- package/templates/native-executable/package.json +2 -2
- package/templates/web-react-rspack/package.json +3 -3
- package/templates/web-react-vite/package.json +2 -2
- package/templates/web-svelte-vite/package.json +2 -2
- package/templates/web-vanilla/package.json +2 -2
- package/templates/web-vue-vite/package.json +2 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
import { styleText } from 'node:util';
|
|
7
7
|
import * as p from '@clack/prompts';
|
|
8
8
|
import { unpackDotfiles } from './dotfiles.js';
|
|
9
|
+
import { renameInReadme } from './readme.js';
|
|
9
10
|
import { pkgManager } from './utils.js';
|
|
10
11
|
|
|
11
12
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -157,9 +158,15 @@ async function main() {
|
|
|
157
158
|
let scripts = {};
|
|
158
159
|
if (fs.existsSync(pjPath)) {
|
|
159
160
|
const pkg = JSON.parse(await fsp.readFile(pjPath, 'utf8'));
|
|
161
|
+
const templateName = pkg.name;
|
|
160
162
|
pkg.name = entry.kind === 'lib' ? `crossbind-lib-${name}` : name;
|
|
161
163
|
await fsp.writeFile(pjPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
162
164
|
scripts = pkg.scripts || {};
|
|
165
|
+
|
|
166
|
+
const readmePath = path.join(cwd, 'README.md');
|
|
167
|
+
if (fs.existsSync(readmePath)) {
|
|
168
|
+
await fsp.writeFile(readmePath, renameInReadme(await fsp.readFile(readmePath, 'utf8'), templateName, pkg.name));
|
|
169
|
+
}
|
|
163
170
|
}
|
|
164
171
|
|
|
165
172
|
const gradlew = path.join(cwd, 'android', 'gradlew');
|
package/src/readme.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// A template's README introduces the published sample on crossbind's beta channel. A scaffolded
|
|
2
|
+
// project is a package of its own, installed from its default tag, so the README names it instead.
|
|
3
|
+
const escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
4
|
+
|
|
5
|
+
export function renameInReadme(readme, from, to) {
|
|
6
|
+
const name = escapeRegExp(from);
|
|
7
|
+
const end = '(?![\\w.-])';
|
|
8
|
+
return readme
|
|
9
|
+
.replace(new RegExp(`${name}@beta${end}`, 'g'), to)
|
|
10
|
+
.replace(new RegExp(`npm/v/${name}/beta${end}`, 'g'), `npm/v/${to}`)
|
|
11
|
+
.replace(new RegExp(`${name}${end}`, 'g'), to);
|
|
12
|
+
}
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"e2e:prod": "node e2e/run.mjs"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.
|
|
15
|
+
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.64"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@crossbind/core-embind-napi": "^2.0.0-beta.
|
|
19
|
-
"crossbind": "^2.0.0-beta.
|
|
18
|
+
"@crossbind/core-embind-napi": "^2.0.0-beta.64",
|
|
19
|
+
"crossbind": "^2.0.0-beta.64"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"crossbind-sample",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"build": "crossbind build -p wasm -a wasm32 -r st -e node -b release"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.
|
|
13
|
+
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.64"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"crossbind": "^2.0.0-beta.
|
|
16
|
+
"crossbind": "^2.0.0-beta.64"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"crossbind-sample",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "crossbind build -p wasm -a wasm32 -r st -e edge -b release",
|
|
11
11
|
"dev": "wrangler dev",
|
|
12
|
-
"deploy": "wrangler
|
|
12
|
+
"deploy": "wrangler deploy",
|
|
13
13
|
"e2e:dev": "playwright test --config playwright.dev.config.cjs",
|
|
14
14
|
"e2e:prod": "playwright test --config playwright.dev.config.cjs"
|
|
15
15
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"crossbind": "^2.0.0-beta.
|
|
26
|
+
"crossbind": "^2.0.0-beta.64",
|
|
27
27
|
"wrangler": "^4.136.3",
|
|
28
28
|
"@playwright/test": "^1.63.0"
|
|
29
29
|
},
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"e2e:prod": "electron-builder --dir && playwright test --project=packaged"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@crossbind/core-embind-napi": "^2.0.0-beta.
|
|
20
|
-
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.
|
|
19
|
+
"@crossbind/core-embind-napi": "^2.0.0-beta.64",
|
|
20
|
+
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.64",
|
|
21
21
|
"@playwright/test": "^1.63.0",
|
|
22
|
-
"crossbind": "^2.0.0-beta.
|
|
22
|
+
"crossbind": "^2.0.0-beta.64",
|
|
23
23
|
"electron": "^44.5.1",
|
|
24
24
|
"electron-builder": "^26.15.3"
|
|
25
25
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossbind/example-lib-cmake",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.64",
|
|
4
4
|
"description": "crossbind sample library: simple cmake library",
|
|
5
5
|
"homepage": "https://github.com/crossbind/crossbind/tree/main/examples/lib-cmake#readme",
|
|
6
6
|
"repository": "https://github.com/crossbind/crossbind.git",
|
|
@@ -58,7 +58,7 @@ console.log(result.get(0));
|
|
|
58
58
|
|
|
59
59
|
### Usage in JavaScript Code (web, without plugin)
|
|
60
60
|
```js
|
|
61
|
-
import 'node_modules/@crossbind/example-lib-prebuilt-matrix/dist/crossbind-example-lib-prebuilt-matrix.browser.js';
|
|
61
|
+
import 'node_modules/@crossbind/example-lib-prebuilt-matrix/dist/crossbind-example-lib-prebuilt-matrix-wasm-wasm32-st-release.browser.js';
|
|
62
62
|
|
|
63
63
|
initNative({ path: 'node_modules/@crossbind/example-lib-prebuilt-matrix/dist' }).then(({ Matrix }) => {
|
|
64
64
|
const a = new Matrix(1210000, 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossbind/example-lib-prebuilt-matrix",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.64",
|
|
4
4
|
"description": "crossbind sample prebuilt library: matrix multiplier",
|
|
5
5
|
"homepage": "https://github.com/crossbind/crossbind/tree/main/examples/lib-prebuilt-matrix#readme",
|
|
6
6
|
"repository": "https://github.com/crossbind/crossbind.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepublishOnly": "crossbind build"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"crossbind": "^2.0.0-beta.
|
|
21
|
+
"crossbind": "^2.0.0-beta.64"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"crossbind-sample",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossbind/example-lib-source",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.64",
|
|
4
4
|
"description": "crossbind sample library: simple source library",
|
|
5
5
|
"homepage": "https://github.com/crossbind/crossbind/tree/main/examples/lib-source#readme",
|
|
6
6
|
"repository": "https://github.com/crossbind/crossbind.git",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"hashes": {
|
|
3
|
-
"/Users/runner/work/crossbind/crossbind/examples/mobile-reactnative-cli/src/native/native.h": "swig-macros-
|
|
4
|
-
"/Users/runner/work/crossbind/crossbind/examples/mobile-reactnative-cli/.crossbind/build/interface/native.i": "swig-extras-
|
|
3
|
+
"/Users/runner/work/crossbind/crossbind/examples/mobile-reactnative-cli/src/native/native.h": "swig-macros-4\nd105082c6e8c8652ea461e161c501e824b6b625f7b819490102c5c0699744249\nconstants:Native\nnamed:Native",
|
|
4
|
+
"/Users/runner/work/crossbind/crossbind/examples/mobile-reactnative-cli/.crossbind/build/interface/native.i": "swig-extras-2\nd2951a720fdd54191e27157df067c64d7d7839b41c14494d63aef4f3a4eae3a2\nd105082c6e8c8652ea461e161c501e824b6b625f7b819490102c5c0699744249\nnamed:Native"
|
|
5
5
|
},
|
|
6
6
|
"interfaces": {
|
|
7
7
|
"/Users/runner/work/crossbind/crossbind/examples/mobile-reactnative-cli/src/native/native.h": "/Users/runner/work/crossbind/crossbind/examples/mobile-reactnative-cli/.crossbind/build/interface/native.i"
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"e2e:android": "pnpm run run:android && pnpm run maestro:android"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@crossbind/core-embind-jsi": "^2.0.0-beta.
|
|
24
|
-
"@crossbind/plugin-react-native": "^2.0.0-beta.
|
|
25
|
-
"@crossbind/plugin-react-native-ios-helper": "^2.0.0-beta.
|
|
26
|
-
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.
|
|
23
|
+
"@crossbind/core-embind-jsi": "^2.0.0-beta.64",
|
|
24
|
+
"@crossbind/plugin-react-native": "^2.0.0-beta.64",
|
|
25
|
+
"@crossbind/plugin-react-native-ios-helper": "^2.0.0-beta.64",
|
|
26
|
+
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.64",
|
|
27
27
|
"react": "19.3.0",
|
|
28
28
|
"react-native": "0.87.1",
|
|
29
29
|
"react-native-safe-area-context": "^5.8.0",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@types/react-test-renderer": "^19.3.0",
|
|
49
49
|
"eslint": "^8.19.0",
|
|
50
50
|
"jest": "^29.6.3",
|
|
51
|
-
"prettier": "3.9.
|
|
51
|
+
"prettier": "3.9.10",
|
|
52
52
|
"react-test-renderer": "19.3.0",
|
|
53
53
|
"typescript": "^6.0.3",
|
|
54
|
-
"@crossbind/plugin-metro": "^2.0.0-beta.
|
|
54
|
+
"@crossbind/plugin-metro": "^2.0.0-beta.64"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=24"
|