@hanseltime/template-repo-sync 2.1.1 → 2.1.2
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/CHANGELOG.md +7 -0
- package/lib/cjs/template-sync.js +5 -0
- package/lib/esm/template-sync.js +5 -0
- package/package.json +1 -1
- package/src/template-sync.spec.ts +1 -1
- package/src/template-sync.ts +12 -0
- package/test-fixtures/downstream/src/templated.js +1 -1
- package/test-fixtures/downstream/src/templated.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [2.1.2](https://github.com/HanseltimeIndustries/template-repo-sync/compare/v2.1.1...v2.1.2) (2026-02-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* afterref was skipping template ignores ([270b926](https://github.com/HanseltimeIndustries/template-repo-sync/commit/270b926983ddc7070c2099cfa8fa507d1b527233))
|
|
7
|
+
|
|
1
8
|
## [2.1.1](https://github.com/HanseltimeIndustries/template-repo-sync/compare/v2.1.0...v2.1.1) (2026-02-08)
|
|
2
9
|
|
|
3
10
|
|
package/lib/cjs/template-sync.js
CHANGED
|
@@ -34,6 +34,7 @@ const ref_drivers_1 = require("./ref-drivers");
|
|
|
34
34
|
const formatting_1 = require("./formatting");
|
|
35
35
|
const commentJSON = __importStar(require("comment-json"));
|
|
36
36
|
const checkout_drivers_1 = require("./checkout-drivers");
|
|
37
|
+
const micromatch_1 = require("micromatch");
|
|
37
38
|
exports.TEMPLATE_SYNC_CONFIG = "templatesync";
|
|
38
39
|
exports.TEMPLATE_SYNC_LOCAL_CONFIG = "templatesync.local";
|
|
39
40
|
async function templateSync(options) {
|
|
@@ -78,6 +79,10 @@ async function templateSync(options) {
|
|
|
78
79
|
modified: [],
|
|
79
80
|
};
|
|
80
81
|
}
|
|
82
|
+
// Apply ignore filters
|
|
83
|
+
filesToSync.added = filesToSync.added.filter((f) => !(0, micromatch_1.some)(f, templateSyncConfig.ignore));
|
|
84
|
+
filesToSync.modified = filesToSync.modified.filter((f) => !(0, micromatch_1.some)(f, templateSyncConfig.ignore));
|
|
85
|
+
filesToSync.deleted = filesToSync.deleted.filter((f) => !(0, micromatch_1.some)(f, templateSyncConfig.ignore));
|
|
81
86
|
const localSkipFiles = [];
|
|
82
87
|
const localFileChanges = {};
|
|
83
88
|
const fileSyncFactory = (op) => {
|
package/lib/esm/template-sync.js
CHANGED
|
@@ -34,6 +34,7 @@ const ref_drivers_1 = require("./ref-drivers");
|
|
|
34
34
|
const formatting_1 = require("./formatting");
|
|
35
35
|
const commentJSON = __importStar(require("comment-json"));
|
|
36
36
|
const checkout_drivers_1 = require("./checkout-drivers");
|
|
37
|
+
const micromatch_1 = require("micromatch");
|
|
37
38
|
exports.TEMPLATE_SYNC_CONFIG = "templatesync";
|
|
38
39
|
exports.TEMPLATE_SYNC_LOCAL_CONFIG = "templatesync.local";
|
|
39
40
|
async function templateSync(options) {
|
|
@@ -78,6 +79,10 @@ async function templateSync(options) {
|
|
|
78
79
|
modified: [],
|
|
79
80
|
};
|
|
80
81
|
}
|
|
82
|
+
// Apply ignore filters
|
|
83
|
+
filesToSync.added = filesToSync.added.filter((f) => !(0, micromatch_1.some)(f, templateSyncConfig.ignore));
|
|
84
|
+
filesToSync.modified = filesToSync.modified.filter((f) => !(0, micromatch_1.some)(f, templateSyncConfig.ignore));
|
|
85
|
+
filesToSync.deleted = filesToSync.deleted.filter((f) => !(0, micromatch_1.some)(f, templateSyncConfig.ignore));
|
|
81
86
|
const localSkipFiles = [];
|
|
82
87
|
const localFileChanges = {};
|
|
83
88
|
const fileSyncFactory = (op) => {
|
package/package.json
CHANGED
|
@@ -256,7 +256,7 @@ describe("templateSync", () => {
|
|
|
256
256
|
// We will only update the templated.ts
|
|
257
257
|
const mockDiffDriver = jest.fn().mockImplementation(async () => ({
|
|
258
258
|
added: ["src/templated.ts"],
|
|
259
|
-
modified: [],
|
|
259
|
+
modified: ["src/index.ts"], // Add index.ts so we make sure it is still ignored - due to a bug
|
|
260
260
|
deleted: [],
|
|
261
261
|
}));
|
|
262
262
|
const mockCurrentRefDriver = jest
|
package/src/template-sync.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { TemplateRefDriverFn } from "./ref-drivers/types";
|
|
|
12
12
|
import { inferJSONIndent } from "./formatting";
|
|
13
13
|
import * as commentJSON from "comment-json";
|
|
14
14
|
import { TemplateCheckoutDriverFn, gitCheckout } from "./checkout-drivers";
|
|
15
|
+
import { some } from "micromatch";
|
|
15
16
|
|
|
16
17
|
export interface TemplateSyncOptions {
|
|
17
18
|
/**
|
|
@@ -141,6 +142,17 @@ export async function templateSync(
|
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
// Apply ignore filters
|
|
146
|
+
filesToSync.added = filesToSync.added.filter(
|
|
147
|
+
(f) => !some(f, templateSyncConfig.ignore),
|
|
148
|
+
);
|
|
149
|
+
filesToSync.modified = filesToSync.modified.filter(
|
|
150
|
+
(f) => !some(f, templateSyncConfig.ignore),
|
|
151
|
+
);
|
|
152
|
+
filesToSync.deleted = filesToSync.deleted.filter(
|
|
153
|
+
(f) => !some(f, templateSyncConfig.ignore),
|
|
154
|
+
);
|
|
155
|
+
|
|
144
156
|
const localSkipFiles: string[] = [];
|
|
145
157
|
const localFileChanges: {
|
|
146
158
|
[filePath: string]: Change[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
console.log("this is
|
|
2
|
+
console.log("this is downstream stuff that should not change");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
console.log("this is
|
|
1
|
+
console.log("this is downstream stuff that should not change");
|