test-bdk-cli 0.1.14 → 0.1.16
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 +2 -2
- package/dist/commands/create.js +18 -4
- package/dist/commands/test.js +11 -4
- package/package.json +1 -1
- package/templates/default/README.md +14 -0
- package/templates/{react → default}/manifest.json +2 -2
- package/templates/{react → default}/package.json +2 -2
- package/dist/sample-react-app-0.1.0.zip +0 -0
- package/templates/react/README.md +0 -3
- /package/templates/{react → default}/assets/iframe.html +0 -0
- /package/templates/{react → default}/assets/logo-small.svg +0 -0
- /package/templates/{react → default}/assets/logo.svg +0 -0
- /package/templates/{react → default}/translations/en.json +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# App template
|
|
2
2
|
|
|
3
|
-
This is a minimal
|
|
3
|
+
This is a minimal template for apps. Use `bdk apps:new my-app` to scaffold.
|
package/dist/commands/create.js
CHANGED
|
@@ -17,7 +17,7 @@ function registerCreate(program) {
|
|
|
17
17
|
program
|
|
18
18
|
.command('apps:new [appDirectories...]')
|
|
19
19
|
.description('Scaffold one or more new app projects (usage: apps:new ./appName)')
|
|
20
|
-
.option('--template <template>', 'template name', '
|
|
20
|
+
.option('--template <template>', 'template name', 'default')
|
|
21
21
|
.option('--path <dir>', 'base path for created directories', '.')
|
|
22
22
|
.option('--force', 'overwrite if exists', false)
|
|
23
23
|
.option('--git', 'initialize a git repository', false)
|
|
@@ -55,7 +55,7 @@ function registerCreate(program) {
|
|
|
55
55
|
}
|
|
56
56
|
appDirectories = collected.length ? collected : ['.'];
|
|
57
57
|
}
|
|
58
|
-
const template = opts.template || '
|
|
58
|
+
const template = opts.template || 'default';
|
|
59
59
|
const basePath = path_1.default.resolve(opts.path || '.');
|
|
60
60
|
// flatten nested array if commander wrapped variadic into single array
|
|
61
61
|
if (Array.isArray(appDirectories) && appDirectories.length === 1 && Array.isArray(appDirectories[0])) {
|
|
@@ -160,8 +160,22 @@ function registerCreate(program) {
|
|
|
160
160
|
if (!fs_1.default.existsSync(manifestPath)) {
|
|
161
161
|
const defaultManifest = {
|
|
162
162
|
name: appName,
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
author: {
|
|
164
|
+
name: '',
|
|
165
|
+
email: ''
|
|
166
|
+
},
|
|
167
|
+
defaultLocale: 'en',
|
|
168
|
+
private: true,
|
|
169
|
+
location: {
|
|
170
|
+
support: {
|
|
171
|
+
ticket_sidebar: {
|
|
172
|
+
url: 'assets/iframe.html',
|
|
173
|
+
flexible: true
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
version: '1.0.0',
|
|
178
|
+
frameworkVersion: '2.0',
|
|
165
179
|
description: '',
|
|
166
180
|
main: 'dist/index.html',
|
|
167
181
|
permissions: []
|
package/dist/commands/test.js
CHANGED
|
@@ -10,10 +10,17 @@ function registerTest(program) {
|
|
|
10
10
|
.option('--watch', 're-run tests on file changes', false)
|
|
11
11
|
.option('--coverage', 'generate coverage report', false)
|
|
12
12
|
.action((sourceArg, opts) => {
|
|
13
|
-
const
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const cwd = path.resolve(process.cwd(), sourceArg || '.');
|
|
16
|
+
// Check if package.json exists and has test script
|
|
17
|
+
const pkgPath = path.join(cwd, 'package.json');
|
|
14
18
|
const hasPkg = (() => {
|
|
15
19
|
try {
|
|
16
|
-
|
|
20
|
+
if (!fs.existsSync(pkgPath)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const p = require(pkgPath);
|
|
17
24
|
return !!p.scripts && (p.scripts.test || p.scripts['test:watch']);
|
|
18
25
|
}
|
|
19
26
|
catch (e) {
|
|
@@ -28,7 +35,7 @@ function registerTest(program) {
|
|
|
28
35
|
// prefer npm run test -- --watch if available
|
|
29
36
|
try {
|
|
30
37
|
console.log('Running tests in watch mode...');
|
|
31
|
-
const child = (0, child_process_1.spawn)('npm', ['run', 'test', '--', '--watch'], { stdio: 'inherit', cwd:
|
|
38
|
+
const child = (0, child_process_1.spawn)('npm', ['run', 'test', '--', '--watch'], { stdio: 'inherit', cwd: cwd, shell: true });
|
|
32
39
|
child.on('exit', (code) => process.exit(code || 0));
|
|
33
40
|
}
|
|
34
41
|
catch (e) {
|
|
@@ -44,7 +51,7 @@ function registerTest(program) {
|
|
|
44
51
|
args.push('--', '--coverage');
|
|
45
52
|
}
|
|
46
53
|
console.log('Running tests...');
|
|
47
|
-
(0, child_process_1.execSync)('npm ' + args.join(' '), { stdio: 'inherit', cwd:
|
|
54
|
+
(0, child_process_1.execSync)('npm ' + args.join(' '), { stdio: 'inherit', cwd: cwd });
|
|
48
55
|
}
|
|
49
56
|
catch (e) {
|
|
50
57
|
console.error('Tests failed.');
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# App name
|
|
2
|
+
|
|
3
|
+
[brief description of the app]
|
|
4
|
+
|
|
5
|
+
### The following information is displayed:
|
|
6
|
+
|
|
7
|
+
* info1
|
|
8
|
+
* info2
|
|
9
|
+
* info3
|
|
10
|
+
|
|
11
|
+
Please submit bug reports to [Insert Link](). Pull requests are welcome.
|
|
12
|
+
|
|
13
|
+
### Screenshot(s):
|
|
14
|
+
[put your screenshots down here.]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "sample-
|
|
2
|
+
"name": "sample-app",
|
|
3
3
|
"author": {
|
|
4
4
|
"name": "Your Name",
|
|
5
5
|
"email": ""
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"version": "1.0.0",
|
|
18
18
|
"frameworkVersion": "2.0",
|
|
19
|
-
"description": "A sample
|
|
19
|
+
"description": "A sample Node.js BoldDesk app",
|
|
20
20
|
"main": "dist/index.html",
|
|
21
21
|
"permissions": []
|
|
22
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "sample-
|
|
2
|
+
"name": "sample-app",
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
-
"description": "Sample
|
|
4
|
+
"description": "Sample app scaffolded by bdk",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "echo \"No start script defined\" && exit 0",
|
|
7
7
|
"build": "echo \"No build script defined\" && exit 0",
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|