Skip to content

Commit a3098b2

Browse files
committed
code base
1 parent dd3b3c1 commit a3098b2

File tree

105 files changed

+14801
-3175
lines changed

Some content is hidden

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

105 files changed

+14801
-3175
lines changed

.classpath

-32
This file was deleted.

.eslintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
]
12+
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
target
1+
node_modules
2+
dist

.project

-23
This file was deleted.

.settings/org.eclipse.core.resources.prefs

-4
This file was deleted.

.settings/org.eclipse.jdt.core.prefs

-8
This file was deleted.

.settings/org.eclipse.m2e.core.prefs

-4
This file was deleted.

.vscode/launch.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "pwa-node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"preLaunchTask": "tsc: build - tsconfig.json",
12+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
13+
"cwd": "${workspaceFolder}",
14+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
15+
"windows": {
16+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
17+
},
18+
"args" : ["./dist/main.js"],
19+
}
20+
]
21+
}

LICENSE.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
CC0 1.0 Universal
2+
==================
3+
4+
Statement of Purpose
5+
---------------------
6+
7+
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
8+
9+
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
10+
11+
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
12+
13+
1. Copyright and Related Rights.
14+
--------------------------------
15+
A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
16+
17+
i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
18+
ii. moral rights retained by the original author(s) and/or performer(s);
19+
iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
20+
iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
21+
v. rights protecting the extraction, dissemination, use and reuse of data in a Work;
22+
vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
23+
vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
24+
25+
2. Waiver.
26+
-----------
27+
To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
28+
29+
3. Public License Fallback.
30+
----------------------------
31+
Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
32+
33+
4. Limitations and Disclaimers.
34+
--------------------------------
35+
36+
a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
37+
b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
38+
c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
39+
d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# electron-quick-start-typescript
2+
3+
**Clone and run for a quick way to see Electron in action.**
4+
5+
This is a [TypeScript](https://www.typescriptlang.org) port of the [Electron Quick Start repo](https://github.com/electron/electron-quick-start) -- a minimal Electron application based on the [Quick Start Guide](http://electron.atom.io/docs/tutorial/quick-start) within the Electron documentation.
6+
7+
**Use this app along with the [Electron API Demos](http://electron.atom.io/#get-started) app for API code examples to help you get started.**
8+
9+
A basic Electron application needs just these files:
10+
11+
- `package.json` - Points to the app's main file and lists its details and dependencies.
12+
- `main.ts` - Starts the app and creates a browser window to render HTML. This is the app's **main process**.
13+
- `index.html` - A web page to render. This is the app's **renderer process**.
14+
15+
You can learn more about each of these components within the [Quick Start Guide](http://electron.atom.io/docs/tutorial/quick-start).
16+
17+
## To Use
18+
19+
To clone and run this repository you'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer. From your command line:
20+
21+
```bash
22+
# Clone this repository
23+
git clone https://github.com/electron/electron-quick-start-typescript
24+
# Go into the repository
25+
cd electron-quick-start-typescript
26+
# Install dependencies
27+
npm install
28+
# Run the app
29+
npm start
30+
```
31+
32+
Note: If you're using Linux Bash for Windows, [see this guide](https://www.howtogeek.com/261575/how-to-run-graphical-linux-desktop-applications-from-windows-10s-bash-shell/) or use `node` from the command prompt.
33+
34+
## Re-compile automatically
35+
36+
To recompile automatically and to allow using [electron-reload](https://github.com/yan-foto/electron-reload), run this in a separate terminal:
37+
38+
```bash
39+
npm run watch
40+
```
41+
42+
## Resources for Learning Electron
43+
44+
- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
45+
- [Electron Fiddle](https://electronjs.org/fiddle) - create, play, and share small Electron experiments
46+
- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community
47+
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app
48+
- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further
49+
- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs
50+
51+
## License
52+
53+
[CC0 1.0 (Public Domain)](LICENSE.md)

commands.js

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const { exec } = require("child_process");
2+
3+
copyUntrackedFiles();
4+
copyModifiedFiles();
5+
6+
function copyUntrackedFiles(){
7+
const command = "git ls-files --others --exclude-standard common_library";
8+
runCommand(command,copyCommonFiles)
9+
}
10+
11+
function copyModifiedFiles(){
12+
const command = "git ls-files --modified common_library";
13+
runCommand(command,copyCommonFiles)
14+
}
15+
16+
function removeDeletedFiles(){
17+
const command = "git ls-files --deleted common_library";
18+
runCommand(command,copyCommonFiles)
19+
}
20+
21+
function runCommand(command,handler){
22+
exec(command, (error, stdout, stderr) => {
23+
if (error) {
24+
console.log(`error: ${error.message}`);
25+
return;
26+
}
27+
if (stderr) {
28+
console.log(`stderr: ${stderr}`);
29+
return;
30+
}
31+
console.log(`stdout: ${stdout}`);
32+
handler(stdout);
33+
});
34+
35+
}
36+
37+
38+
function copyCommonFiles(files){
39+
files = files.replace(/[\n\r]/g, " ").trim();
40+
console.log("files",files);
41+
if(!files)return;
42+
console.log('file exist');
43+
let command1 = `copyfiles -E ${files} frontend/node_modules`;
44+
let command2 = `copyfiles -E ${files} node_modules`;
45+
runCommand(command1,()=>{});
46+
runCommand(command2,()=>{});
47+
}
48+
49+
function handleDelete(files){
50+
files = files.replace(/[\n\r]/g, " ").trim();
51+
console.log("files",files);
52+
if(!files)return;
53+
console.log('file exist');
54+
let command1 = `copyfiles -E ${files} frontend/node_modules`;
55+
let command2 = `copyfiles -E ${files} node_modules`;
56+
runCommand(command1,()=>{});
57+
runCommand(command2,()=>{});
58+
}

0 commit comments

Comments
 (0)