Skip to content

Commit 35dab84

Browse files
committed
chore: project update
1 parent fae0f6e commit 35dab84

File tree

4 files changed

+1604
-1281
lines changed

4 files changed

+1604
-1281
lines changed

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
* [Update readme ](#update-readme-)
5757
* [Update doc ](#update-doc-)
5858
* [Publish](#publish)
59+
* [modifying submodules](#modifying-submodules)
5960
* [Questions](#questions)
6061

6162

@@ -184,6 +185,7 @@ To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`)
184185
```bash
185186
npm run build.all
186187
```
188+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
187189

188190
### Demos
189191

@@ -193,6 +195,10 @@ npm run demo.[ng|react|svelte|vue].[ios|android]
193195
npm run demo.svelte.ios # Example
194196
```
195197

198+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
199+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
200+
You can start from the `install.ts` of each flavor to see how to register new demos
201+
196202

197203
[](#contributing)
198204

@@ -237,9 +243,115 @@ Simply run
237243
npm run publish
238244
```
239245

246+
### modifying submodules
247+
248+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
249+
One easy solution is t modify `~/.gitconfig` and add
250+
```
251+
[url "ssh://[email protected]/"]
252+
pushInsteadOf = https://github.com/
253+
```
254+
255+
256+
[](#questions)
257+
240258

241259
[](#questions)
242260

261+
## Questions
262+
263+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
264+
265+
[](#demos-and-development)
266+
267+
## Demos and Development
268+
269+
270+
### Repo Setup
271+
272+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
273+
```
274+
git submodule update --init
275+
```
276+
277+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
278+
279+
To develop and test:
280+
if you use `yarn` then run `yarn`
281+
if you use `pnpm` then run `pnpm i`
282+
283+
**Interactive Menu:**
284+
285+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
286+
287+
### Build
288+
289+
```bash
290+
npm run build.all
291+
```
292+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
293+
294+
### Demos
295+
296+
```bash
297+
npm run demo.[ng|react|svelte|vue].[ios|android]
298+
299+
npm run demo.svelte.ios # Example
300+
```
301+
302+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
303+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
304+
You can start from the `install.ts` of each flavor to see how to register new demos
305+
306+
307+
[](#contributing)
308+
309+
## Contributing
310+
311+
### Update repo
312+
313+
You can update the repo files quite easily
314+
315+
First update the submodules
316+
317+
```bash
318+
npm run update
319+
```
320+
321+
Then commit the changes
322+
Then update common files
323+
324+
```bash
325+
npm run sync
326+
```
327+
Then you can run `yarn|pnpm`, commit changed files if any
328+
329+
### Update readme
330+
```bash
331+
npm run readme
332+
```
333+
334+
### Update doc
335+
```bash
336+
npm run doc
337+
```
338+
339+
### Publish
340+
341+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
342+
Simply run
343+
```shell
344+
npm run publish
345+
```
346+
347+
### modifying submodules
348+
349+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
350+
One easy solution is t modify `~/.gitconfig` and add
351+
```
352+
[url "ssh://[email protected]/"]
353+
pushInsteadOf = https://github.com/
354+
```
243355

244356
[](#questions)
245357

demo-snippets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"private": true,
44
"version": "0.0.1",
55
"dependencies": {
6-
"@nativescript-community/gesturehandler": "file:../packages/gesturehandler"
6+
"@nativescript-community/gesturehandler": "link:../packages/gesturehandler"
77
}
88
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"demo.ng.clean": "cd ./demo-ng && ns clean",
2222
"demo.ng.ios": "cd ./demo-ng && ns run ios --no-hmr --env.watchNodeModules",
2323
"postinstall": "npm run setup",
24-
"publish": "npm run clean && npm run build.all && npm run readme && lerna publish --no-private --create-release=github --force-publish",
24+
"publish": "npm run clean ; npm run build.all ; npm run readme ; npm run doc ; npm run commit_readme_doc_changes ; lerna publish",
2525
"readme": "lerna run readme && node ./tools/readme.js",
2626
"setup": "npm run submodules && ts-patch install",
2727
"start": "./node_modules/.bin/ntl -A -s 15 -o",
@@ -31,14 +31,16 @@
3131
"tsc": "cpy '**/*.d.ts' '../plugin' --parents --cwd=src && tsc -skipLibCheck -d",
3232
"update": "node ./tools/update.js",
3333
"doc": "node tools/builddoc.mjs",
34-
"fullclean": "npm run clean && rimraf 'packages/**/node_modules' 'demo-*/hooks' 'demo-*/node_modules' 'package-lock.json' 'pnpm-lock.yaml' 'node_modules'"
34+
"fullclean": "npm run clean && rimraf 'packages/**/node_modules' 'demo-*/hooks' 'demo-*/node_modules' 'package-lock.json' 'pnpm-lock.yaml' 'node_modules'",
35+
"commit_readme_doc_changes": "git add docs *.md ; git commit -m \"readme/doc\""
3536
},
3637
"commitlint": {
3738
"extends": [
3839
"@commitlint/config-conventional"
3940
]
4041
},
4142
"dependencies": {
43+
"@nativescript-community/observable": "2.0.11",
4244
"@nativescript-community/plugin-seed-tools": "file:tools",
4345
"@nativescript-community/template-snippet": "file:demo-snippets"
4446
},

0 commit comments

Comments
 (0)