@appsemble/cli 0.22.9 → 0.23.0

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 CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.22.9/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.23.0/config/assets/logo.svg) Appsemble CLI
2
2
 
3
3
  > Manage apps and blocks from the command line.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/cli)](https://www.npmjs.com/package/@appsemble/cli)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.22.9/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.22.9)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.23.0/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.23.0)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
9
  ## Table of Contents
@@ -282,5 +282,5 @@ appsemble run-cronjobs --interval 30
282
282
 
283
283
  ## License
284
284
 
285
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.22.9/LICENSE.md) ©
285
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.23.0/LICENSE.md) ©
286
286
  [Appsemble](https://appsemble.com)
package/lib/block.test.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { resolveFixture } from '@appsemble/node-utils';
2
2
  import concat from 'concat-stream';
3
+ import { describe, expect, it } from 'vitest';
3
4
  import { makePayload } from './block.js';
4
5
  describe('makePayload', () => {
5
6
  it('should create a form-data payload', async () => {
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { coerceRemote } from './coercers.js';
2
3
  describe('coerceRemote', () => {
3
4
  const tests = [
@@ -1,4 +1,4 @@
1
- import { bodyParser, conditional, errorMiddleware, frontend, loggerMiddleware, parameters, serializer, version, } from '@appsemble/node-utils';
1
+ import { bodyParser, conditional, errorMiddleware, frontend, loggerMiddleware, parameters, serializer, throwKoaError, version, } from '@appsemble/node-utils';
2
2
  import { api } from '@appsemble/utils';
3
3
  import cors from '@koa/cors';
4
4
  import Koa from 'koa';
@@ -46,13 +46,7 @@ export function createApiServer({ context }) {
46
46
  ]),
47
47
  (ctx, next) => {
48
48
  if (ctx.path.startsWith('/api/')) {
49
- ctx.response.status = 404;
50
- ctx.response.body = {
51
- statusCode: 404,
52
- error: 'Not Found',
53
- message: 'URL not found',
54
- };
55
- ctx.throw();
49
+ throwKoaError(ctx, 404, 'URL not found');
56
50
  }
57
51
  return next();
58
52
  },
@@ -3,6 +3,7 @@ import process from 'node:process';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { AppsembleError, resolveFixture } from '@appsemble/node-utils';
5
5
  import { ts } from 'ts-json-schema-generator';
6
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
6
7
  import { getBlockConfigFromTypeScript } from './getBlockConfigFromTypeScript.js';
7
8
  beforeEach(() => {
8
9
  vi.spyOn(process, 'cwd').mockReturnValue(resolveFixture('.'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/cli",
3
- "version": "0.22.9",
3
+ "version": "0.23.0",
4
4
  "description": "The CLI for developing with Appsemble apps and blocks",
5
5
  "keywords": [
6
6
  "app",
@@ -42,14 +42,14 @@
42
42
  "test": "vitest"
43
43
  },
44
44
  "dependencies": {
45
- "@appsemble/node-utils": "0.22.9",
46
- "@appsemble/types": "0.22.9",
47
- "@appsemble/utils": "0.22.9",
45
+ "@appsemble/node-utils": "0.23.0",
46
+ "@appsemble/types": "0.23.0",
47
+ "@appsemble/utils": "0.23.0",
48
48
  "@fortawesome/fontawesome-common-types": "^6.0.0",
49
49
  "@koa/cors": "^4.0.0",
50
50
  "@odata/parser": "^0.2.0",
51
51
  "axios": "^1.0.0",
52
- "chalk": "^4.0.0",
52
+ "chalk": "^5.0.0",
53
53
  "comment-parser": "^1.0.0",
54
54
  "cosmiconfig": "^7.0.0",
55
55
  "csvtojson": "^2.0.0",
@@ -85,13 +85,14 @@
85
85
  "yargs": "^17.0.0"
86
86
  },
87
87
  "devDependencies": {
88
- "@appsemble/types": "0.22.9",
88
+ "@appsemble/types": "0.23.0",
89
89
  "@types/concat-stream": "^2.0.0",
90
90
  "@types/inquirer": "^9.0.0",
91
91
  "@types/normalize-path": "^3.0.0",
92
92
  "@types/postcss-import": "^14.0.0",
93
93
  "@types/postcss-url": "^10.0.0",
94
- "concat-stream": "^2.0.0"
94
+ "concat-stream": "^2.0.0",
95
+ "vitest": "^0.34.0"
95
96
  },
96
97
  "peerDependencies": {},
97
98
  "optionalDependencies": {
@@ -1,6 +1,7 @@
1
1
  import { rm, writeFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import globalCacheDir from 'global-cache-dir';
4
+ import { afterAll, describe, expect, it } from 'vitest';
4
5
  import { Methods, setAppName } from './methods.js';
5
6
  const appName = 'testApp';
6
7
  setAppName(appName);
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { checkRole } from './checkRole.js';
2
3
  describe('checkRole', () => {
3
4
  it('should return a promise that resolves to an empty object', async () => {
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { parseQuery } from './parseQuery.js';
2
3
  describe('parseQuery', () => {
3
4
  it('should parse the query correctly with valid parameters', () => {
@@ -6,7 +6,7 @@ pages:
6
6
  - name: Example Page A
7
7
  blocks:
8
8
  - type: action-button
9
- version: 0.22.9
9
+ version: 0.23.0
10
10
  parameters:
11
11
  icon: arrow-right
12
12
  actions:
@@ -17,7 +17,7 @@ pages:
17
17
  - name: Example Page B
18
18
  blocks:
19
19
  - type: action-button
20
- version: 0.22.9
20
+ version: 0.23.0
21
21
  parameters:
22
22
  icon: arrow-left
23
23
  actions:
@@ -2,7 +2,7 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@appsemble/sdk": "0.22.9",
6
- "mini-jsx": "^3.0.0"
5
+ "@appsemble/sdk": "0.23.0",
6
+ "mini-jsx": "^4.0.0"
7
7
  }
8
8
  }
@@ -2,8 +2,8 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@appsemble/preact": "0.22.9",
6
- "@appsemble/sdk": "0.22.9",
5
+ "@appsemble/preact": "0.23.0",
6
+ "@appsemble/sdk": "0.23.0",
7
7
  "preact": "^10.0.0"
8
8
  }
9
9
  }
@@ -2,6 +2,6 @@
2
2
  "private": true,
3
3
  "type": "module",
4
4
  "dependencies": {
5
- "@appsemble/sdk": "0.22.9"
5
+ "@appsemble/sdk": "0.23.0"
6
6
  }
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "extends": "../../tsconfig",
3
3
  "compilerOptions": {
4
4
  "lib": ["dom", "dom.iterable", "esnext"],
5
- "types": ["@appsemble/webpack-config/types", "vitest/globals"]
5
+ "types": ["@appsemble/webpack-config/types"]
6
6
  }
7
7
  }