@movable/rollup-plugin-manifest-merger 3.0.0-canary.0 → 3.0.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.
Files changed (28) hide show
  1. package/build/src/plugins/manifest-merger.js +7 -0
  2. package/build/test/plugins/manifest-merger-test.js +71 -84
  3. package/package.json +24 -25
  4. package/src/plugins/manifest-merger.ts +9 -0
  5. package/test/fixtures/{test-app → test-app-no-integration-ids}/app-manifest.yml +0 -0
  6. package/test/fixtures/{test-app → test-app-no-integration-ids}/index.js +0 -0
  7. package/test/fixtures/{test-app → test-app-no-integration-ids}/node_modules/@movable-internal/test-dep/index.js +0 -0
  8. package/test/fixtures/{test-app → test-app-no-integration-ids}/node_modules/@movable-internal/test-dep/package-manifest.yml +0 -0
  9. package/test/fixtures/{test-app → test-app-no-integration-ids}/node_modules/@movable-internal/test-dep/package.json +0 -0
  10. package/test/fixtures/{test-app → test-app-no-integration-ids}/package.json +0 -0
  11. package/test/fixtures/test-app-with-app-and-package-integration-ids/app-manifest.yml +12 -0
  12. package/test/fixtures/test-app-with-app-and-package-integration-ids/index.js +9 -0
  13. package/test/fixtures/test-app-with-app-and-package-integration-ids/node_modules/@movable-internal/test-dep/index.js +1 -0
  14. package/test/fixtures/test-app-with-app-and-package-integration-ids/node_modules/@movable-internal/test-dep/package-manifest.yml +7 -0
  15. package/test/fixtures/test-app-with-app-and-package-integration-ids/node_modules/@movable-internal/test-dep/package.json +3 -0
  16. package/test/fixtures/test-app-with-app-and-package-integration-ids/node_modules/@movable-internal/test-dep-2/index.js +1 -0
  17. package/test/fixtures/test-app-with-app-and-package-integration-ids/node_modules/@movable-internal/test-dep-2/package-manifest.yml +7 -0
  18. package/test/fixtures/test-app-with-app-and-package-integration-ids/node_modules/@movable-internal/test-dep-2/package.json +3 -0
  19. package/test/fixtures/test-app-with-app-and-package-integration-ids/package.json +6 -0
  20. package/test/fixtures/test-app-with-app-integration-ids/app-manifest.yml +12 -0
  21. package/test/fixtures/test-app-with-app-integration-ids/index.js +7 -0
  22. package/test/fixtures/test-app-with-app-integration-ids/node_modules/@movable-internal/test-dep/index.js +1 -0
  23. package/test/fixtures/test-app-with-app-integration-ids/node_modules/@movable-internal/test-dep/package-manifest.yml +3 -0
  24. package/test/fixtures/test-app-with-app-integration-ids/node_modules/@movable-internal/test-dep/package.json +3 -0
  25. package/test/fixtures/test-app-with-app-integration-ids/package.json +5 -0
  26. package/test/helpers/expect-ast-equals.ts +2 -2
  27. package/test/plugins/manifest-merger-test.ts +76 -90
  28. package/.mocharc.yml +0 -1
@@ -80,10 +80,17 @@ function manifestMerger(opts) {
80
80
  }
81
81
  // Add the package manifests to the array
82
82
  const manifests = [];
83
+ const integrationIds = [...(appManifest.integration_ids || [])];
83
84
  for (const [, val] of packageCache.entries()) {
85
+ if (Array.isArray(val.integration_ids)) {
86
+ integrationIds.push(...val.integration_ids);
87
+ }
84
88
  manifests.push(val);
85
89
  }
86
90
  appManifest.package_manifests = manifests;
