create-nocobase-app 0.7.0-alpha.6 → 0.7.0-alpha.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nocobase-app",
3
- "version": "0.7.0-alpha.6",
3
+ "version": "0.7.0-alpha.9",
4
4
  "main": "src/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "licenses": [
@@ -25,5 +25,5 @@
25
25
  "url": "git+https://github.com/nocobase/nocobase.git",
26
26
  "directory": "packages/core/create-nocobase-app"
27
27
  },
28
- "gitHead": "7d0087cbb3b7663ba05366ca3b80db2853669ee9"
28
+ "gitHead": "79d5b309fb92148162bfedfb7e304b4673faf568"
29
29
  }
package/src/create-app.js CHANGED
@@ -9,6 +9,7 @@ const { join, resolve } = require('path');
9
9
  const createEnvFile = require('./resources/templates/env');
10
10
  const createPackageJson = require('./resources/templates/package.json.js');
11
11
  const createServerPackageJson = require('./resources/templates/server.package.json.js');
12
+ const createClientPackageJson = require('./resources/templates/client.package.json.js');
12
13
  const loadSrcFromNpm = require('./resources/templates/load-src-from-npm');
13
14
 
14
15
  let envs = undefined;
@@ -135,6 +136,17 @@ async function createApp(directory, options) {
135
136
  },
136
137
  );
137
138
 
139
+ // write client package.json
140
+ await fse.writeJson(
141
+ join(projectPath, 'packages/app/client/package.json'),
142
+ createClientPackageJson({
143
+ projectPath,
144
+ }),
145
+ {
146
+ spaces: 2,
147
+ },
148
+ );
149
+
138
150
  // run install command
139
151
  console.log('finished');
140
152
  }
@@ -8,9 +8,7 @@
8
8
  "allowJs": true,
9
9
  "module": "commonjs",
10
10
  "target": "es6",
11
- "paths": {
12
- "@nocobase/*": ["./packages/*/src"]
13
- }
11
+ "paths": {}
14
12
  },
15
13
  "exclude": ["./packages/*/esm", "./packages/*/lib"]
16
14
  }
@@ -16,8 +16,6 @@
16
16
  "experimentalDecorators": true,
17
17
  "downlevelIteration": true,
18
18
  "baseUrl": ".",
19
- "paths": {
20
- "@nocobase/*": ["packages/*/src"]
21
- }
19
+ "paths": {}
22
20
  }
23
21
  }
@@ -0,0 +1,16 @@
1
+ const path = require('path');
2
+
3
+ module.exports = (opts) => {
4
+ const { projectPath } = opts;
5
+ const templateJsonPath = path.join(projectPath, 'packages/app/client/package.json');
6
+ const templateJson = require(templateJsonPath);
7
+
8
+ return {
9
+ ...templateJson,
10
+ name: 'app-client',
11
+ version: '0.1.0',
12
+ dependencies: {
13
+ ...templateJson.dependencies,
14
+ },
15
+ };
16
+ };
@@ -12,6 +12,7 @@ module.exports = (opts) => {
12
12
  clean: 'rimraf -rf packages/{app,plugins}/*/{lib,esm,dist} && lerna clean',
13
13
  nocobase:
14
14
  'cross-env DOTENV_CONFIG_PATH=.env ts-node-dev -r dotenv/config -r tsconfig-paths/register ./packages/app/server/src/index.ts',
15
+ 'nocobase-prod': 'cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js',
15
16
  'start-client': 'cd packages/app/client && npm run start',
16
17
  'start-server': 'npm run nocobase start',
17
18
  build: 'lerna run build',
@@ -27,7 +27,7 @@ module.exports = (opts) => {
27
27
 
28
28
  return {
29
29
  ...templateJson,
30
- name: 'server',
30
+ name: 'app-server',
31
31
  version: '0.1.0',
32
32
  main: 'index.js',
33
33
  dependencies: {