create-steedos-app 2.2.52-beta.34 → 2.2.52-beta.38
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/LICENSE.txt +0 -2
- package/README.md +16 -27
- package/dist/create-app.d.ts +10 -0
- package/dist/default/README-template.md +27 -0
- package/dist/default/env +35 -0
- package/dist/default/gitignore +17 -0
- package/dist/default/steedos-app/main/default/client/analytics.baidu.client.js +24 -0
- package/dist/default/steedos-app/package.json +6 -0
- package/dist/default/steedos-app/package.service.js +69 -0
- package/dist/default/steedos.config.js +18 -0
- package/dist/gitignore +17 -0
- package/dist/helpers/examples.d.ts +12 -0
- package/dist/helpers/get-pkg-manager.d.ts +2 -0
- package/dist/helpers/git.d.ts +1 -0
- package/dist/helpers/install.d.ts +22 -0
- package/dist/helpers/is-folder-empty.d.ts +1 -0
- package/dist/helpers/is-online.d.ts +1 -0
- package/dist/helpers/is-writeable.d.ts +1 -0
- package/dist/helpers/make-dir.d.ts +3 -0
- package/dist/helpers/validate-pkg.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +56 -56
- package/package.json +2 -2
package/LICENSE.txt
CHANGED
|
@@ -11,8 +11,6 @@ If the file has no header, the following rules apply
|
|
|
11
11
|
|
|
12
12
|
On request, licenses under different terms are available.
|
|
13
13
|
|
|
14
|
-
Project templates can be found in the folders steedos-projects/
|
|
15
|
-
|
|
16
14
|
Source code of enterprise features are files that
|
|
17
15
|
* are in folders named "ee" or start with "ee_", or in subfolders of such folders.
|
|
18
16
|
* contain the strings "ee_" in its filename name.
|
package/README.md
CHANGED
|
@@ -1,51 +1,40 @@
|
|
|
1
1
|
# Create Steedos App
|
|
2
2
|
|
|
3
|
-
The easiest way to get started with
|
|
3
|
+
The easiest way to get started with Steedos Platform is by using `create-steedos-app`. This CLI tool enables you to quickly start building a new steedos application, with everything set up for you. You can create a new app using the default steedos template, or by using one of the [official Steedos examples](https://github.com/steedos/steedos-platform/tree/master/examples). To get started, use the following command:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx create-steedos-app@latest
|
|
7
7
|
# or
|
|
8
|
-
yarn create
|
|
8
|
+
yarn create steedos-app
|
|
9
9
|
# or
|
|
10
|
-
pnpm create
|
|
10
|
+
pnpm create steedos-app
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
To create a new app in a specific folder, you can send a name as an argument. For example, the following command will create a new Steedos app called `contract-app` in a folder with the same name:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx create-steedos-app@latest
|
|
16
|
+
npx create-steedos-app@latest contract-app
|
|
17
17
|
# or
|
|
18
|
-
yarn create
|
|
18
|
+
yarn create steedos-app contract-app
|
|
19
19
|
# or
|
|
20
|
-
pnpm create
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
To create a new app in a specific folder, you can send a name as an argument. For example, the following command will create a new Next.js app called `blog-app` in a folder with the same name:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npx create-steedos-app@latest blog-app
|
|
27
|
-
# or
|
|
28
|
-
yarn create next-app blog-app
|
|
29
|
-
# or
|
|
30
|
-
pnpm create next-app blog-app
|
|
20
|
+
pnpm create steedos-app contract-app
|
|
31
21
|
```
|
|
32
22
|
|
|
33
23
|
## Options
|
|
34
24
|
|
|
35
25
|
`create-steedos-app` comes with the following options:
|
|
36
26
|
|
|
37
|
-
-
|
|
38
|
-
- **-e, --example [name]|[github-url]** - An example to bootstrap the app with. You can use an example name from the [Next.js repo](https://github.com/vercel/next.js/tree/canary/examples) or a GitHub URL. The URL can use any branch and/or subdirectory.
|
|
27
|
+
- **-e, --example [name]|[github-url]** - An example to bootstrap the app with. You can use an example name from the [Steedos Platform repo](https://github.com/steedos/steedos-platform/tree/master/examples) or a GitHub URL. The URL can use any branch and/or subdirectory.
|
|
39
28
|
- **--example-path <path-to-example>** - In a rare case, your GitHub URL might contain a branch name with a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar). In this case, you must specify the path to the example separately: `--example-path foo/bar`
|
|
40
|
-
- **--use-npm** - Explicitly tell the CLI to bootstrap the app using npm. To bootstrap using yarn we recommend to run `yarn create
|
|
41
|
-
- **--use-pnpm** - Explicitly tell the CLI to bootstrap the app using pnpm. To bootstrap using pnpm we recommend running `pnpm create
|
|
29
|
+
- **--use-npm** - Explicitly tell the CLI to bootstrap the app using npm. To bootstrap using yarn we recommend to run `yarn create steedos-app`
|
|
30
|
+
- **--use-pnpm** - Explicitly tell the CLI to bootstrap the app using pnpm. To bootstrap using pnpm we recommend running `pnpm create steedos-app`
|
|
42
31
|
|
|
43
|
-
## Why use Create
|
|
32
|
+
## Why use Create Steedos App?
|
|
44
33
|
|
|
45
|
-
`create-steedos-app` allows you to create a new
|
|
34
|
+
`create-steedos-app` allows you to create a new Steedos Platform app within seconds. It is officially maintained by the creators of Steedos Platform, and includes a number of benefits:
|
|
46
35
|
|
|
47
36
|
- **Interactive Experience**: Running `npx create-steedos-app` (with no arguments) launches an interactive experience that guides you through setting up a project.
|
|
48
|
-
- **Zero Dependencies**: Initializing a project is as quick as one second. Create
|
|
49
|
-
- **Offline Support**: Create
|
|
50
|
-
- **Support for Examples**: Create
|
|
51
|
-
- **Tested**: The package is part of the
|
|
37
|
+
- **Zero Dependencies**: Initializing a project is as quick as one second. Create Steedos App has zero dependencies.
|
|
38
|
+
- **Offline Support**: Create Steedos App will automatically detect if you're offline and bootstrap your project using your local package cache.
|
|
39
|
+
- **Support for Examples**: Create Steedos App can bootstrap your application using an example from the Steedos Platform examples collection (e.g. `npx create-steedos-app --example api-routes`).
|
|
40
|
+
- **Tested**: The package is part of the Steedos Platform monorepo and tested using the same integration test suite as Steedos Platform itself, ensuring it works as expected with every release.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PackageManager } from './helpers/get-pkg-manager';
|
|
2
|
+
export declare class DownloadError extends Error {
|
|
3
|
+
}
|
|
4
|
+
export declare function createApp({ appPath, packageManager, example, examplePath, typescript, }: {
|
|
5
|
+
appPath: string;
|
|
6
|
+
packageManager: PackageManager;
|
|
7
|
+
example?: string;
|
|
8
|
+
examplePath?: string;
|
|
9
|
+
typescript?: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
This is a [Steedos](https://www.steedos.com/) project bootstrapped with [`create-steedos-app`](https://github.com/steedos/steedos-platform/tree/master/packages/create-steedos-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run start
|
|
9
|
+
# or
|
|
10
|
+
yarn start
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
14
|
+
|
|
15
|
+
## Learn More
|
|
16
|
+
|
|
17
|
+
To learn more about Steedos Platform, take a look at the following resources:
|
|
18
|
+
|
|
19
|
+
- [Steedos Documentation](https://www.steedos.com/docs) - learn about Steedos features and API.
|
|
20
|
+
|
|
21
|
+
You can check out [the Steedos GitHub repository](https://github.com/steedos/steedos-platform/) - your feedback and contributions are welcome!
|
|
22
|
+
|
|
23
|
+
## Deploy your project
|
|
24
|
+
|
|
25
|
+
The easiest way to deploy your Steedos app is to use the [Docker Template](https://github.com/steedos/docker).
|
|
26
|
+
|
|
27
|
+
Check out our [Steedos deployment documentation](https://www.steedos.com/docs/deploy/getting-started) for more details.
|
package/dist/default/env
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
PORT=5000
|
|
2
|
+
ROOT_URL=http://127.0.0.1:5000
|
|
3
|
+
TRANSPORTER=redis://127.0.0.1:6379
|
|
4
|
+
CACHER=redis://127.0.0.1:6379/1
|
|
5
|
+
MONGO_URL=mongodb://127.0.0.1:27017/steedos
|
|
6
|
+
MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local
|
|
7
|
+
|
|
8
|
+
STEEDOS_CFS_STORE=local
|
|
9
|
+
STEEDOS_STORAGE_DIR=./storage
|
|
10
|
+
|
|
11
|
+
# 身份验证
|
|
12
|
+
STEEDOS_TENANT_ENABLE_PASSWORD_LOGIN=true
|
|
13
|
+
STEEDOS_TENANT_TOKEN_SECRET=change-me
|
|
14
|
+
|
|
15
|
+
# 启用云端初始化向导
|
|
16
|
+
STEEDOS_TENANT_ENABLE_ACTIVATION=true
|
|
17
|
+
|
|
18
|
+
# 绑定华炎云账户
|
|
19
|
+
STEEDOS_CLOUD_API_KEY=
|
|
20
|
+
STEEDOS_CLOUD_SPACE_ID=
|
|
21
|
+
|
|
22
|
+
# vscode 代码同步
|
|
23
|
+
METADATA_SERVER=
|
|
24
|
+
METADATA_APIKEY=
|
|
25
|
+
|
|
26
|
+
# CDN in china, default is https://unpkg.com
|
|
27
|
+
STEEDOS_UNPKG_URL=https://npm.elemecdn.com
|
|
28
|
+
STEEDOS_PUBLIC_PAGE_ASSETURLS=https://unpkg.com/@steedos-ui/builder-widgets@2.2.32/dist/assets.json
|
|
29
|
+
|
|
30
|
+
SSO_OIDC_CONFIG_URL=
|
|
31
|
+
SSO_OIDC_CLIENT_ID=
|
|
32
|
+
SSO_OIDC_CLIENT_SECRET=
|
|
33
|
+
SSO_OIDC_NAME=
|
|
34
|
+
SSO_OIDC_LOGO=
|
|
35
|
+
SSO_OIDC_REQUIRE_LOCAL_ACCOUNT=false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
**/.DS_Store
|
|
4
|
+
|
|
5
|
+
**/node_modules
|
|
6
|
+
|
|
7
|
+
.npmrc
|
|
8
|
+
.yarnrc
|
|
9
|
+
**/npm-error.log
|
|
10
|
+
**/yarn-error.log
|
|
11
|
+
**/lerna-debug.log
|
|
12
|
+
|
|
13
|
+
storage
|
|
14
|
+
dist
|
|
15
|
+
logs
|
|
16
|
+
|
|
17
|
+
.env.local
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var _hmt = _hmt || [];
|
|
2
|
+
(function() {
|
|
3
|
+
try {
|
|
4
|
+
var hm = document.createElement("script");
|
|
5
|
+
hm.src = "https://hm.baidu.com/hm.js?6bdb41ab7e3b884e6dfdd331bcdd2622";
|
|
6
|
+
var s = document.getElementsByTagName("script")[0];
|
|
7
|
+
s.parentNode.insertBefore(hm, s);
|
|
8
|
+
} catch (error) {
|
|
9
|
+
console.log(error);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
Meteor.startup(function(){
|
|
14
|
+
Tracker.autorun(function() {
|
|
15
|
+
FlowRouter.watchPathChange();
|
|
16
|
+
if (FlowRouter.current().path) {
|
|
17
|
+
window._hmt.push(['_trackPageview', FlowRouter.current().path]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
})
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.log(error);
|
|
23
|
+
}
|
|
24
|
+
})();
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const project = require('./package.json');
|
|
3
|
+
const packageName = project.name;
|
|
4
|
+
const packageLoader = require('@steedos/service-package-loader');
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('moleculer').Context} Context Moleculer's Context
|
|
7
|
+
* 软件包服务启动后也需要抛出事件。
|
|
8
|
+
*/
|
|
9
|
+
module.exports = {
|
|
10
|
+
name: packageName,
|
|
11
|
+
namespace: "steedos",
|
|
12
|
+
mixins: [packageLoader],
|
|
13
|
+
/**
|
|
14
|
+
* Settings
|
|
15
|
+
*/
|
|
16
|
+
settings: {
|
|
17
|
+
packageInfo: {
|
|
18
|
+
path: __dirname,
|
|
19
|
+
name: packageName
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Dependencies
|
|
25
|
+
*/
|
|
26
|
+
dependencies: [],
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Actions
|
|
30
|
+
*/
|
|
31
|
+
actions: {
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Events
|
|
37
|
+
*/
|
|
38
|
+
events: {
|
|
39
|
+
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Methods
|
|
44
|
+
*/
|
|
45
|
+
methods: {
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Service created lifecycle event handler
|
|
51
|
+
*/
|
|
52
|
+
async created() {
|
|
53
|
+
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Service started lifecycle event handler
|
|
58
|
+
*/
|
|
59
|
+
async started() {
|
|
60
|
+
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Service stopped lifecycle event handler
|
|
65
|
+
*/
|
|
66
|
+
async stopped() {
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// Namespace of nodes to segment your nodes on the same network.
|
|
3
|
+
namespace: "steedos",
|
|
4
|
+
// Default log level for built-in console logger. It can be overwritten in logger options above.
|
|
5
|
+
// Available values: trace, debug, info, warn, error, fatal
|
|
6
|
+
logLevel: "warn",
|
|
7
|
+
|
|
8
|
+
// Called after broker started.
|
|
9
|
+
started(broker) {
|
|
10
|
+
// 启动 元数据服务
|
|
11
|
+
broker.createService(require("@steedos/service-metadata-server"));
|
|
12
|
+
// 启动 加载软件包服务
|
|
13
|
+
broker.createService(require("@steedos/service-package-registry"));
|
|
14
|
+
// 启动 meteor服务
|
|
15
|
+
broker.createService(require("@steedos/service-steedos-server"));
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
};
|
package/dist/gitignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
**/.DS_Store
|
|
4
|
+
|
|
5
|
+
**/node_modules
|
|
6
|
+
|
|
7
|
+
.npmrc
|
|
8
|
+
.yarnrc
|
|
9
|
+
**/npm-error.log
|
|
10
|
+
**/yarn-error.log
|
|
11
|
+
**/lerna-debug.log
|
|
12
|
+
|
|
13
|
+
storage
|
|
14
|
+
dist
|
|
15
|
+
logs
|
|
16
|
+
|
|
17
|
+
.env.local
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare type RepoInfo = {
|
|
2
|
+
username: string;
|
|
3
|
+
name: string;
|
|
4
|
+
branch: string;
|
|
5
|
+
filePath: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function isUrlOk(url: string): Promise<boolean>;
|
|
8
|
+
export declare function getRepoInfo(url: URL, examplePath?: string): Promise<RepoInfo | undefined>;
|
|
9
|
+
export declare function hasRepo({ username, name, branch, filePath, }: RepoInfo): Promise<boolean>;
|
|
10
|
+
export declare function existsInRepo(nameOrUrl: string): Promise<boolean>;
|
|
11
|
+
export declare function downloadAndExtractRepo(root: string, { username, name, branch, filePath }: RepoInfo): Promise<void>;
|
|
12
|
+
export declare function downloadAndExtractExample(root: string, name: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tryGitInit(root: string): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PackageManager } from './get-pkg-manager';
|
|
2
|
+
interface InstallArgs {
|
|
3
|
+
/**
|
|
4
|
+
* Indicate whether to install packages using npm, pnpm or Yarn.
|
|
5
|
+
*/
|
|
6
|
+
packageManager: PackageManager;
|
|
7
|
+
/**
|
|
8
|
+
* Indicate whether there is an active Internet connection.
|
|
9
|
+
*/
|
|
10
|
+
isOnline: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Indicate whether the given dependencies are devDependencies.
|
|
13
|
+
*/
|
|
14
|
+
devDependencies?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Spawn a package manager installation with either Yarn or NPM.
|
|
18
|
+
*
|
|
19
|
+
* @returns A Promise that resolves once the installation is finished.
|
|
20
|
+
*/
|
|
21
|
+
export declare function install(root: string, dependencies: string[] | null, { packageManager, isOnline, devDependencies }: InstallArgs): Promise<void>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isFolderEmpty(root: string, name: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getOnline(): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isWriteable(directory: string): Promise<boolean>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|