91
+ if (integrationIds.length) {
92
+ appManifest.integration_ids = [...new Set(integrationIds)];
93
+ }
87
94
  if (fileName) {
88
95
  const inline = 12; // The level where you switch to inline YAML
89
96
  const indent = 2; // The amount of spaces to use for indentation of nested nodes.
@@ -11,99 +11,86 @@ const yamljs_1 = __importDefault(require("yamljs"));
11
11
  const index_1 = require("../../src/index");
12
12
  const setup_fixture_1 = __importDefault(require("../helpers/setup-fixture"));
13
13
  const studioFrameworkPkg = require('@movable/studio-framework/package.json');
14
- mocha_1.describe('manifestMerger - app test', () => {
15
- setup_fixture_1.default('test-app');
16
- mocha_1.it('can build the manifest via dependencies', async () => {
17
- const bundle = await rollup_1.rollup({
18
- input: 'index.js',
19
- plugins: [index_1.manifestMerger({ output: 'manifest.yml' }), plugin_node_resolve_1.default()]
20
- });
21
- const { output } = await bundle.generate({
22
- format: 'es'
23
- });
24
- const ymlFile = output.find(({ fileName }) => fileName === 'manifest.yml');
25
- // @ts-ignore
26
- const manifest = yamljs_1.default.parse(ymlFile.source);
27
- chai_1.expect(manifest).to.deep.equal({
28
- name: 'App Manifest',
29
- options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
30
- string_array: ['one', 'two', 'three'],
31
- package_manifests: [
32
- {
33
- name: '@movable-internal/test-dep',
34
- authors: ['Test Developer']
35
- }
36
- ],
37
- studio_options: {
38
- framework_version: studioFrameworkPkg.version,
39
- package_dependencies: [
40
- { name: '@movable/studio-framework', version: studioFrameworkPkg.version }
41
- ]
42
- }
43
- });
14
+ const expectedAppManifest = {
15
+ name: 'App Manifest',
16
+ options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
17
+ string_array: ['one', 'two', 'three'],
18
+ package_manifests: [
19
+ {
20
+ name: '@movable-internal/test-dep',
21
+ authors: ['Test Developer']
22
+ }
23
+ ],
24
+ studio_options: {
25
+ framework_version: studioFrameworkPkg.version,
26
+ package_dependencies: [
27
+ { name: '@movable/studio-framework', version: studioFrameworkPkg.version }
28
+ ]
29
+ }
30
+ };
31
+ const bundledManifest = async ({ outputJSON = true, ignoreFrameworkVersionUpdate = false } = {}) => {
32
+ const outputFile = outputJSON ? 'manifest.json' : 'manifest.yml';
33
+ const bundle = await rollup_1.rollup({
34
+ input: 'index.js',
35
+ plugins: [
36
+ index_1.manifestMerger({
37
+ outputJSON,
38
+ output: outputFile,
39
+ ignoreFrameworkVersionUpdate
40
+ }),
41
+ plugin_node_resolve_1.default()
42
+ ]
43
+ });
44
+ const { output } = await bundle.generate({
45
+ format: 'es'
46
+ });
47
+ const file = output.find(({ fileName }) => fileName === outputFile);
48
+ // @ts-ignore
49
+ return outputJSON ? JSON.parse(file.source) : yamljs_1.default.parse(file.source);
50
+ };
51
+ mocha_1.describe('manifestMerger - app test', async () => {
52
+ setup_fixture_1.default('test-app-no-integration-ids');
53
+ mocha_1.it('can build the manifest via dependencies with yml output', async () => {
54
+ const manifest = await bundledManifest({ outputJSON: false });
55
+ chai_1.expect(manifest).to.deep.equal(expectedAppManifest);
44
56
  });
45
57
  mocha_1.it('can optionally ignore the actual Studio Framework version', async () => {
46
- const bundle = await rollup_1.rollup({
47
- input: 'index.js',
48
- plugins: [
49
- index_1.manifestMerger({ output: 'manifest.yml', ignoreFrameworkVersionUpdate: true }),
50
- plugin_node_resolve_1.default()
51
- ]
52
- });
53
- const { output } = await bundle.generate({
54
- format: 'es'
58
+ const manifest = await bundledManifest({
59
+ outputJSON: false,
60
+ ignoreFrameworkVersionUpdate: true
55
61
  });
56
- const ymlFile = output.find(({ fileName }) => fileName === 'manifest.yml');
57
- // @ts-ignore
58
- const manifest = yamljs_1.default.parse(ymlFile.source);
59
62
  chai_1.expect(manifest).to.deep.equal({
60
- name: 'App Manifest',
61
- options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
62
- string_array: ['one', 'two', 'three'],
63
- package_manifests: [
64
- {
65
- name: '@movable-internal/test-dep',
66
- authors: ['Test Developer']
67
- }
68
- ],
69
- studio_options: {
70
- framework_version: '2.15'
71
- }
63
+ ...expectedAppManifest,
64
+ studio_options: { framework_version: '2.15' }
65
+ });
66
+ mocha_1.it('can build the manifest via dependencies with json output', async () => {
67
+ const manifest = await bundledManifest();
68
+ chai_1.expect(manifest).to.deep.equal(expectedAppManifest);
72
69
  });
73
70
  });
74
71
  mocha_1.it('can build the manifest via dependencies', async () => {
75
- const bundle = await rollup_1.rollup({
76
- input: 'index.js',
77
- plugins: [
78
- index_1.manifestMerger({
79
- outputJSON: true,
80
- output: 'manifest.json'
81
- }),
82
- plugin_node_resolve_1.default()
83
- ]
72
+ const manifest = await bundledManifest();
73
+ chai_1.expect(manifest).to.deep.equal(expectedAppManifest);
74
+ });
75
+ });
76
+ mocha_1.describe('manifest merger - integration ids', () => {
77
+ mocha_1.describe('app with existing ids / dependencies with ids', () => {
78
+ setup_fixture_1.default('test-app-with-app-and-package-integration-ids');
79
+ mocha_1.it('it can build multiple integration ids from multiple packages', async () => {
80
+ const manifest = await bundledManifest();
81
+ chai_1.expect(manifest.integration_ids).to.have.members(['app-123', '123', 'abc', 'foo', 'bar']);
84
82
  });
85
- const { output } = await bundle.generate({
86
- format: 'es'
83
+ mocha_1.it('it does not duplicate appManifest.integration_ids upon regeneration', async () => {
84
+ await bundledManifest();
85
+ const manifest = await bundledManifest();
86
+ chai_1.expect(manifest.integration_ids).to.have.members(['app-123', '123', 'abc', 'foo', 'bar']);
87
87
  });
88
- const ymlFile = output.find(({ fileName }) => fileName === 'manifest.json');
89
- // @ts-ignore
90
- const manifest = JSON.parse(ymlFile.source);
91
- chai_1.expect(manifest).to.deep.equal({
92
- name: 'App Manifest',
93
- options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
94
- string_array: ['one', 'two', 'three'],
95
- package_manifests: [
96
- {
97
- name: '@movable-internal/test-dep',
98
- authors: ['Test Developer']
99
- }
100
- ],
101
- studio_options: {
102
- framework_version: studioFrameworkPkg.version,
103
- package_dependencies: [
104
- { name: '@movable/studio-framework', version: studioFrameworkPkg.version }
105
- ]
106
- }
88
+ });
89
+ mocha_1.describe('app with existing ids / dependencies with no ids', () => {
90
+ setup_fixture_1.default('test-app-with-app-integration-ids');
91
+ mocha_1.it('it can build integration ids with no package integration ids', async () => {
92
+ const manifest = await bundledManifest();
93
+ chai_1.expect(manifest.integration_ids).to.have.members(['app-123']);
107
94
  });
108
95
  });
109
96
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@movable/rollup-plugin-manifest-merger",
3
- "version": "3.0.0-canary.0",
4
- "description": "Merges package manfests into an App manifest",
3
+ "version": "3.0.0",
4
+ "description": "Merges package manifests into an App manifest",
5
5
  "main": "build/src/index.js",
6
6
  "keywords": [],
7
7
  "homepage": "https://github.com/movableink/studio-framework/tree/master/packages/rollup-plugin-manifest-merger#readme",
@@ -17,36 +17,35 @@
17
17
  "name": "Movable Ink"
18
18
  },
19
19
  "scripts": {
20
- "test": "NODE_ENV=test TS_NODE_FILES=true mocha --require ts-node/register test/**/*.ts",
20
+ "test": "NODE_ENV=test TS_NODE_FILES=true mocha --require ./node_modules/ts-node/register test/**/*.ts",
21
21
  "build": "tsc && copyfiles src/**/*.html build",
22
22
  "prepublish": "yarn run build"
23
23
  },
24
- "volta": {
25
- "node": "12.17.0",
26
- "yarn": "1.22.4"
27
- },
28
24
  "devDependencies": {
29
- "@rollup/plugin-node-resolve": "^8.4.0",
30
- "@types/chai": "^4.2.11",
31
- "@types/find-root": "^1.1.1",
32
- "@types/mocha": "^7.0.2",
33
- "@types/uuid": "^8.0.0",
25
+ "@rollup/plugin-node-resolve": "^13.0.0",
26
+ "@types/chai": "^4.2.18",
27
+ "@types/find-root": "^1.1.2",
28
+ "@types/mocha": "^8.2.2",
29
+ "@types/uuid": "^8.3.0",
34
30
  "@types/yamljs": "^0.2.31",
35
- "chai": "^4.2.0",
36
- "mocha": "^7.2.0",
37
- "rollup": "^2.11.2",
38
- "ts-node": "^8.10.2",
39
- "typescript": "^3.9.6"
31
+ "chai": "^4.3.4",
32
+ "mocha": "^8.4.0",
33
+ "rollup": "^2.52.2",
34
+ "ts-node": "^10.0.0",
35
+ "typescript": "^4.3.4"
40
36
  },
41
37
  "dependencies": {
42
- "@rollup/pluginutils": "^3.0.10",
43
- "ast-types": "^0.13.3",
44
- "copyfiles": "^2.3.0",
45
- "pkg-dir": "^4.2.0",
46
- "recast": "^0.19.1",
47
- "resolve": "^1.17.0",
48
- "uuid": "^8.1.0",
38
+ "@rollup/pluginutils": "^4.1.0",
39
+ "ast-types": "^0.14.2",
40
+ "copyfiles": "^2.4.1",
41
+ "pkg-dir": "^5.0.0",
42
+ "recast": "^0.20.4",
43
+ "resolve": "^1.20.0",
44
+ "uuid": "^8.3.2",
49
45
  "yamljs": "^0.3.0"
50
46
  },
51
- "gitHead": "893c1fc5711df5feb4d32c688670d01eb0c5e3cf"
47
+ "volta": {
48
+ "extends": "../../package.json"
49
+ },
50
+ "gitHead": "2b832ab5a64597cffdc7f1225bbbdf53c6299994"
52
51
  }
@@ -21,6 +21,7 @@ interface ManifestPackageDep {
21
21
  interface Manifest {
22
22
  name: string;
23
23
  package_manifests?: Manifest[];
24
+ integration_ids?: string[];
24
25
  studio_options?: {
25
26
  framework_version?: string;
26
27
  package_dependencies?: ManifestPackageDep[];
@@ -118,13 +119,21 @@ export default function manifestMerger(opts: Options): Plugin {
118
119
 
119
120
  // Add the package manifests to the array
120
121
  const manifests: Manifest[] = [];
122
+ const integrationIds = [...(appManifest.integration_ids || [])];
121
123
 
122
124
  for (const [, val] of packageCache.entries()) {
125
+ if (Array.isArray(val.integration_ids)) {
126
+ integrationIds.push(...val.integration_ids);
127
+ }
123
128
  manifests.push(val);
124
129
  }
125
130
 
126
131
  appManifest.package_manifests = manifests;
127
132
 
133
+ if (integrationIds.length) {
134
+ appManifest.integration_ids = [...new Set(integrationIds)];
135
+ }
136
+
128
137
  if (fileName) {
129
138
  const inline = 12; // The level where you switch to inline YAML
130
139
  const indent = 2; // The amount of spaces to use for indentation of nested nodes.
@@ -0,0 +1,12 @@
1
+ name: App Manifest
2
+ options:
3
+ - name: Option 2
4
+ - framework_version: '1.10.0'
5
+ string_array:
6
+ - one
7
+ - two
8
+ - three
9
+ studio_options:
10
+ framework_version: '2.15'
11
+ integration_ids:
12
+ - app-123
@@ -0,0 +1,9 @@
1
+ /* eslint-disable import/no-unresolved */
2
+ import something from '@movable-internal/test-dep';
3
+ import something2 from '@movable-internal/test-dep-2';
4
+ import '@movable-internal/test-dep/package-manifest.yml';
5
+ import '@movable-internal/test-dep-2/package-manifest.yml';
6
+ import './app-manifest.yml';
7
+
8
+ // eslint-disable-next-line no-console
9
+ console.log(something, something2);
@@ -0,0 +1,7 @@
1
+ name: foo
2
+ authors:
3
+ - "Test Developer"
4
+ integration_ids:
5
+ - "123"
6
+ - "abc"
7
+ - "123"
@@ -0,0 +1,7 @@
1
+ name: bar
2
+ authors:
3
+ - "Test Developer 2"
4
+ integration_ids:
5
+ - "123"
6
+ - "foo"
7
+ - "bar"
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": {
3
+ "@movable-internal/test-dep": "*",
4
+ "@movable-internal/test-dep-2": "*"
5
+ }
6
+ }
@@ -0,0 +1,12 @@
1
+ name: App Manifest
2
+ options:
3
+ - name: Option 2
4
+ - framework_version: '1.10.0'
5
+ string_array:
6
+ - one
7
+ - two
8
+ - three
9
+ studio_options:
10
+ framework_version: '2.15'
11
+ integration_ids:
12
+ - app-123
@@ -0,0 +1,7 @@
1
+ /* eslint-disable import/no-unresolved */
2
+ import something from '@movable-internal/test-dep';
3
+ import '@movable-internal/test-dep/package-manifest.yml';
4
+ import './app-manifest.yml';
5
+
6
+ // eslint-disable-next-line no-console
7
+ console.log(something);
@@ -0,0 +1 @@
1
+ export default () => console.log('test-dep');
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "@movable-internal/test-dep": "*"
4
+ }
5
+ }
@@ -1,8 +1,8 @@
1
1
  import { expect } from 'chai';
2
2
  import { prettyPrint, parse } from 'recast';
3
- import { Program } from 'ast-types/gen/nodes';
3
+ import * as types from 'ast-types';
4
4
 
5
- function printAst(ast: Program): string {
5
+ function printAst(ast: types.ASTNode): string {
6
6
  return prettyPrint(ast, { tabWidth: 2 }).code;
7
7
  }
8
8
 
@@ -8,115 +8,101 @@ import setupFixture from '../helpers/setup-fixture';
8
8
  import { PackageJSON } from '../../src/types/packages';
9
9
 
10
10
  const studioFrameworkPkg: PackageJSON = require('@movable/studio-framework/package.json');
11
+ const expectedAppManifest = {
12
+ name: 'App Manifest',
13
+ options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
14
+ string_array: ['one', 'two', 'three'],
15
+ package_manifests: [
16
+ {
17
+ name: '@movable-internal/test-dep',
18
+ authors: ['Test Developer']
19
+ }
20
+ ],
21
+ studio_options: {
22
+ framework_version: studioFrameworkPkg.version,
23
+ package_dependencies: [
24
+ { name: '@movable/studio-framework', version: studioFrameworkPkg.version }
25
+ ]
26
+ }
27
+ };
28
+
29
+ const bundledManifest = async ({
30
+ outputJSON = true,
31
+ ignoreFrameworkVersionUpdate = false
32
+ } = {}) => {
33
+ const outputFile = outputJSON ? 'manifest.json' : 'manifest.yml';
34
+ const bundle = await rollup({
35
+ input: 'index.js',
36
+ plugins: [
37
+ manifestMerger({
38
+ outputJSON,
39
+ output: outputFile,
40
+ ignoreFrameworkVersionUpdate
41
+ }),
42
+ nodeResolve()
43
+ ]
44
+ });
11
45
 
12
- describe('manifestMerger - app test', () => {
13
- setupFixture('test-app');
14
-
15
- it('can build the manifest via dependencies', async () => {
16
- const bundle = await rollup({
17
- input: 'index.js',
18
- plugins: [manifestMerger({ output: 'manifest.yml' }), nodeResolve()]
19
- });
46
+ const { output } = await bundle.generate({
47
+ format: 'es'
48
+ });
20
49
 
21
- const { output } = await bundle.generate({
22
- format: 'es'
23
- });
50
+ const file = output.find(({ fileName }) => fileName === outputFile);
24
51
 
25
- const ymlFile = output.find(({ fileName }) => fileName === 'manifest.yml');
52
+ // @ts-ignore
53
+ return outputJSON ? JSON.parse(file.source) : YAML.parse(file.source);
54
+ };
26
55
 
27
- // @ts-ignore
28
- const manifest = YAML.parse(ymlFile.source);
56
+ describe('manifestMerger - app test', async () => {
57
+ setupFixture('test-app-no-integration-ids');
58
+ it('can build the manifest via dependencies with yml output', async () => {
59
+ const manifest = await bundledManifest({ outputJSON: false });
29
60
 
30
- expect(manifest).to.deep.equal({
31
- name: 'App Manifest',
32
- options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
33
- string_array: ['one', 'two', 'three'],
34
- package_manifests: [
35
- {
36
- name: '@movable-internal/test-dep',
37
- authors: ['Test Developer']
38
- }
39
- ],
40
- studio_options: {
41
- framework_version: studioFrameworkPkg.version,
42
- package_dependencies: [
43
- { name: '@movable/studio-framework', version: studioFrameworkPkg.version }
44
- ]
45
- }
46
- });
61
+ expect(manifest).to.deep.equal(expectedAppManifest);
47
62
  });
48
-
49
63
  it('can optionally ignore the actual Studio Framework version', async () => {
50
- const bundle = await rollup({
51
- input: 'index.js',
52
- plugins: [
53
- manifestMerger({ output: 'manifest.yml', ignoreFrameworkVersionUpdate: true }),
54
- nodeResolve()
55
- ]
64
+ const manifest = await bundledManifest({
65
+ outputJSON: false,
66
+ ignoreFrameworkVersionUpdate: true
56
67
  });
57
68
 
58
- const { output } = await bundle.generate({
59
- format: 'es'
69
+ expect(manifest).to.deep.equal({
70
+ ...expectedAppManifest,
71
+ studio_options: { framework_version: '2.15' }
60
72
  });
61
73
 
62
- const ymlFile = output.find(({ fileName }) => fileName === 'manifest.yml');
74
+ it('can build the manifest via dependencies with json output', async () => {
75
+ const manifest = await bundledManifest();
63
76
 
64
- // @ts-ignore
65
- const manifest = YAML.parse(ymlFile.source);
66
-
67
- expect(manifest).to.deep.equal({
68
- name: 'App Manifest',
69
- options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
70
- string_array: ['one', 'two', 'three'],
71
- package_manifests: [
72
- {
73
- name: '@movable-internal/test-dep',
74
- authors: ['Test Developer']
75
- }
76
- ],
77
- studio_options: {
78
- framework_version: '2.15'
79
- }
77
+ expect(manifest).to.deep.equal(expectedAppManifest);
80
78
  });
81
79
  });
82
-
83
80
  it('can build the manifest via dependencies', async () => {
84
- const bundle = await rollup({
85
- input: 'index.js',
86
- plugins: [
87
- manifestMerger({
88
- outputJSON: true,
89
- output: 'manifest.json'
90
- }),
91
- nodeResolve()
92
- ]
93
- });
81
+ const manifest = await bundledManifest();
94
82
 
95
- const { output } = await bundle.generate({
96
- format: 'es'
83
+ expect(manifest).to.deep.equal(expectedAppManifest);
84
+ });
85
+ });
86
+ describe('manifest merger - integration ids', () => {
87
+ describe('app with existing ids / dependencies with ids', () => {
88
+ setupFixture('test-app-with-app-and-package-integration-ids');
89
+ it('it can build multiple integration ids from multiple packages', async () => {
90
+ const manifest = await bundledManifest();
91
+ expect(manifest.integration_ids).to.have.members(['app-123', '123', 'abc', 'foo', 'bar']);
97
92
  });
93
+ it('it does not duplicate appManifest.integration_ids upon regeneration', async () => {
94
+ await bundledManifest();
95
+ const manifest = await bundledManifest();
98
96
 
99
- const ymlFile = output.find(({ fileName }) => fileName === 'manifest.json');
100
-
101
- // @ts-ignore
102
- const manifest = JSON.parse(ymlFile.source);
97
+ expect(manifest.integration_ids).to.have.members(['app-123', '123', 'abc', 'foo', 'bar']);
98
+ });
99
+ });
100
+ describe('app with existing ids / dependencies with no ids', () => {
101
+ setupFixture('test-app-with-app-integration-ids');
103
102
 
104
- expect(manifest).to.deep.equal({
105
- name: 'App Manifest',
106
- options: [{ name: 'Option 2' }, { framework_version: '1.10.0' }],
107
- string_array: ['one', 'two', 'three'],
108
- package_manifests: [
109
- {
110
- name: '@movable-internal/test-dep',
111
- authors: ['Test Developer']
112
- }
113
- ],
114
- studio_options: {
115
- framework_version: studioFrameworkPkg.version,
116
- package_dependencies: [
117
- { name: '@movable/studio-framework', version: studioFrameworkPkg.version }
118
- ]
119
- }
103
+ it('it can build integration ids with no package integration ids', async () => {
104
+ const manifest = await bundledManifest();
105
+ expect(manifest.integration_ids).to.have.members(['app-123']);
120
106
  });
121
107
  });
122
108
  });
package/.mocharc.yml DELETED
@@ -1 +0,0 @@
1
- require: 'ts-node/register'