@zokugun/artifact 0.5.2 → 0.6.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/bin/artifact +1 -1
- package/lib/cli.d.ts +1 -0
- package/lib/cli.js +12 -4
- package/lib/commands/add.d.ts +6 -0
- package/lib/commands/add.js +47 -36
- package/lib/commands/index.d.ts +4 -0
- package/lib/commands/index.js +9 -7
- package/lib/commands/list.d.ts +1 -0
- package/lib/commands/list.js +13 -8
- package/lib/commands/remove.d.ts +6 -0
- package/lib/commands/remove.js +79 -0
- package/lib/commands/update.d.ts +5 -0
- package/lib/commands/update.js +43 -39
- package/lib/compositors/compose.d.ts +7 -0
- package/lib/compositors/compose.js +13 -13
- package/lib/compositors/fork.d.ts +3 -0
- package/lib/compositors/fork.js +4 -4
- package/lib/compositors/index.d.ts +6 -0
- package/lib/compositors/index.js +12 -12
- package/lib/compositors/json.d.ts +2 -0
- package/lib/compositors/json.js +14 -12
- package/lib/compositors/map-sort.d.ts +2 -0
- package/lib/compositors/map-sort.js +2 -2
- package/lib/compositors/rc.d.ts +2 -0
- package/lib/compositors/rc.js +13 -10
- package/lib/compositors/yaml.d.ts +2 -0
- package/lib/compositors/yaml.js +8 -11
- package/lib/configs/index.d.ts +3 -0
- package/lib/configs/index.js +3 -2
- package/lib/configs/install/index.d.ts +3 -0
- package/lib/configs/install/index.js +6 -6
- package/lib/configs/install/read-install-config.d.ts +6 -0
- package/lib/configs/install/read-install-config.js +123 -80
- package/lib/configs/install/update-install-config.d.ts +2 -0
- package/lib/configs/install/write-install-config.d.ts +5 -0
- package/lib/configs/install/write-install-config.js +17 -9
- package/lib/configs/package/index.d.ts +1 -0
- package/lib/configs/package/index.js +2 -2
- package/lib/configs/package/read-package-config.d.ts +3 -0
- package/lib/configs/package/read-package-config.js +159 -40
- package/lib/configs/uninstall/index.d.ts +1 -0
- package/lib/configs/uninstall/index.js +5 -0
- package/lib/configs/uninstall/update-uninstall-config.d.ts +2 -0
- package/lib/configs/uninstall/update-uninstall-config.js +6 -0
- package/lib/configs/utils/constants.d.ts +11 -0
- package/lib/configs/utils/constants.js +24 -0
- package/lib/configs/utils/is-transform.d.ts +2 -0
- package/lib/configs/utils/is-transform.js +16 -0
- package/lib/configs/utils/merge-upsert-property.d.ts +3 -0
- package/lib/configs/utils/merge-upsert-property.js +68 -0
- package/lib/configs/utils/normalize-file-always.d.ts +3 -0
- package/lib/configs/utils/normalize-file-always.js +28 -0
- package/lib/configs/utils/normalize-file-uninstall.d.ts +3 -0
- package/lib/configs/utils/normalize-file-uninstall.js +31 -0
- package/lib/configs/utils/normalize-file-upsert.d.ts +3 -0
- package/lib/configs/utils/normalize-file-upsert.js +54 -0
- package/lib/journeys/commitlint/index.d.ts +2 -0
- package/lib/journeys/commitlint/index.js +15 -15
- package/lib/journeys/config.ts/index.d.ts +2 -0
- package/lib/journeys/config.ts/index.js +5 -5
- package/lib/journeys/default/index.d.ts +2 -0
- package/lib/journeys/default/index.js +11 -14
- package/lib/journeys/fixpack/index.d.ts +2 -0
- package/lib/journeys/fixpack/index.js +13 -13
- package/lib/journeys/gitignore/index.d.ts +2 -0
- package/lib/journeys/gitignore/index.js +5 -5
- package/lib/journeys/ignore/index.d.ts +2 -0
- package/lib/journeys/ignore/index.js +5 -5
- package/lib/journeys/index.d.ts +2 -0
- package/lib/journeys/index.js +20 -20
- package/lib/journeys/npmignore/index.d.ts +2 -0
- package/lib/journeys/npmignore/index.js +5 -5
- package/lib/journeys/package/index.d.ts +2 -0
- package/lib/journeys/package/index.js +27 -30
- package/lib/journeys/rc/index.d.ts +2 -0
- package/lib/journeys/rc/index.js +12 -12
- package/lib/journeys/tsconfig/index.d.ts +2 -0
- package/lib/journeys/tsconfig/index.js +13 -16
- package/lib/parsers/json.d.ts +2 -0
- package/lib/parsers/jsonc/index.d.ts +2 -0
- package/lib/parsers/jsonc/index.js +4 -4
- package/lib/parsers/jsonc/parse.d.ts +5 -0
- package/lib/parsers/jsonc/parse.js +1 -13
- package/lib/parsers/jsonc/stringify.d.ts +2 -0
- package/lib/parsers/jsonc/stringify.js +2 -2
- package/lib/parsers/jsonc/transform.d.ts +10 -0
- package/lib/parsers/yaml.d.ts +2 -0
- package/lib/routes/command.d.ts +4 -0
- package/lib/routes/command.js +10 -10
- package/lib/routes/index.d.ts +8 -0
- package/lib/routes/index.js +17 -15
- package/lib/routes/lines-concat.d.ts +4 -0
- package/lib/routes/lines-concat.js +7 -7
- package/lib/routes/list-concat.d.ts +4 -0
- package/lib/routes/list-concat.js +3 -7
- package/lib/routes/list-sort-concat.d.ts +4 -0
- package/lib/routes/list-sort-concat.js +1 -1
- package/lib/routes/map-concat.d.ts +4 -0
- package/lib/routes/map-concat.js +1 -1
- package/lib/routes/map-delete.d.ts +4 -0
- package/lib/routes/map-delete.js +32 -0
- package/lib/routes/overwrite.d.ts +4 -0
- package/lib/routes/overwrite.js +2 -2
- package/lib/routes/primitive.d.ts +4 -0
- package/lib/routes/primitive.js +3 -3
- package/lib/steps/apply-formatting.d.ts +8 -0
- package/lib/steps/apply-formatting.js +19 -15
- package/lib/steps/configure-branches.d.ts +3 -0
- package/lib/steps/configure-branches.js +8 -5
- package/lib/steps/configure-install-file-actions.d.ts +3 -0
- package/lib/steps/configure-install-file-actions.js +41 -86
- package/lib/steps/configure-uninstall-file-actions.d.ts +3 -0
- package/lib/steps/configure-uninstall-file-actions.js +53 -0
- package/lib/steps/configure-update-file-actions.d.ts +3 -0
- package/lib/steps/configure-update-file-actions.js +64 -97
- package/lib/steps/copy-binary-files.d.ts +3 -0
- package/lib/steps/copy-binary-files.js +24 -11
- package/lib/steps/execute-first-block.d.ts +3 -0
- package/lib/steps/execute-first-block.js +35 -14
- package/lib/steps/execute-next-block.d.ts +3 -0
- package/lib/steps/execute-next-block.js +8 -3
- package/lib/steps/index.d.ts +54 -0
- package/lib/steps/index.js +76 -54
- package/lib/steps/insert-final-new-line.d.ts +6 -0
- package/lib/steps/insert-final-new-line.js +13 -1
- package/lib/steps/merge-text-files.d.ts +3 -0
- package/lib/steps/merge-text-files.js +41 -27
- package/lib/steps/read-editor-config.d.ts +3 -0
- package/lib/steps/read-editor-config.js +21 -26
- package/lib/steps/read-files.d.ts +3 -0
- package/lib/steps/read-files.js +19 -8
- package/lib/steps/read-incoming-config.d.ts +3 -0
- package/lib/steps/read-incoming-config.js +7 -5
- package/lib/steps/read-incoming-package.d.ts +3 -0
- package/lib/steps/read-incoming-package.js +12 -7
- package/lib/steps/remove-files.d.ts +3 -0
- package/lib/steps/remove-files.js +10 -4
- package/lib/steps/rename-files.d.ts +3 -0
- package/lib/steps/rename-files.js +25 -0
- package/lib/steps/replace-templates.d.ts +3 -0
- package/lib/steps/replace-templates.js +19 -5
- package/lib/steps/transform-untouched-files.d.ts +3 -0
- package/lib/steps/transform-untouched-files.js +73 -0
- package/lib/steps/unmerge-text-files.d.ts +3 -0
- package/lib/steps/unmerge-text-files.js +63 -0
- package/lib/steps/validate-newer-package.d.ts +3 -0
- package/lib/steps/validate-newer-package.js +4 -2
- package/lib/steps/validate-not-present-package.d.ts +3 -0
- package/lib/steps/validate-not-present-package.js +7 -4
- package/lib/steps/validate-present-package.d.ts +3 -0
- package/lib/steps/validate-present-package.js +24 -0
- package/lib/steps/write-text-files.d.ts +3 -0
- package/lib/steps/write-text-files.js +16 -7
- package/lib/types/binary-file.d.ts +4 -0
- package/lib/types/command.d.ts +5 -0
- package/lib/types/config.d.ts +58 -0
- package/lib/types/context.d.ts +56 -0
- package/lib/types/format.d.ts +10 -0
- package/lib/types/step.d.ts +3 -0
- package/lib/types/text-file.d.ts +7 -0
- package/lib/types/travel.d.ts +14 -0
- package/lib/utils/apply-transforms.d.ts +2 -0
- package/lib/utils/apply-transforms.js +48 -0
- package/lib/utils/build-journey-plan.d.ts +2 -0
- package/lib/utils/build-route.d.ts +3 -0
- package/lib/utils/build-route.js +92 -0
- package/lib/utils/build-travel-plan.d.ts +2 -0
- package/lib/utils/build-travel.d.ts +3 -0
- package/lib/utils/build-travel.js +32 -0
- package/lib/utils/command/dedupe-strings.d.ts +1 -0
- package/lib/utils/command/index.d.ts +8 -0
- package/lib/utils/command/index.js +14 -14
- package/lib/utils/command/join-command.d.ts +2 -0
- package/lib/utils/command/merge-and-chains.d.ts +1 -0
- package/lib/utils/command/merge-and-chains.js +21 -21
- package/lib/utils/command/merge-command-records.d.ts +2 -0
- package/lib/utils/command/merge-command-records.js +43 -22
- package/lib/utils/command/merge-flag-tokens.d.ts +1 -0
- package/lib/utils/command/merge-flag-tokens.js +1 -1
- package/lib/utils/command/merge-flags-as-string.d.ts +4 -0
- package/lib/utils/command/merge-flags-as-string.js +4 -4
- package/lib/utils/command/merge-or-segments.d.ts +1 -0
- package/lib/utils/command/merge-or-segments.js +28 -28
- package/lib/utils/command/merge-parts-by-prefix.d.ts +1 -0
- package/lib/utils/command/merge-parts-by-prefix.js +6 -6
- package/lib/utils/command/merge-semicolon-segments.d.ts +1 -0
- package/lib/utils/command/merge-semicolon-segments.js +35 -35
- package/lib/utils/command/merge-with-semicolon-mix.d.ts +1 -0
- package/lib/utils/command/merge-with-semicolon-mix.js +12 -12
- package/lib/utils/command/prefix-of-command.d.ts +1 -0
- package/lib/utils/command/prefix-of-command.js +2 -2
- package/lib/utils/command/split-chain.d.ts +1 -0
- package/lib/utils/command/split-command.d.ts +2 -0
- package/lib/utils/command/split-command.js +8 -8
- package/lib/utils/command/split-prefix-and-flags.d.ts +4 -0
- package/lib/utils/command/split-prefix-and-flags.js +5 -5
- package/lib/utils/command/split-segments.d.ts +1 -0
- package/lib/utils/detect-indent.d.ts +5 -0
- package/lib/utils/detect-indent.js +60 -0
- package/lib/utils/flow.d.ts +3 -0
- package/lib/utils/flow.js +12 -0
- package/lib/utils/get-format.d.ts +2 -0
- package/lib/utils/get-format.js +19 -0
- package/lib/utils/has-final-new-line.d.ts +1 -0
- package/lib/utils/has-final-new-line.js +7 -0
- package/lib/utils/read-buffer.d.ts +2 -0
- package/lib/utils/resolve-request.d.ts +3 -0
- package/lib/utils/resolve-request.js +4 -3
- package/lib/utils/template.d.ts +17 -0
- package/lib/utils/template.js +79 -57
- package/lib/utils/to-lines.d.ts +1 -0
- package/lib/utils/trim-final-newline.d.ts +1 -0
- package/lib/utils/try-json.d.ts +1 -0
- package/lib/utils/try-json.js +2 -2
- package/package.json +123 -101
- package/lib/utils/dev-null.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const gitignorePlan = (0,
|
|
7
|
-
exports.default = (0,
|
|
3
|
+
const index_js_1 = require("../../routes/index.js");
|
|
4
|
+
const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
|
|
5
|
+
const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
|
|
6
|
+
const gitignorePlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.?gitignore$/, index_js_1.linesConcat]);
|
|
7
|
+
exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(gitignorePlan, '.gitignore');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const ignorePlan = (0,
|
|
7
|
-
exports.default = (0,
|
|
3
|
+
const index_js_1 = require("../../routes/index.js");
|
|
4
|
+
const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
|
|
5
|
+
const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
|
|
6
|
+
const ignorePlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\..*ignore$/, index_js_1.linesConcat]);
|
|
7
|
+
exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(ignorePlan);
|
package/lib/journeys/index.js
CHANGED
|
@@ -5,27 +5,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getJourney = getJourney;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
8
|
+
const index_js_1 = __importDefault(require("./commitlint/index.js"));
|
|
9
|
+
const index_js_2 = __importDefault(require("./config.ts/index.js"));
|
|
10
|
+
const index_js_3 = __importDefault(require("./default/index.js"));
|
|
11
|
+
const index_js_4 = __importDefault(require("./fixpack/index.js"));
|
|
12
|
+
const index_js_5 = __importDefault(require("./gitignore/index.js"));
|
|
13
|
+
const index_js_6 = __importDefault(require("./ignore/index.js"));
|
|
14
|
+
const index_js_7 = __importDefault(require("./npmignore/index.js"));
|
|
15
|
+
const index_js_8 = __importDefault(require("./package/index.js"));
|
|
16
|
+
const index_js_9 = __importDefault(require("./rc/index.js"));
|
|
17
|
+
const index_js_10 = __importDefault(require("./tsconfig/index.js"));
|
|
18
18
|
const plans = [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
index_js_1.default,
|
|
20
|
+
index_js_4.default,
|
|
21
|
+
index_js_5.default,
|
|
22
|
+
index_js_6.default,
|
|
23
|
+
index_js_7.default,
|
|
24
|
+
index_js_8.default,
|
|
25
|
+
index_js_10.default,
|
|
26
|
+
index_js_9.default,
|
|
27
|
+
index_js_2.default,
|
|
28
|
+
index_js_3.default,
|
|
29
29
|
];
|
|
30
30
|
function getJourney(filename) {
|
|
31
31
|
const basename = path_1.default.basename(filename);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const gitignorePlan = (0,
|
|
7
|
-
exports.default = (0,
|
|
3
|
+
const index_js_1 = require("../../routes/index.js");
|
|
4
|
+
const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
|
|
5
|
+
const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
|
|
6
|
+
const gitignorePlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.?npmignore$/, index_js_1.linesConcat]);
|
|
7
|
+
exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(gitignorePlan, '.npmignore');
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const mainRoute = (0,
|
|
3
|
+
const is_it_type_1 = require("@zokugun/is-it-type");
|
|
4
|
+
const index_js_1 = require("../../compositors/index.js");
|
|
5
|
+
const index_js_2 = require("../../routes/index.js");
|
|
6
|
+
const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
|
|
7
|
+
const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
|
|
8
|
+
const mainRoute = (0, index_js_1.compose)({
|
|
12
9
|
// default fields
|
|
13
|
-
keywords:
|
|
14
|
-
homepage:
|
|
15
|
-
bugs: (0,
|
|
16
|
-
license: (0,
|
|
17
|
-
licenses:
|
|
18
|
-
author: (0,
|
|
19
|
-
repository: (0,
|
|
20
|
-
scripts: (0,
|
|
21
|
-
$$default:
|
|
10
|
+
keywords: index_js_2.listConcat,
|
|
11
|
+
homepage: index_js_2.primitive,
|
|
12
|
+
bugs: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
|
|
13
|
+
license: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
|
|
14
|
+
licenses: index_js_2.listConcat,
|
|
15
|
+
author: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
|
|
16
|
+
repository: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
|
|
17
|
+
scripts: (0, index_js_1.mapSort)((0, index_js_1.compose)({
|
|
18
|
+
$$default: index_js_2.command,
|
|
22
19
|
})),
|
|
23
|
-
config: (0,
|
|
24
|
-
engines: (0,
|
|
25
|
-
dependencies: (0,
|
|
26
|
-
devDependencies: (0,
|
|
27
|
-
peerDependencies: (0,
|
|
28
|
-
optionalDependencies: (0,
|
|
29
|
-
bundledDependencies: (0,
|
|
20
|
+
config: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
21
|
+
engines: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
22
|
+
dependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
23
|
+
devDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
24
|
+
peerDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
25
|
+
optionalDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
26
|
+
bundledDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
|
|
30
27
|
// tools fields
|
|
31
|
-
browserslist:
|
|
28
|
+
browserslist: index_js_2.listConcat,
|
|
32
29
|
// other fields
|
|
33
30
|
$$ignore: [
|
|
34
31
|
'name',
|
|
@@ -40,8 +37,8 @@ const mainRoute = (0, compositors_1.compose)({
|
|
|
40
37
|
'cpu',
|
|
41
38
|
'preferGlobal',
|
|
42
39
|
],
|
|
43
|
-
$$default: (0,
|
|
40
|
+
$$default: (0, index_js_1.fork)([is_it_type_1.isArray, index_js_2.listConcat], [is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
|
|
44
41
|
});
|
|
45
|
-
const jsonRoute = (0,
|
|
46
|
-
const travelPlan = (0,
|
|
47
|
-
exports.default = (0,
|
|
42
|
+
const jsonRoute = (0, index_js_1.json)(mainRoute);
|
|
43
|
+
const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)(['package.json', jsonRoute]);
|
|
44
|
+
exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
|
package/lib/journeys/rc/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const mainRoute = (0,
|
|
9
|
-
$$default: (0,
|
|
3
|
+
const lodash_es_1 = require("lodash-es");
|
|
4
|
+
const index_js_1 = require("../../compositors/index.js");
|
|
5
|
+
const index_js_2 = require("../../routes/index.js");
|
|
6
|
+
const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
|
|
7
|
+
const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
|
|
8
|
+
const mainRoute = (0, index_js_1.compose)({
|
|
9
|
+
$$default: (0, index_js_1.fork)([Array.isArray, index_js_2.listConcat], [lodash_es_1.isPlainObject, index_js_2.mapConcat], index_js_2.primitive),
|
|
10
10
|
});
|
|
11
|
-
const jsonRoute = (0,
|
|
12
|
-
const yamlRoute = (0,
|
|
13
|
-
const rcRoute = (0,
|
|
14
|
-
const travelPlan = (0,
|
|
15
|
-
exports.default = (0,
|
|
11
|
+
const jsonRoute = (0, index_js_1.json)(mainRoute);
|
|
12
|
+
const yamlRoute = (0, index_js_1.yaml)(mainRoute);
|
|
13
|
+
const rcRoute = (0, index_js_1.rc)(mainRoute);
|
|
14
|
+
const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.\w+rc\.json$/, jsonRoute], [/^\.\w+rc\.ya?ml$/, yamlRoute], [/^\.\w+rc$/, rcRoute]);
|
|
15
|
+
exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const mainRoute = (0,
|
|
12
|
-
compilerOptions: (0,
|
|
13
|
-
lib:
|
|
14
|
-
$$default: (0,
|
|
3
|
+
const lodash_es_1 = require("lodash-es");
|
|
4
|
+
const index_js_1 = require("../../compositors/index.js");
|
|
5
|
+
const index_js_2 = require("../../routes/index.js");
|
|
6
|
+
const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
|
|
7
|
+
const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
|
|
8
|
+
const mainRoute = (0, index_js_1.compose)({
|
|
9
|
+
compilerOptions: (0, index_js_1.compose)({
|
|
10
|
+
lib: index_js_2.listConcat,
|
|
11
|
+
$$default: (0, index_js_1.fork)([Array.isArray, index_js_2.listConcat], [lodash_es_1.isPlainObject, index_js_2.mapConcat], index_js_2.primitive),
|
|
15
12
|
}),
|
|
16
|
-
$$default: (0,
|
|
13
|
+
$$default: (0, index_js_1.fork)([Array.isArray, index_js_2.listConcat], [lodash_es_1.isPlainObject, index_js_2.mapConcat], index_js_2.primitive),
|
|
17
14
|
});
|
|
18
|
-
const jsonRoute = (0,
|
|
19
|
-
const travelPlan = (0,
|
|
20
|
-
exports.default = (0,
|
|
15
|
+
const jsonRoute = (0, index_js_1.json)(mainRoute);
|
|
16
|
+
const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)([/tsconfig(?:\.\w+)?\.json$/, jsonRoute]);
|
|
17
|
+
exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stringify = exports.parse = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return
|
|
4
|
+
var parse_js_1 = require("./parse.js");
|
|
5
|
+
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.parse; } });
|
|
6
|
+
var stringify_js_1 = require("./stringify.js");
|
|
7
|
+
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.stringify; } });
|
|
@@ -20,7 +20,6 @@ function parse(text) {
|
|
|
20
20
|
let lastKid;
|
|
21
21
|
(0, jsonc_parser_1.visit)(text, {
|
|
22
22
|
onObjectBegin(offset, length, startLine, _startCharacter) {
|
|
23
|
-
// console.log('onObjectBegin', startLine)
|
|
24
23
|
if (current) {
|
|
25
24
|
stack.unshift(current);
|
|
26
25
|
}
|
|
@@ -46,11 +45,9 @@ function parse(text) {
|
|
|
46
45
|
lastOffset = offset + length;
|
|
47
46
|
},
|
|
48
47
|
onObjectProperty(name, _offset, _length, _startLine, _startCharacter) {
|
|
49
|
-
// console.log('onObjectProperty', name, _startLine, _startCharacter)
|
|
50
48
|
property = name;
|
|
51
49
|
},
|
|
52
50
|
onObjectEnd(offset, length, startLine, _startCharacter) {
|
|
53
|
-
// console.log('onObjectEnd', startLine, startCharacter)
|
|
54
51
|
if (stack.length > 0) {
|
|
55
52
|
lastKid = transform;
|
|
56
53
|
current = stack.shift();
|
|
@@ -60,7 +57,6 @@ function parse(text) {
|
|
|
60
57
|
lastOffset = offset + length;
|
|
61
58
|
},
|
|
62
59
|
onArrayBegin(offset, length, startLine, _startCharacter) {
|
|
63
|
-
// console.log('onArrayBegin', startLine, _startCharacter)
|
|
64
60
|
if (current) {
|
|
65
61
|
stack.unshift(current);
|
|
66
62
|
}
|
|
@@ -86,7 +82,6 @@ function parse(text) {
|
|
|
86
82
|
lastOffset = offset + length;
|
|
87
83
|
},
|
|
88
84
|
onArrayEnd(offset, length, startLine, _startCharacter) {
|
|
89
|
-
// console.log('onArrayEnd', startLine, _startCharacter)
|
|
90
85
|
if (stack.length > 0) {
|
|
91
86
|
lastKid = transform;
|
|
92
87
|
current = stack.shift();
|
|
@@ -96,7 +91,6 @@ function parse(text) {
|
|
|
96
91
|
lastOffset = offset + length;
|
|
97
92
|
},
|
|
98
93
|
onLiteralValue(value, offset, length, startLine, _startCharacter) {
|
|
99
|
-
// console.log('onLiteralValue', startLine, _startCharacter)
|
|
100
94
|
if (current) {
|
|
101
95
|
if (Array.isArray(current)) {
|
|
102
96
|
lastKid = {};
|
|
@@ -132,13 +126,9 @@ function parse(text) {
|
|
|
132
126
|
lastOffset = offset + length;
|
|
133
127
|
},
|
|
134
128
|
onSeparator(_character, offset, length, _startLine, _startCharacter) {
|
|
135
|
-
|
|
136
|
-
if (lastOffset) {
|
|
137
|
-
lastOffset = offset + length;
|
|
138
|
-
}
|
|
129
|
+
lastOffset &&= offset + length;
|
|
139
130
|
},
|
|
140
131
|
onComment(offset, length, startLine, _startCharacter) {
|
|
141
|
-
// console.log('onComment', startLine, _startCharacter)
|
|
142
132
|
let line = text.slice(offset, offset + length);
|
|
143
133
|
if (startLine === lastLine && lastKid) {
|
|
144
134
|
line = text.slice(lastOffset, lastOffset + offset - lastOffset) + line;
|
|
@@ -179,13 +169,11 @@ function parse(text) {
|
|
|
179
169
|
}
|
|
180
170
|
},
|
|
181
171
|
onError(error, _offset, _length, _startLine, _startCharacter) {
|
|
182
|
-
// console.log('onError', error, _startLine, _startCharacter)
|
|
183
172
|
if ((error === 3 /* ParseErrorCode.PropertyNameExpected */ || error === 4 /* ParseErrorCode.ValueExpected */) && lastKid) {
|
|
184
173
|
lastKid.separator = true;
|
|
185
174
|
}
|
|
186
175
|
},
|
|
187
176
|
});
|
|
188
|
-
// console.log(JSON.stringify(transform, null, 2))
|
|
189
177
|
return {
|
|
190
178
|
data: current,
|
|
191
179
|
transform,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stringify = stringify;
|
|
4
|
-
const
|
|
4
|
+
const lodash_es_1 = require("lodash-es");
|
|
5
5
|
function stringify(data, transform = {}) {
|
|
6
6
|
const result = format(data, '', transform);
|
|
7
7
|
return result;
|
|
@@ -14,7 +14,7 @@ function format(data, indentValue, transform, separator = false) {
|
|
|
14
14
|
result += ',';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
else if ((0,
|
|
17
|
+
else if ((0, lodash_es_1.isPlainObject)(data)) {
|
|
18
18
|
result = formatObject(data, indentValue, transform);
|
|
19
19
|
if (separator) {
|
|
20
20
|
result += ',';
|
package/lib/routes/command.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = command;
|
|
4
|
-
const
|
|
5
|
-
function command({ current, incoming }) {
|
|
4
|
+
const index_js_1 = require("../utils/command/index.js");
|
|
5
|
+
async function command({ current, incoming }) {
|
|
6
6
|
if (!incoming) {
|
|
7
7
|
return current ?? '';
|
|
8
8
|
}
|
|
@@ -18,22 +18,22 @@ function command({ current, incoming }) {
|
|
|
18
18
|
const incomingCommand = trueAndMatch[1].trim();
|
|
19
19
|
return currentSegments.has(incomingCommand) ? current : `${current} && ${incomingCommand}`;
|
|
20
20
|
}
|
|
21
|
-
const mixed = (0,
|
|
21
|
+
const mixed = (0, index_js_1.mergeWithSemicolonMix)(current, incoming);
|
|
22
22
|
if (mixed) {
|
|
23
23
|
return mixed;
|
|
24
24
|
}
|
|
25
|
-
const andMerged = (0,
|
|
25
|
+
const andMerged = (0, index_js_1.mergeAndChains)(current, incoming);
|
|
26
26
|
if (andMerged) {
|
|
27
27
|
return andMerged;
|
|
28
28
|
}
|
|
29
29
|
if (incoming.includes('||')) {
|
|
30
|
-
return (0,
|
|
30
|
+
return (0, index_js_1.mergeOrSegments)(current, incoming);
|
|
31
31
|
}
|
|
32
32
|
if (incoming.includes(';')) {
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, index_js_1.mergeSemicolonSegments)(current, incoming);
|
|
34
34
|
}
|
|
35
|
-
const currentCommand = (0,
|
|
36
|
-
const incomingCommand = (0,
|
|
37
|
-
const merged = (0,
|
|
38
|
-
return (0,
|
|
35
|
+
const currentCommand = (0, index_js_1.splitCommand)(current);
|
|
36
|
+
const incomingCommand = (0, index_js_1.splitCommand)(incoming);
|
|
37
|
+
const merged = await (0, index_js_1.mergeCommandRecords)(currentCommand, incomingCommand, current);
|
|
38
|
+
return (0, index_js_1.joinCommand)(merged);
|
|
39
39
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { command } from './command.js';
|
|
2
|
+
export { mapConcat } from './map-concat.js';
|
|
3
|
+
export { mapDelete } from './map-delete.js';
|
|
4
|
+
export { linesConcat } from './lines-concat.js';
|
|
5
|
+
export { listConcat } from './list-concat.js';
|
|
6
|
+
export { listSortConcat } from './list-sort-concat.js';
|
|
7
|
+
export { overwrite } from './overwrite.js';
|
|
8
|
+
export { primitive } from './primitive.js';
|
package/lib/routes/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.primitive = exports.overwrite = exports.listSortConcat = exports.listConcat = exports.linesConcat = exports.mapConcat = exports.command = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "command", { enumerable: true, get: function () { return
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "mapConcat", { enumerable: true, get: function () { return
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
var
|
|
11
|
-
Object.defineProperty(exports, "
|
|
12
|
-
var
|
|
13
|
-
Object.defineProperty(exports, "
|
|
14
|
-
var
|
|
15
|
-
Object.defineProperty(exports, "
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.primitive = exports.overwrite = exports.listSortConcat = exports.listConcat = exports.linesConcat = exports.mapDelete = exports.mapConcat = exports.command = void 0;
|
|
4
|
+
var command_js_1 = require("./command.js");
|
|
5
|
+
Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_js_1.command; } });
|
|
6
|
+
var map_concat_js_1 = require("./map-concat.js");
|
|
7
|
+
Object.defineProperty(exports, "mapConcat", { enumerable: true, get: function () { return map_concat_js_1.mapConcat; } });
|
|
8
|
+
var map_delete_js_1 = require("./map-delete.js");
|
|
9
|
+
Object.defineProperty(exports, "mapDelete", { enumerable: true, get: function () { return map_delete_js_1.mapDelete; } });
|
|
10
|
+
var lines_concat_js_1 = require("./lines-concat.js");
|
|
11
|
+
Object.defineProperty(exports, "linesConcat", { enumerable: true, get: function () { return lines_concat_js_1.linesConcat; } });
|
|
12
|
+
var list_concat_js_1 = require("./list-concat.js");
|
|
13
|
+
Object.defineProperty(exports, "listConcat", { enumerable: true, get: function () { return list_concat_js_1.listConcat; } });
|
|
14
|
+
var list_sort_concat_js_1 = require("./list-sort-concat.js");
|
|
15
|
+
Object.defineProperty(exports, "listSortConcat", { enumerable: true, get: function () { return list_sort_concat_js_1.listSortConcat; } });
|
|
16
|
+
var overwrite_js_1 = require("./overwrite.js");
|
|
17
|
+
Object.defineProperty(exports, "overwrite", { enumerable: true, get: function () { return overwrite_js_1.overwrite; } });
|
|
18
|
+
var primitive_js_1 = require("./primitive.js");
|
|
19
|
+
Object.defineProperty(exports, "primitive", { enumerable: true, get: function () { return primitive_js_1.primitive; } });
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.linesConcat = linesConcat;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
function linesConcat({ current, incoming }) {
|
|
4
|
+
const to_lines_js_1 = require("../utils/to-lines.js");
|
|
5
|
+
const trim_final_newline_js_1 = require("../utils/trim-final-newline.js");
|
|
6
|
+
const list_concat_js_1 = require("./list-concat.js");
|
|
7
|
+
async function linesConcat({ current, incoming }) {
|
|
8
8
|
if (!incoming) {
|
|
9
9
|
return current ?? '';
|
|
10
10
|
}
|
|
11
11
|
if (!current) {
|
|
12
12
|
return incoming;
|
|
13
13
|
}
|
|
14
|
-
const currentLines = (0,
|
|
15
|
-
const incomingLines = (0,
|
|
16
|
-
const result = (0,
|
|
14
|
+
const currentLines = (0, to_lines_js_1.toLines)((0, trim_final_newline_js_1.trimFinalNewLine)(current));
|
|
15
|
+
const incomingLines = (0, to_lines_js_1.toLines)((0, trim_final_newline_js_1.trimFinalNewLine)(incoming));
|
|
16
|
+
const result = await (0, list_concat_js_1.listConcat)({
|
|
17
17
|
current: currentLines,
|
|
18
18
|
incoming: incomingLines,
|
|
19
19
|
});
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.listConcat = listConcat;
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
function listConcat({ current, incoming }) {
|
|
4
|
+
const lodash_es_1 = require("lodash-es");
|
|
5
|
+
async function listConcat({ current, incoming }) {
|
|
10
6
|
if (!incoming) {
|
|
11
7
|
return current ?? [];
|
|
12
8
|
}
|
|
13
9
|
if (!current) {
|
|
14
10
|
return incoming;
|
|
15
11
|
}
|
|
16
|
-
return (0,
|
|
12
|
+
return (0, lodash_es_1.uniqWith)([...current, ...incoming], lodash_es_1.isEqual);
|
|
17
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listSortConcat = listSortConcat;
|
|
4
|
-
function listSortConcat({ current, incoming }) {
|
|
4
|
+
async function listSortConcat({ current, incoming }) {
|
|
5
5
|
if (!incoming) {
|
|
6
6
|
return current ?? [];
|
|
7
7
|
}
|
package/lib/routes/map-concat.js
CHANGED