create-lupine 1.3.1 → 1.3.2
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 +1 -1
- package/index.js +6 -1
- package/package.json +1 -1
- package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +3 -0
- package/templates/common/_env +2 -2
- package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +10 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +1 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +1 -0
- package/templates/lupine-template-fullstack-note/lupine.json +15 -0
- package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/404.html +35 -0
- package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/assets/favicon.ico +0 -0
- package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/assets/og-image.png +0 -0
- package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/index.html +39 -0
- package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/index.tsx +16 -0
- package/templates/lupine-template-fullstack-starter/api/resources/install.sqlite.sql +101 -75
- package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +10 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +1 -1
- package/templates/lupine-template-fullstack-starter/lupine.json +15 -0
- package/templates/lupine-template-fullstack-starter/web/src/lupine-template-fullstack-starter/404.html +35 -0
- package/templates/lupine-template-fullstack-starter/web/src/lupine-template-fullstack-starter/assets/favicon.ico +0 -0
- package/templates/lupine-template-fullstack-starter/web/src/lupine-template-fullstack-starter/assets/og-image.png +0 -0
- package/templates/lupine-template-fullstack-starter/web/src/lupine-template-fullstack-starter/index.html +39 -0
- package/templates/lupine-template-fullstack-starter/web/src/lupine-template-fullstack-starter/index.tsx +17 -0
package/README.md
CHANGED
|
@@ -26,6 +26,6 @@ A project has the app in `apps/my-app/app`, the page of the site in `apps/my-app
|
|
|
26
26
|
|
|
27
27
|
`npx create-lupine --add-app <name>`, in the folder of a project, adds one more app from a template (`apps/<name>`, with its scripts `npm run <name>:run-mac` ...) and prints what to add to `.env` (`APPS`, `DOMAINS:<name>`); `.env` itself isn't changed.
|
|
28
28
|
|
|
29
|
-
The scripts of a new project: `npm run run-mac`, `run-ios`, `run-android`, `run-exe` (build and start the app), `build-android` (the apk for the store), `bump` (the next version), `icons` (the icons of the site from the icon of the app), `release` (a folder for the server in `dist/release/<name>`).
|
|
29
|
+
The scripts of a new project: `npm run run-mac`, `run-ios`, `run-android`, `run-exe` (build and start the app), `build-android` (the apk for the store), `build-ios` and `upload-ios` (the .ipa for the App Store and TestFlight), `open-ios` and `open-android` (the project in Xcode / Android Studio), `bump` (the next version), `icons` (the icons of the site from the icon of the app), `release` (a folder for the server in `dist/release/<name>`).
|
|
30
30
|
|
|
31
31
|
MIT.
|
package/index.js
CHANGED
|
@@ -231,6 +231,11 @@ function appScripts(appName, prefix = '') {
|
|
|
231
231
|
[`${prefix}build-android`]: `lupine-native android --release ${app}`,
|
|
232
232
|
[`${prefix}run-android`]: `lupine-native android --install --run ${app}`,
|
|
233
233
|
[`${prefix}run-ios`]: `lupine-native ios --install --run ${app}`,
|
|
234
|
+
// Xcode and Android Studio; the App Store (--team=<Apple team> or LUPINE_TEAM; the API key for uploads in dist/cert)
|
|
235
|
+
[`${prefix}open-ios`]: `lupine-native ios --open --release --device ${app}`,
|
|
236
|
+
[`${prefix}build-ios`]: `lupine-native ios --ipa --release --device ${app}`,
|
|
237
|
+
[`${prefix}upload-ios`]: `lupine-native ios --upload ${app}`,
|
|
238
|
+
[`${prefix}open-android`]: `lupine-native android --open --release ${app}`,
|
|
234
239
|
[`${prefix}run-mac`]: `lupine-native macos --run ${app}`,
|
|
235
240
|
[`${prefix}run-exe`]: `lupine-native windows --run ${app}`,
|
|
236
241
|
};
|
|
@@ -433,7 +438,7 @@ async function init() {
|
|
|
433
438
|
'start-production': 'node dist/server_root/server/server-loader.js --env=.env.production',
|
|
434
439
|
// the apps: npm run native -- macos --app=<the folder in apps/> --run (ios, android, windows, web; test macos)
|
|
435
440
|
native: 'lupine-native',
|
|
436
|
-
// the app: npm run run-android, run-ios, run-mac, run-exe, build-android, bump, icons
|
|
441
|
+
// the app: npm run run-android, run-ios, run-mac, run-exe, build-android, build-ios, upload-ios, open-ios, open-android, bump, icons
|
|
437
442
|
...appScripts(appName),
|
|
438
443
|
// a folder with what the server needs (dist/release/<name>): copy it to the server
|
|
439
444
|
release: `lupine-build --env=.env.production --dev=0 --obfuscate=0 --release=dist/release/${appName}`,
|
package/package.json
CHANGED
|
@@ -159,6 +159,9 @@ npx lupine-native android --app=apps/my-app --run --serial=<adb device>
|
|
|
159
159
|
npx lupine-native android --app=apps/my-app --release --install # onto a connected phone: uses a build that is there or builds; asks for the device if several
|
|
160
160
|
npx lupine-native devices # connected phones (Android, iOS)
|
|
161
161
|
npx lupine-native bump --app=my-app # store release: version x.y.z -> x.y.(z+1), build + 1; the code reads APP_VERSION
|
|
162
|
+
npx lupine-native ios --app=apps/my-app --ipa --release --device --team=<team> # App Store: archive, .ipa (first time --provision)
|
|
163
|
+
npx lupine-native ios --app=apps/my-app --upload # newest .ipa to App Store Connect / TestFlight; API key in dist/cert (AuthKey_<id>.p8, appstore.json {keyId, issuerId})
|
|
164
|
+
npx lupine-native ios --app=apps/my-app --open --release --device --team=<team> # Xcode project (android --open: Android Studio); bundles the JS before each build there; --rebuild after lupineNative changes
|
|
162
165
|
npx lupine-native windows --app=apps/my-app --run # on a Mac or Linux --run opens it in Wine
|
|
163
166
|
npx lupine-native docker android --app=apps/my-app # builds in Docker, nothing installed
|
|
164
167
|
```
|
package/templates/common/_env
CHANGED
|
@@ -65,8 +65,8 @@ DOMAINS:{APP-NAME}=
|
|
|
65
65
|
# mkcert example.com "*.example.com" localhost 127.0.0.1 ::1
|
|
66
66
|
SSL_KEY_PATH=dist/example.com+4-key.pem
|
|
67
67
|
SSL_CRT_PATH=dist/example.com+4.pem
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
SSL_KEY_PATH:{APP-NAME}=dist/example.com+4-key.pem
|
|
69
|
+
SSL_CRT_PATH:{APP-NAME}=dist/example.com+4.pem
|
|
70
70
|
|
|
71
71
|
DB_TYPE=sqlite
|
|
72
72
|
SQLITE_FILENAME=sqlite3.db
|
|
@@ -45,10 +45,19 @@ export const setServerAddress = (address: string) => {
|
|
|
45
45
|
base = address.replace(/\/+$/, '');
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
// the copy for GitHub Pages (web/src/lupine-template-fullstack-note): the app without a server, every call answers
|
|
49
|
+
// no_server and the app says why
|
|
50
|
+
let noServer = false;
|
|
51
|
+
/** no server: sign-in and notes say that this is a demo */
|
|
52
|
+
export const setNoServer = () => {
|
|
53
|
+
noServer = true;
|
|
54
|
+
};
|
|
55
|
+
|
|
48
56
|
/** The text of an answer for the user, by its code. A code the app doesn't know: the message of the API. */
|
|
49
57
|
export const messageOf = (a: Answer): string => {
|
|
50
58
|
switch (a.code) {
|
|
51
59
|
case 'offline': return t('api.offline', 'The server cannot be reached');
|
|
60
|
+
case 'no_server': return t('api.no_server', 'This is only a static page, without a back-end server: sign-in and notes work in a project made from this template');
|
|
52
61
|
case 'bad_answer': return t('api.bad_answer', 'Unexpected answer of the server ({status})', { status: a.httpStatus ?? '?' });
|
|
53
62
|
case 'bad_request': return t('api.bad_request', 'The server did not understand the request');
|
|
54
63
|
case 'bad_username': return t('api.bad_username', 'User name: 3 to 50 characters (letters, digits, _ . @ -)');
|
|
@@ -93,6 +102,7 @@ const forget = () => {
|
|
|
93
102
|
};
|
|
94
103
|
|
|
95
104
|
const call = async (path: string, body?: object): Promise<Answer> => {
|
|
105
|
+
if (noServer) return { status: 'error', code: 'no_server' };
|
|
96
106
|
const headers: { [name: string]: string } = { Accept: 'application/json' };
|
|
97
107
|
if (body) headers['Content-Type'] = 'application/json';
|
|
98
108
|
if (native) {
|
|
@@ -60,6 +60,7 @@ export const ja = {
|
|
|
60
60
|
// the texts of the codes of the API (shell/api.ts: messageOf)
|
|
61
61
|
api: {
|
|
62
62
|
offline: 'サーバーに接続できません',
|
|
63
|
+
no_server: 'これは静的なページで、バックエンドのサーバーはありません。このテンプレートから作ったプロジェクトでログインとメモが使えます',
|
|
63
64
|
bad_answer: 'サーバーから予期しない応答がありました({status})',
|
|
64
65
|
bad_request: 'サーバーがリクエストを理解できませんでした',
|
|
65
66
|
bad_username: 'ユーザー名:3〜50 文字(英字、数字、_ . @ -)',
|
|
@@ -60,6 +60,7 @@ export const zhCN = {
|
|
|
60
60
|
// the texts of the codes of the API (shell/api.ts: messageOf)
|
|
61
61
|
api: {
|
|
62
62
|
offline: '无法连接服务器',
|
|
63
|
+
no_server: '这只是静态网页,没有后端服务器:用这个模板创建项目后,就能登录和保存笔记',
|
|
63
64
|
bad_answer: '服务器返回了意外的结果({status})',
|
|
64
65
|
bad_request: '服务器无法理解该请求',
|
|
65
66
|
bad_username: '用户名:3 到 50 个字符(字母、数字、_ . @ -)',
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
"index": "web/src/index.tsx",
|
|
8
8
|
"html": "web/src/index.html",
|
|
9
9
|
"outdir": "/"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"index": "web/src/lupine-template-fullstack-note/index.tsx",
|
|
13
|
+
"html": "web/src/lupine-template-fullstack-note/index.html",
|
|
14
|
+
"outdir": "/lupine-template-fullstack-note"
|
|
10
15
|
}
|
|
11
16
|
],
|
|
12
17
|
"apiEntryPoint": "api/src/index.ts",
|
|
@@ -20,6 +25,16 @@
|
|
|
20
25
|
"env": "all",
|
|
21
26
|
"from": "api/resources",
|
|
22
27
|
"to": "data/resources"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"env": "all",
|
|
31
|
+
"from": "web/src/lupine-template-fullstack-note/assets",
|
|
32
|
+
"to": "web/lupine-template-fullstack-note/assets"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"env": "all",
|
|
36
|
+
"from": "web/src/lupine-template-fullstack-note/404.html",
|
|
37
|
+
"to": "web/lupine-template-fullstack-note/404.html"
|
|
23
38
|
}
|
|
24
39
|
]
|
|
25
40
|
}
|
package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/404.html
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Page Not Found</title>
|
|
7
|
+
<style>
|
|
8
|
+
main {
|
|
9
|
+
display: flex;
|
|
10
|
+
height: 100vh;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
.header404 {
|
|
16
|
+
font-size: 48px;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
<script type="text/javascript">
|
|
20
|
+
// Single Page Apps for GitHub Pages, change all "/lupine-template-fullstack-note/" to your github project name
|
|
21
|
+
if (window.location.pathname.includes('/lupine-template-fullstack-note/')) {
|
|
22
|
+
window.location.href = '/lupine-template-fullstack-note/?redirect=' + window.location.pathname;
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<main>
|
|
28
|
+
<h4 class="header404">404</h4>
|
|
29
|
+
<div class="content-404">Uh-oh! We couldn't find the page you are looking for.</div>
|
|
30
|
+
<p>
|
|
31
|
+
<a href="/lupine-template-fullstack-note/">Check our home page</a>
|
|
32
|
+
</p>
|
|
33
|
+
</main>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
Binary file
|
|
Binary file
|
package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/index.html
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Lupine Template Fullstack Note</title>
|
|
6
|
+
<meta name="description" content="Lupine Template Fullstack Note - sign-in and notes kept on the server, for iOS, Android, macOS, Windows and the web: tabs, a side menu, settings, themes, languages. This page is static, without the server. Powered by Lupine.js." />
|
|
7
|
+
|
|
8
|
+
<!-- Open Graph / Facebook -->
|
|
9
|
+
<meta property="og:type" content="website" />
|
|
10
|
+
<meta property="og:url" content="https://uuware.github.io/lupine-template-fullstack-note/" />
|
|
11
|
+
<meta property="og:title" content="Lupine Template Fullstack Note (Powered by Lupine.js)" />
|
|
12
|
+
<meta property="og:description" content="Lupine Template Fullstack Note - sign-in and notes kept on the server, for iOS, Android, macOS, Windows and the web: tabs, a side menu, settings, themes, languages. This page is static, without the server. Powered by Lupine.js." />
|
|
13
|
+
<meta property="og:image" content="https://uuware.github.io/lupine-template-fullstack-note/assets/og-image.png" />
|
|
14
|
+
|
|
15
|
+
<!-- Twitter -->
|
|
16
|
+
<meta property="twitter:card" content="summary_large_image" />
|
|
17
|
+
<meta property="twitter:url" content="https://uuware.github.io/lupine-template-fullstack-note/" />
|
|
18
|
+
<meta property="twitter:title" content="Lupine Template Fullstack Note (Powered by Lupine.js)" />
|
|
19
|
+
<meta property="twitter:description" content="Lupine Template Fullstack Note - sign-in and notes kept on the server, for iOS, Android, macOS, Windows and the web: tabs, a side menu, settings, themes, languages. This page is static, without the server. Powered by Lupine.js." />
|
|
20
|
+
<meta property="twitter:image" content="https://uuware.github.io/lupine-template-fullstack-note/assets/og-image.png" />
|
|
21
|
+
|
|
22
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
23
|
+
<!--META-ENV-START-->
|
|
24
|
+
<!--META-ENV-END-->
|
|
25
|
+
<link rel="shortcut icon" href="{SUBDIR}/assets/favicon.ico?t={hash}" type="image/x-icon" />
|
|
26
|
+
<style>
|
|
27
|
+
html,
|
|
28
|
+
body,
|
|
29
|
+
.lupine-root {
|
|
30
|
+
height: 100%;
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
<script defer src="{SUBDIR}/index.js?t={hash}"></script>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<div class="lupine-root"></div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
package/templates/lupine-template-fullstack-note/web/src/lupine-template-fullstack-note/index.tsx
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// lupine.native.core/web first: the storage of the browser, which the controls read when they start
|
|
2
|
+
import { runApp } from 'lupine.native.core/web';
|
|
3
|
+
import { router, Toast } from 'lupine.native.components';
|
|
4
|
+
import { App } from '../../../app/src/app';
|
|
5
|
+
import { messageOf, setNoServer } from '../../../app/src/shell/api';
|
|
6
|
+
|
|
7
|
+
// The copy for GitHub Pages (https://uuware.github.io/lupine-template-fullstack-note/): the app alone, a static page
|
|
8
|
+
// without the server, so sign-in and notes only say that (setNoServer). The address bar follows its pages under the
|
|
9
|
+
// folder of the project; 404.html sends an address that GitHub doesn't have back to this page (?redirect=), and the
|
|
10
|
+
// router opens it. The server of the site only loads this file, so the app starts in the browser.
|
|
11
|
+
if (typeof document === 'object') {
|
|
12
|
+
setNoServer();
|
|
13
|
+
router.followUrl({ paths: true, base: '/lupine-template-fullstack-note' });
|
|
14
|
+
runApp(App, document.querySelector('.lupine-root') as HTMLElement);
|
|
15
|
+
setTimeout(() => Toast.info(messageOf({ status: 'error', code: 'no_server' }), 6000), 800);
|
|
16
|
+
}
|
|
@@ -1,75 +1,101 @@
|
|
|
1
|
-
#-- Auto Created By WebNoCoding at:2015-06-03 16:51:43
|
|
2
|
-
#-- Never name a table with plural (such as "users")
|
|
3
|
-
#-- Never name a table using a reserved keyword (such as "user")
|
|
4
|
-
#-- Never prefix your table name with "tbl" or some other object type prefix
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
package VARCHAR(20) NOT NULL DEFAULT '',
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
CREATE TABLE $__s_menu (
|
|
18
|
-
menuid VARCHAR(50) NOT NULL,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
package VARCHAR(20) NOT NULL DEFAULT '',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
CREATE TABLE $
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
75
|
-
|
|
1
|
+
#-- Auto Created By WebNoCoding at:2015-06-03 16:51:43
|
|
2
|
+
#-- Never name a table with plural (such as "users")
|
|
3
|
+
#-- Never name a table using a reserved keyword (such as "user")
|
|
4
|
+
#-- Never prefix your table name with "tbl" or some other object type prefix
|
|
5
|
+
CREATE TABLE $__s_page (
|
|
6
|
+
pageid VARCHAR(50) NOT NULL,
|
|
7
|
+
name VARCHAR(100) NOT NULL DEFAULT '',
|
|
8
|
+
is_component INTEGER NOT NULL DEFAULT 0,
|
|
9
|
+
remark VARCHAR(250) NOT NULL DEFAULT '',
|
|
10
|
+
package VARCHAR(20) NOT NULL DEFAULT '',
|
|
11
|
+
accesslevel CHAR(1) NOT NULL DEFAULT '0',
|
|
12
|
+
json TEXT NOT NULL DEFAULT '',
|
|
13
|
+
updateduserid INTEGER,
|
|
14
|
+
updatetime INTEGER NOT NULL DEFAULT 0,
|
|
15
|
+
PRIMARY KEY (pageid)
|
|
16
|
+
);
|
|
17
|
+
CREATE TABLE $__s_menu (
|
|
18
|
+
menuid VARCHAR(50) NOT NULL,
|
|
19
|
+
name VARCHAR(100) NOT NULL DEFAULT '',
|
|
20
|
+
remark VARCHAR(250) NOT NULL DEFAULT '',
|
|
21
|
+
package VARCHAR(20) NOT NULL DEFAULT '',
|
|
22
|
+
accesslevel CHAR(1) NOT NULL DEFAULT '0',
|
|
23
|
+
json TEXT NOT NULL DEFAULT '',
|
|
24
|
+
updateduserid INTEGER,
|
|
25
|
+
updatetime INTEGER NOT NULL DEFAULT 0,
|
|
26
|
+
PRIMARY KEY (menuid)
|
|
27
|
+
);
|
|
28
|
+
CREATE TABLE $__s_process (
|
|
29
|
+
processid VARCHAR(50) NOT NULL,
|
|
30
|
+
name VARCHAR(100) NOT NULL DEFAULT '',
|
|
31
|
+
accesslevel CHAR(1) NOT NULL DEFAULT '0',
|
|
32
|
+
json TEXT NOT NULL DEFAULT '',
|
|
33
|
+
package VARCHAR(20) NOT NULL DEFAULT '',
|
|
34
|
+
remark VARCHAR(250) NOT NULL DEFAULT '',
|
|
35
|
+
updatetime INTEGER NOT NULL DEFAULT 0,
|
|
36
|
+
PRIMARY KEY (processid)
|
|
37
|
+
);
|
|
38
|
+
CREATE TABLE $__s_user (
|
|
39
|
+
id INTEGER NOT NULL DEFAULT '0',
|
|
40
|
+
gid INTEGER NOT NULL DEFAULT '1',
|
|
41
|
+
level INTEGER NOT NULL DEFAULT '0',
|
|
42
|
+
nickname VARCHAR(200) NOT NULL DEFAULT '',
|
|
43
|
+
username VARCHAR(150) NOT NULL DEFAULT '',
|
|
44
|
+
email VARCHAR(100) NOT NULL DEFAULT '',
|
|
45
|
+
password VARCHAR(255) NOT NULL DEFAULT '',
|
|
46
|
+
usertype VARCHAR(25) NOT NULL DEFAULT '',
|
|
47
|
+
block CHAR(1) NOT NULL DEFAULT '0',
|
|
48
|
+
sendemail CHAR(1) DEFAULT '0',
|
|
49
|
+
gender VARCHAR(10) DEFAULT '0',
|
|
50
|
+
age INTEGER NOT NULL DEFAULT '0',
|
|
51
|
+
training INTEGER NOT NULL DEFAULT '0',
|
|
52
|
+
preference VARCHAR(100) NOT NULL DEFAULT '',
|
|
53
|
+
registerdate VARCHAR(20) NOT NULL DEFAULT '',
|
|
54
|
+
lastvisitdate VARCHAR(20) NOT NULL DEFAULT '',
|
|
55
|
+
activated CHAR(1) NOT NULL DEFAULT '0',
|
|
56
|
+
activation VARCHAR(40) NOT NULL DEFAULT '',
|
|
57
|
+
points INTEGER NOT NULL DEFAULT '0',
|
|
58
|
+
pwtips VARCHAR(100) DEFAULT '',
|
|
59
|
+
pwretry INTEGER NOT NULL DEFAULT '0',
|
|
60
|
+
pwquestion VARCHAR(100) DEFAULT '',
|
|
61
|
+
pwanswer VARCHAR(100) DEFAULT '',
|
|
62
|
+
PRIMARY KEY (id)
|
|
63
|
+
);
|
|
64
|
+
#-- TABLE:$__st_calendar
|
|
65
|
+
CREATE TABLE $__s_calendar (
|
|
66
|
+
calendarid VARCHAR(50) NOT NULL,
|
|
67
|
+
title VARCHAR(250) NOT NULL DEFAULT '',
|
|
68
|
+
published CHAR(1) NOT NULL DEFAULT '0',
|
|
69
|
+
remark VARCHAR(250),
|
|
70
|
+
monthfrom VARCHAR(6),
|
|
71
|
+
monthto VARCHAR(6),
|
|
72
|
+
bkcolor VARCHAR(7),
|
|
73
|
+
cidstring VARCHAR(50) NOT NULL DEFAULT '',
|
|
74
|
+
PRIMARY KEY (calendarid)
|
|
75
|
+
);
|
|
76
|
+
CREATE TABLE $__s_user_right (
|
|
77
|
+
username VARCHAR(150) NOT NULL,
|
|
78
|
+
rightsid VARCHAR(50) NOT NULL,
|
|
79
|
+
rightsgroup VARCHAR(10) NOT NULL DEFAULT '',
|
|
80
|
+
value TEXT NOT NULL,
|
|
81
|
+
PRIMARY KEY (username, rightsid)
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
CREATE TABLE $__image_folder (
|
|
85
|
+
id INTEGER NOT NULL DEFAULT '0',
|
|
86
|
+
folder_id VARCHAR(10) NOT NULL DEFAULT '',
|
|
87
|
+
display_name VARCHAR(50) NOT NULL DEFAULT '',
|
|
88
|
+
parent_full_path VARCHAR(255) NOT NULL DEFAULT '',
|
|
89
|
+
full_path VARCHAR(255) NOT NULL DEFAULT '',
|
|
90
|
+
PRIMARY KEY (id)
|
|
91
|
+
);
|
|
92
|
+
#-- file_id has extension name
|
|
93
|
+
CREATE TABLE $__image (
|
|
94
|
+
id INTEGER NOT NULL DEFAULT '0',
|
|
95
|
+
file_id VARCHAR(20) NOT NULL DEFAULT '',
|
|
96
|
+
display_name VARCHAR(50) NOT NULL DEFAULT '',
|
|
97
|
+
parent_full_path VARCHAR(255) NOT NULL DEFAULT '',
|
|
98
|
+
version INTEGER NOT NULL DEFAULT '0',
|
|
99
|
+
updatetime INTEGER NOT NULL DEFAULT '0',
|
|
100
|
+
PRIMARY KEY (id)
|
|
101
|
+
);
|
|
@@ -39,6 +39,15 @@ export const setServerAddress = (address: string) => {
|
|
|
39
39
|
base = address.replace(/\/+$/, '');
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
// the copy for GitHub Pages (web/src/lupine-template-fullstack-starter): the app without a server, every call answers
|
|
43
|
+
// that (the app shows the message)
|
|
44
|
+
let noServer = false;
|
|
45
|
+
/** no server: what needs the API says that this is a static page */
|
|
46
|
+
export const setNoServer = () => {
|
|
47
|
+
noServer = true;
|
|
48
|
+
};
|
|
49
|
+
export const noServerText = () => t('api.noServer', 'This is only a static page, without a back-end server: accounts and favourites work in a project made from this template');
|
|
50
|
+
|
|
42
51
|
// a native app only: the token of the session, and the user, so that the app knows it at once and offline
|
|
43
52
|
const TOKEN = 'session';
|
|
44
53
|
const USER = 'user';
|
|
@@ -63,6 +72,7 @@ const forget = () => {
|
|
|
63
72
|
};
|
|
64
73
|
|
|
65
74
|
const call = async (path: string, body?: object): Promise<Answer> => {
|
|
75
|
+
if (noServer) return { status: 'error', message: noServerText() };
|
|
66
76
|
const headers: { [name: string]: string } = { Accept: 'application/json' };
|
|
67
77
|
if (body) headers['Content-Type'] = 'application/json';
|
|
68
78
|
if (native) {
|
|
@@ -69,7 +69,7 @@ addTexts('zh-CN', {
|
|
|
69
69
|
version: '版本',
|
|
70
70
|
},
|
|
71
71
|
about: { tagline: '应用在所有平台上,管理页面在网站上,共用一个 API', text: '使用 lupine.native(应用)、lupine.web(管理页面)和 lupine.api(服务器)构建。' },
|
|
72
|
-
api: { offline: '无法连接服务器', badAnswer: '服务器的回答无法识别({status})', failed: '出错了', done: '完成' },
|
|
72
|
+
api: { noServer: '这只是静态网页,没有后端服务器:用这个模板创建项目后,就能使用账号和收藏', offline: '无法连接服务器', badAnswer: '服务器的回答无法识别({status})', failed: '出错了', done: '完成' },
|
|
73
73
|
});
|
|
74
74
|
// and those of the controls
|
|
75
75
|
addLnTexts({ 'zh-Hans': lnZhHans });
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"html": "web/src/admin/index.html",
|
|
14
14
|
"outdir": "/admin",
|
|
15
15
|
"env": "web"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"index": "web/src/lupine-template-fullstack-starter/index.tsx",
|
|
19
|
+
"html": "web/src/lupine-template-fullstack-starter/index.html",
|
|
20
|
+
"outdir": "/lupine-template-fullstack-starter"
|
|
16
21
|
}
|
|
17
22
|
],
|
|
18
23
|
"apiEntryPoint": "api/src/index.ts",
|
|
@@ -26,6 +31,16 @@
|
|
|
26
31
|
"env": "all",
|
|
27
32
|
"from": "api/resources",
|
|
28
33
|
"to": "data/resources"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"env": "all",
|
|
37
|
+
"from": "web/src/lupine-template-fullstack-starter/assets",
|
|
38
|
+
"to": "web/lupine-template-fullstack-starter/assets"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"env": "all",
|
|
42
|
+
"from": "web/src/lupine-template-fullstack-starter/404.html",
|
|
43
|
+
"to": "web/lupine-template-fullstack-starter/404.html"
|
|
29
44
|
}
|
|
30
45
|
]
|
|
31
46
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Page Not Found</title>
|
|
7
|
+
<style>
|
|
8
|
+
main {
|
|
9
|
+
display: flex;
|
|
10
|
+
height: 100vh;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
.header404 {
|
|
16
|
+
font-size: 48px;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
<script type="text/javascript">
|
|
20
|
+
// Single Page Apps for GitHub Pages, change all "/lupine-template-fullstack-starter/" to your github project name
|
|
21
|
+
if (window.location.pathname.includes('/lupine-template-fullstack-starter/')) {
|
|
22
|
+
window.location.href = '/lupine-template-fullstack-starter/?redirect=' + window.location.pathname;
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<main>
|
|
28
|
+
<h4 class="header404">404</h4>
|
|
29
|
+
<div class="content-404">Uh-oh! We couldn't find the page you are looking for.</div>
|
|
30
|
+
<p>
|
|
31
|
+
<a href="/lupine-template-fullstack-starter/">Check our home page</a>
|
|
32
|
+
</p>
|
|
33
|
+
</main>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Lupine Template Fullstack Starter</title>
|
|
6
|
+
<meta name="description" content="Lupine Template Fullstack Starter - an app with accounts for iOS, Android, macOS, Windows and the web, its API with a database, and an admin site. This page is static, without the server. Powered by Lupine.js." />
|
|
7
|
+
|
|
8
|
+
<!-- Open Graph / Facebook -->
|
|
9
|
+
<meta property="og:type" content="website" />
|
|
10
|
+
<meta property="og:url" content="https://uuware.github.io/lupine-template-fullstack-starter/" />
|
|
11
|
+
<meta property="og:title" content="Lupine Template Fullstack Starter (Powered by Lupine.js)" />
|
|
12
|
+
<meta property="og:description" content="Lupine Template Fullstack Starter - an app with accounts for iOS, Android, macOS, Windows and the web, its API with a database, and an admin site. This page is static, without the server. Powered by Lupine.js." />
|
|
13
|
+
<meta property="og:image" content="https://uuware.github.io/lupine-template-fullstack-starter/assets/og-image.png" />
|
|
14
|
+
|
|
15
|
+
<!-- Twitter -->
|
|
16
|
+
<meta property="twitter:card" content="summary_large_image" />
|
|
17
|
+
<meta property="twitter:url" content="https://uuware.github.io/lupine-template-fullstack-starter/" />
|
|
18
|
+
<meta property="twitter:title" content="Lupine Template Fullstack Starter (Powered by Lupine.js)" />
|
|
19
|
+
<meta property="twitter:description" content="Lupine Template Fullstack Starter - an app with accounts for iOS, Android, macOS, Windows and the web, its API with a database, and an admin site. This page is static, without the server. Powered by Lupine.js." />
|
|
20
|
+
<meta property="twitter:image" content="https://uuware.github.io/lupine-template-fullstack-starter/assets/og-image.png" />
|
|
21
|
+
|
|
22
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
23
|
+
<!--META-ENV-START-->
|
|
24
|
+
<!--META-ENV-END-->
|
|
25
|
+
<link rel="shortcut icon" href="{SUBDIR}/assets/favicon.ico?t={hash}" type="image/x-icon" />
|
|
26
|
+
<style>
|
|
27
|
+
html,
|
|
28
|
+
body,
|
|
29
|
+
.lupine-root {
|
|
30
|
+
height: 100%;
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
<script defer src="{SUBDIR}/index.js?t={hash}"></script>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<div class="lupine-root"></div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// lupine.native.core/web first: the storage of the browser, which the controls read when they start
|
|
2
|
+
import { runApp } from 'lupine.native.core/web';
|
|
3
|
+
import { router, Toast } from 'lupine.native.components';
|
|
4
|
+
import { App } from '../../../app/src/app';
|
|
5
|
+
import { noServerText, setNoServer } from '../../../app/src/shell/api';
|
|
6
|
+
|
|
7
|
+
// The copy for GitHub Pages (https://uuware.github.io/lupine-template-fullstack-starter/): the app alone, a static page
|
|
8
|
+
// without the server, so what needs the API only says that (setNoServer); the admin pages are not in it. The address
|
|
9
|
+
// bar follows its pages under the folder of the project; 404.html sends an address that GitHub doesn't have back to
|
|
10
|
+
// this page (?redirect=), and the router opens it. The server of the site only loads this file, so the app starts in
|
|
11
|
+
// the browser.
|
|
12
|
+
if (typeof document === 'object') {
|
|
13
|
+
setNoServer();
|
|
14
|
+
router.followUrl({ paths: true, base: '/lupine-template-fullstack-starter' });
|
|
15
|
+
runApp(App, document.querySelector('.lupine-root') as HTMLElement);
|
|
16
|
+
setTimeout(() => Toast.info(noServerText(), 6000), 800);
|
|
17
|
+
}
|