Skip to content

Commit 46229c4

Browse files
authored
Examples 2.0 (#62)
1 parent 2eb6e90 commit 46229c4

File tree

182 files changed

+2870
-4717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+2870
-4717
lines changed

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
desktop-node-preact/public
2-
desktop-node-preact/dist
3-
41
node_modules
2+
build
3+
dist
4+
package-lock.json

LICENSE

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
MIT License
22

3-
Copyright (c) 2022 Paolo Fragomeni <[email protected]>
4-
Copyright (c) 2022 Jake Verbaten <[email protected]>
5-
Copyright (c) 2022 Joseph Werle <[email protected]>
6-
Copyright (c) 2022 Sergey Rubanov <[email protected]>
3+
Copyright (c) 2023 Paolo Fragomeni <[email protected]>
4+
Copyright (c) 2023 Joseph Werle <[email protected]>
5+
Copyright (c) 2023 Sergey Rubanov <[email protected]>
76

87
Permission is hereby granted, free of charge, to any person obtaining a copy
98
of this software and associated documentation files (the "Software"), to deal

README.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,22 @@ This repository contains example projects powered by the
55
cross-platform apps for desktop and mobile, using the web technologies
66
you already know.
77

8-
## Desktop Examples
9-
10-
- [React Desktop Example](desktop-node-react)
11-
- [Tonic Desktop CommonJS Example](desktop-node-tonic-cjs)
12-
- [Tonic Desktop ESM Example](desktop-node-tonic-esm)
13-
- [Kotlin/Native & Kotlin.js Desktop Example](desktop-kotlin-kotlinjs)
14-
- [Preact Desktop Example](desktop-preact-no-backend)
15-
- [Preact Desktop + Node Example](desktop-node-preact)
16-
17-
## iOS Examples
18-
19-
- [Tonic iOS Example](ios-tonic)
20-
- [DNS Lookup iOS Example](ios-tonic--dns-lookup)
21-
22-
## Android examples
23-
24-
- [Tonic Android example](android-tonic)
8+
All the examples are split into three categories:
9+
1. [Basic examples](basic) - simple examples that show how to
10+
use the Socket runtime to build a desktop app.
11+
- [TodoMVC](basic/TodoMVC)
12+
2. [Advanced examples](advanced) - more complex examples that
13+
show how to use 3rd party libraries and frameworks with the Socket runtime.
14+
- [create-react-app](advanced/create-react-app)
15+
- [vite-vue-ts](advanced/vite-vue-ts)
16+
3. [By feature examples](by-feature) - examples that show how
17+
to use specific features of the Socket runtime.
18+
- [filesystem](by-feature/filesystem) - a simple example that shows
19+
how to read and write files in.
20+
- [window management](by-feature/multiple-windows) - a simple
21+
example that shows how to create multiple windows in a desktop app.
22+
- [Node.js backend](by-feature/node-backend) - a simple example that
23+
shows how to use Node.js backend in a desktop app.
2524

2625
## Support
2726

advanced/create-react-app/.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

advanced/create-react-app/README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `npm start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13+
14+
The page will reload when you make changes.\
15+
You may also see any lint errors in the console.
16+
17+
### `npm test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `npm run build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `npm run eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
35+
36+
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39+
40+
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).
47+
48+
### Code Splitting
49+
50+
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51+
52+
### Analyzing the Bundle Size
53+
54+
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55+
56+
### Making a Progressive Web App
57+
58+
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59+
60+
### Advanced Configuration
61+
62+
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63+
64+
### Deployment
65+
66+
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67+
68+
### `npm run build` fails to minify
69+
70+
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "create-react-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^5.16.5",
7+
"@testing-library/react": "^13.4.0",
8+
"@testing-library/user-event": "^13.5.0",
9+
"react": "^18.2.0",
10+
"react-dom": "^18.2.0",
11+
"react-scripts": "5.0.1",
12+
"web-vitals": "^2.1.4"
13+
},
14+
"scripts": {
15+
"start": "react-scripts start",
16+
"build": "react-scripts build",
17+
"test": "react-scripts test",
18+
"eject": "react-scripts eject"
19+
},
20+
"eslintConfig": {
21+
"extends": [
22+
"react-app",
23+
"react-app/jest"
24+
]
25+
},
26+
"browserslist": {
27+
"production": [
28+
">0.2%",
29+
"not dead",
30+
"not op_mini all"
31+
],
32+
"development": [
33+
"last 1 chrome version",
34+
"last 1 firefox version",
35+
"last 1 safari version"
36+
]
37+
}
38+
}
3.78 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
http-equiv="Content-Security-Policy"
10+
content="
11+
connect-src http://* https://* ipc://* file: socket:* data://*;
12+
child-src 'none';
13+
img-src https: data: file:;
14+
"
15+
>
16+
<meta
17+
name="description"
18+
content="Web site created using create-react-app"
19+
/>
20+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
21+
<!--
22+
manifest.json provides metadata used when your web app is installed on a
23+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
24+
-->
25+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
26+
<!--
27+
Notice the use of %PUBLIC_URL% in the tags above.
28+
It will be replaced with the URL of the `public` folder during the build.
29+
Only files inside the `public` folder can be referenced from the HTML.
30+
31+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
32+
work correctly both with client-side routing and a non-root public URL.
33+
Learn how to configure a non-root public URL by running `npm run build`.
34+
-->
35+
<title>React App</title>
36+
</head>
37+
<body>
38+
<noscript>You need to enable JavaScript to run this app.</noscript>
39+
<div id="root"></div>
40+
<!--
41+
This HTML file is a template.
42+
If you open it directly in the browser, you will see an empty page.
43+
44+
You can add webfonts, meta tags, or analytics to this file.
45+
The build step will place the bundled scripts into the <body> tag.
46+
47+
To begin the development, run `npm start` or `yarn start`.
48+
To create a production bundle, use `npm run build` or `yarn build`.
49+
-->
50+
</body>
51+
</html>
5.22 KB
Loading
9.44 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

0 commit comments

Comments
 (0)