test-bdk-cli 0.1.9 → 0.1.11

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.
@@ -30,11 +30,13 @@ function registerPack(program) {
30
30
  if (fs_1.default.existsSync(schemaPath)) {
31
31
  const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf8'));
32
32
  const schema = JSON.parse(fs_1.default.readFileSync(schemaPath, 'utf8'));
33
- const ajv = new ajv_1.default({ allowUnionTypes: true });
33
+ const ajv = new ajv_1.default({ allowUnionTypes: true, allErrors: true });
34
34
  const validate = ajv.compile(schema);
35
35
  const valid = validate(manifest);
36
36
  if (!valid) {
37
- console.error('Manifest validation failed:', validate.errors);
37
+ const errs = (validate.errors || []).map((e) => `${(e === null || e === void 0 ? void 0 : e.instancePath) || '/'}: ${e === null || e === void 0 ? void 0 : e.message}`).join('\n');
38
+ console.error(`Manifest validation failed for ${manifestPath}:\n${errs}`);
39
+ console.error(`Suggestions: ensure 'version' is a valid semver (e.g. 0.1.0), or run 'bdk apps:version <source> --set 0.1.0'. To skip validation: use '--no-validate'.`);
38
40
  process.exit(2);
39
41
  }
40
42
  }
@@ -4,15 +4,16 @@ exports.registerTest = registerTest;
4
4
  const child_process_1 = require("child_process");
5
5
  function registerTest(program) {
6
6
  program
7
- .command('test')
7
+ .command('test [source]')
8
8
  .alias('apps:test')
9
9
  .description('Run unit and integration tests')
10
10
  .option('--watch', 're-run tests on file changes', false)
11
11
  .option('--coverage', 'generate coverage report', false)
12
- .action((opts) => {
12
+ .action((sourceArg, opts) => {
13
+ const cwd = require('path').resolve(process.cwd(), sourceArg || '.');
13
14
  const hasPkg = (() => {
14
15
  try {
15
- const p = require(process.cwd() + '/package.json');
16
+ const p = require(cwd + '/package.json');
16
17
  return !!p.scripts && (p.scripts.test || p.scripts['test:watch']);
17
18
  }
18
19
  catch (e) {
@@ -25,15 +25,15 @@ function bumpVersion(v, level) {
25
25
  }
26
26
  function registerVersion(program) {
27
27
  program
28
- .command('version')
28
+ .command('version [source]')
29
29
  .alias('apps:version')
30
30
  .description('Show or bump app version')
31
31
  .option('--bump <level>', 'patch|minor|major')
32
32
  .option('--set <version>', 'set exact version')
33
- .action((opts) => {
34
- const manifestPath = path_1.default.resolve(process.cwd(), 'manifest.json');
33
+ .action((sourceArg, opts) => {
34
+ const manifestPath = path_1.default.resolve(process.cwd(), sourceArg || '.', 'manifest.json');
35
35
  if (!fs_1.default.existsSync(manifestPath)) {
36
- console.error('manifest.json not found in current directory.');
36
+ console.error('manifest.json not found at', manifestPath);
37
37
  process.exit(1);
38
38
  }
39
39
  const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf8'));
@@ -38,6 +38,6 @@ async function validatePkg(appPath) {
38
38
  const valid = validate(manifest);
39
39
  if (!valid) {
40
40
  const errs = (validate.errors || []).map((e) => `${(e === null || e === void 0 ? void 0 : e.instancePath) || '/'}: ${e === null || e === void 0 ? void 0 : e.message}`).join('\n');
41
- throw new Error(`Validation errors:\n${errs}`);
41
+ throw new Error(`Validation errors in ${manifestPath}:\n${errs}`);
42
42
  }
43
43
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-bdk-cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "test CLI",
5
5
  "author": "@raisulaslam",
6
6
  "bin": {
@@ -0,0 +1,3 @@
1
+ # React template
2
+
3
+ This is a minimal sample React template for `bdk apps:new --template react`.
@@ -0,0 +1,13 @@
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" />
6
+ <title>Sample Iframe</title>
7
+ <style>body{font-family:Arial,Helvetica,sans-serif;padding:20px}</style>
8
+ </head>
9
+ <body>
10
+ <h1>Hello from the app iframe</h1>
11
+ <p>This is a simple placeholder iframe page generated by the CLI.</p>
12
+ </body>
13
+ </html>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="8" fill="#0b6c6c" />
3
+ <rect x="12" y="12" width="40" height="40" rx="6" fill="#fff" />
4
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240">
2
+ <rect width="240" height="240" rx="24" fill="#0b6c6c" />
3
+ <g fill="#fff" transform="translate(40,40)">
4
+ <rect x="0" y="0" width="160" height="160" rx="12" />
5
+ </g>
6
+ </svg>
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "sample-react-app",
3
+ "version": "0.1.0",
4
+ "author": "Your Name",
5
+ "description": "A sample React BoldDesk app",
6
+ "main": "dist/index.html",
7
+ "permissions": []
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "app": {
3
+ "name": "Zen Tunes",
4
+ "short_description": "Play the famous zen tunes in your help desk.",
5
+ "long_description": "Play the famous zen tunes in your help desk and \n listen to the beats it has to offer.",
6
+ "installation_instructions": "Simply click install."
7
+ }
8
+ }