@movable/rollup-plugin-manifest-merger 3.4.0-pin-rollup-plugin → 3.4.1
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.
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const pluginutils_1 = require("@rollup/pluginutils");
|
|
7
|
-
const yamljs_1 = __importDefault(require("yamljs"));
|
|
8
7
|
const resolve_1 = __importDefault(require("resolve"));
|
|
9
8
|
const pkg_dir_1 = __importDefault(require("pkg-dir"));
|
|
10
9
|
const fs_1 = require("fs");
|
|
10
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
11
11
|
const APP_FILTER = pluginutils_1.createFilter(/app-manifest\.yml$/);
|
|
12
12
|
const PACKAGE_FILTER = pluginutils_1.createFilter(/\.yml$/);
|
|
13
13
|
function manifestMerger(opts) {
|
|
@@ -28,7 +28,7 @@ function manifestMerger(opts) {
|
|
|
28
28
|
buildStart() {
|
|
29
29
|
if (opts.appManifest) {
|
|
30
30
|
this.addWatchFile(opts.appManifest);
|
|
31
|
-
appManifest =
|
|
31
|
+
appManifest = js_yaml_1.default.load(fs_1.readFileSync(opts.appManifest, 'utf-8'));
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
buildEnd(error) {
|
|
@@ -55,11 +55,11 @@ function manifestMerger(opts) {
|
|
|
55
55
|
map: { mappings: '' }
|
|
56
56
|
};
|
|
57
57
|
if (APP_FILTER(id)) {
|
|
58
|
-
appManifest =
|
|
58
|
+
appManifest = js_yaml_1.default.load(yml);
|
|
59
59
|
return noCode;
|
|
60
60
|
}
|
|
61
61
|
if (PACKAGE_FILTER(id)) {
|
|
62
|
-
const packageManifest =
|
|
62
|
+
const packageManifest = js_yaml_1.default.load(yml);
|
|
63
63
|
const name = pathPackageMap.get(id);
|
|
64
64
|
if (name) {
|
|
65
65
|
packageManifest.name = name;
|
|
@@ -99,7 +99,7 @@ function manifestMerger(opts) {
|
|
|
99
99
|
const indent = 2; // The amount of spaces to use for indentation of nested nodes.
|
|
100
100
|
const source = outputJSON
|
|
101
101
|
? JSON.stringify(appManifest)
|
|
102
|
-
:
|
|
102
|
+
: js_yaml_1.default.dump(appManifest, { flowLevel: inline, indent: indent });
|
|
103
103
|
// eslint-disable-next-line no-param-reassign
|
|
104
104
|
this.emitFile({
|
|
105
105
|
type: 'asset',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movable/rollup-plugin-manifest-merger",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Merges package manifests into an App manifest",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -36,16 +36,17 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@rollup/pluginutils": "^4.1.0",
|
|
39
|
+
"@types/js-yaml": "^4.0.9",
|
|
39
40
|
"ast-types": "^0.14.2",
|
|
40
41
|
"copyfiles": "^2.4.1",
|
|
42
|
+
"js-yaml": "^4.1.0",
|
|
41
43
|
"pkg-dir": "^5.0.0",
|
|
42
44
|
"recast": "^0.20.4",
|
|
43
45
|
"resolve": "^1.20.0",
|
|
44
|
-
"uuid": "^8.3.2"
|
|
45
|
-
"yamljs": "^0.3.0"
|
|
46
|
+
"uuid": "^8.3.2"
|
|
46
47
|
},
|
|
47
48
|
"volta": {
|
|
48
49
|
"extends": "../../package.json"
|
|
49
50
|
},
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "aff3e903d9e302b90bbf80f583b108008a0717b4"
|
|
51
52
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createFilter } from '@rollup/pluginutils';
|
|
2
2
|
import { Plugin, SourceDescription } from 'rollup';
|
|
3
3
|
import { PackageJSON } from '../types/packages';
|
|
4
|
-
import YAML from 'yamljs';
|
|
5
4
|
import resolve from 'resolve';
|
|
6
5
|
import pkgDir from 'pkg-dir';
|
|
7
6
|
import { readFileSync } from 'fs';
|
|
7
|
+
import YAML from 'js-yaml';
|
|
8
8
|
|
|
9
9
|
interface Options {
|
|
10
10
|
output: string;
|
|
@@ -53,7 +53,7 @@ export default function manifestMerger(opts: Options): Plugin {
|
|
|
53
53
|
buildStart() {
|
|
54
54
|
if (opts.appManifest) {
|
|
55
55
|
this.addWatchFile(opts.appManifest);
|
|
56
|
-
appManifest = YAML.
|
|
56
|
+
appManifest = YAML.load(readFileSync(opts.appManifest, 'utf-8')) as Manifest;
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
buildEnd(error) {
|
|
@@ -87,12 +87,12 @@ export default function manifestMerger(opts: Options): Plugin {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
if (APP_FILTER(id)) {
|
|
90
|
-
appManifest = YAML.
|
|
90
|
+
appManifest = YAML.load(yml) as Manifest;
|
|
91
91
|
return noCode;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (PACKAGE_FILTER(id)) {
|
|
95
|
-
const packageManifest: Manifest = YAML.
|
|
95
|
+
const packageManifest: Manifest = YAML.load(yml) as Manifest;
|
|
96
96
|
|
|
97
97
|
const name = pathPackageMap.get(id);
|
|
98
98
|
|
|
@@ -144,7 +144,7 @@ export default function manifestMerger(opts: Options): Plugin {
|
|
|
144
144
|
|
|
145
145
|
const source = outputJSON
|
|
146
146
|
? JSON.stringify(appManifest)
|
|
147
|
-
: YAML.
|
|
147
|
+
: YAML.dump(appManifest, { flowLevel: inline, indent: indent });
|
|
148
148
|
|
|
149
149
|
// eslint-disable-next-line no-param-reassign
|
|
150
150
|
this.emitFile({
|