From e3a0075af1c64f9fe50d793259d3bd2683d037db Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 6 Sep 2023 18:25:39 -0500 Subject: [PATCH 1/4] Ignore tap-testdir-*/ --- .gitignore | 1 + lib/content/index.js | 4 +++- tap-snapshots/test/apply/source-snapshots.js.test.cjs | 6 ++++++ tap-snapshots/test/check/snapshots.js.test.cjs | 4 ++++ workspace/test-workspace/.gitignore | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 135c3883..011be15a 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ !/SECURITY.md !/tap-snapshots/ !/test/ +tap-testdir-*/ !/workspace/ /workspace/* !/workspace/test-workspace/ diff --git a/lib/content/index.js b/lib/content/index.js index dfd94ff1..528bb060 100644 --- a/lib/content/index.js +++ b/lib/content/index.js @@ -155,7 +155,9 @@ module.exports = { '/LICENSE*', '/CHANGELOG*', ], - ignorePaths: [], + ignorePaths: [ + 'tap-testdir-*/', + ], ciVersions: ['14.17.0', '14.x', '16.13.0', '16.x', '18.0.0', '18.x'], lockfile: false, codeowner: '@npm/cli-team', diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index 10004654..9ce4a40d 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -1261,6 +1261,7 @@ jobs: !/SECURITY.md !/tap-snapshots/ !/test/ +tap-testdir-*/ .npmrc ======================================== @@ -2941,6 +2942,7 @@ jobs: !/SECURITY.md !/tap-snapshots/ !/test/ +tap-testdir-*/ !/workspaces/ /workspaces/* !/workspaces/a/ @@ -3171,6 +3173,7 @@ workspaces/a/.gitignore !/scripts/ !/tap-snapshots/ !/test/ +tap-testdir-*/ workspaces/a/package.json ======================================== @@ -3249,6 +3252,7 @@ workspaces/b/.gitignore !/scripts/ !/tap-snapshots/ !/test/ +tap-testdir-*/ workspaces/b/package.json ======================================== @@ -4549,6 +4553,7 @@ workspaces/a/.gitignore !/scripts/ !/tap-snapshots/ !/test/ +tap-testdir-*/ workspaces/a/package.json ======================================== @@ -4627,6 +4632,7 @@ workspaces/b/.gitignore !/scripts/ !/tap-snapshots/ !/test/ +tap-testdir-*/ workspaces/b/package.json ======================================== diff --git a/tap-snapshots/test/check/snapshots.js.test.cjs b/tap-snapshots/test/check/snapshots.js.test.cjs index c7bdff3f..79a21cfc 100644 --- a/tap-snapshots/test/check/snapshots.js.test.cjs +++ b/tap-snapshots/test/check/snapshots.js.test.cjs @@ -146,6 +146,7 @@ To correct it: move files to not match one of the following patterns: !/SECURITY.md !/tap-snapshots/ !/test/ + tap-testdir-*/ ------------------------------------------------------------------- ` @@ -185,6 +186,7 @@ To correct it: move files to not match one of the following patterns: !/SECURITY.md !/tap-snapshots/ !/test/ + tap-testdir-*/ !/workspaces/ /workspaces/* !/workspaces/a/ @@ -214,6 +216,7 @@ To correct it: move files to not match one of the following patterns: !/scripts/ !/tap-snapshots/ !/test/ + tap-testdir-*/ ------------------------------------------------------------------- @@ -239,6 +242,7 @@ To correct it: move files to not match one of the following patterns: !/scripts/ !/tap-snapshots/ !/test/ + tap-testdir-*/ ------------------------------------------------------------------- ` diff --git a/workspace/test-workspace/.gitignore b/workspace/test-workspace/.gitignore index 79af2bfc..38c58a7d 100644 --- a/workspace/test-workspace/.gitignore +++ b/workspace/test-workspace/.gitignore @@ -19,3 +19,4 @@ !/scripts/ !/tap-snapshots/ !/test/ +tap-testdir-*/ From d1658bb5440407962a1308e44160f1a8b415feb8 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 14 Sep 2023 12:42:37 -0500 Subject: [PATCH 2/4] Move ignored files to lib/content/gitignore --- .gitignore | 3 ++- lib/content/gitignore | 2 ++ lib/content/index.js | 2 +- package.json | 2 +- .../test/apply/source-snapshots.js.test.cjs | 18 ++++++++++++------ tap-snapshots/test/check/snapshots.js.test.cjs | 8 ++++---- workspace/test-workspace/.gitignore | 3 ++- workspace/test-workspace/package.json | 2 +- 8 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 011be15a..411ec4df 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -27,7 +29,6 @@ !/SECURITY.md !/tap-snapshots/ !/test/ -tap-testdir-*/ !/workspace/ /workspace/* !/workspace/test-workspace/ diff --git a/lib/content/gitignore b/lib/content/gitignore index d9d4b23e..21074e32 100644 --- a/lib/content/gitignore +++ b/lib/content/gitignore @@ -1,5 +1,7 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these {{#each ignorePaths}} diff --git a/lib/content/index.js b/lib/content/index.js index 528bb060..2f8832fa 100644 --- a/lib/content/index.js +++ b/lib/content/index.js @@ -156,7 +156,7 @@ module.exports = { '/CHANGELOG*', ], ignorePaths: [ - 'tap-testdir-*/', + /* to be provided by consuming package */ ], ciVersions: ['14.17.0', '14.x', '16.13.0', '16.x', '18.0.0', '18.x'], lockfile: false, diff --git a/package.json b/package.json index 3499cb74..3bd02b57 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/template-oss.git" + "url": "https://github.com/rotu/npm-template-oss.git" }, "keywords": [ "npm", diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index 9ce4a40d..6997fce3 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -1236,6 +1236,8 @@ jobs: # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -1261,7 +1263,6 @@ jobs: !/SECURITY.md !/tap-snapshots/ !/test/ -tap-testdir-*/ .npmrc ======================================== @@ -2917,6 +2918,8 @@ jobs: # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -2942,7 +2945,6 @@ jobs: !/SECURITY.md !/tap-snapshots/ !/test/ -tap-testdir-*/ !/workspaces/ /workspaces/* !/workspaces/a/ @@ -3156,6 +3158,8 @@ workspaces/a/.gitignore # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -3173,7 +3177,6 @@ workspaces/a/.gitignore !/scripts/ !/tap-snapshots/ !/test/ -tap-testdir-*/ workspaces/a/package.json ======================================== @@ -3235,6 +3238,8 @@ workspaces/b/.gitignore # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -3252,7 +3257,6 @@ workspaces/b/.gitignore !/scripts/ !/tap-snapshots/ !/test/ -tap-testdir-*/ workspaces/b/package.json ======================================== @@ -4536,6 +4540,8 @@ workspaces/a/.gitignore # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -4553,7 +4559,6 @@ workspaces/a/.gitignore !/scripts/ !/tap-snapshots/ !/test/ -tap-testdir-*/ workspaces/a/package.json ======================================== @@ -4615,6 +4620,8 @@ workspaces/b/.gitignore # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -4632,7 +4639,6 @@ workspaces/b/.gitignore !/scripts/ !/tap-snapshots/ !/test/ -tap-testdir-*/ workspaces/b/package.json ======================================== diff --git a/tap-snapshots/test/check/snapshots.js.test.cjs b/tap-snapshots/test/check/snapshots.js.test.cjs index 79a21cfc..6bfa3e3b 100644 --- a/tap-snapshots/test/check/snapshots.js.test.cjs +++ b/tap-snapshots/test/check/snapshots.js.test.cjs @@ -123,6 +123,7 @@ The following files are tracked by git but matching a pattern in .gitignore: To correct it: move files to not match one of the following patterns: /* + tap-testdir*/ !**/.gitignore !/.commitlintrc.js !/.eslintrc.js @@ -146,7 +147,6 @@ To correct it: move files to not match one of the following patterns: !/SECURITY.md !/tap-snapshots/ !/test/ - tap-testdir-*/ ------------------------------------------------------------------- ` @@ -163,6 +163,7 @@ The following files are tracked by git but matching a pattern in .gitignore: To correct it: move files to not match one of the following patterns: /* + tap-testdir*/ !**/.gitignore !/.commitlintrc.js !/.eslintrc.js @@ -186,7 +187,6 @@ To correct it: move files to not match one of the following patterns: !/SECURITY.md !/tap-snapshots/ !/test/ - tap-testdir-*/ !/workspaces/ /workspaces/* !/workspaces/a/ @@ -201,6 +201,7 @@ The following files are tracked by git but matching a pattern in workspaces/a/.g To correct it: move files to not match one of the following patterns: /* + tap-testdir*/ !**/.gitignore !/.eslintrc.js !/.eslintrc.local.* @@ -216,7 +217,6 @@ To correct it: move files to not match one of the following patterns: !/scripts/ !/tap-snapshots/ !/test/ - tap-testdir-*/ ------------------------------------------------------------------- @@ -227,6 +227,7 @@ The following files are tracked by git but matching a pattern in workspaces/b/.g To correct it: move files to not match one of the following patterns: /* + tap-testdir*/ !**/.gitignore !/.eslintrc.js !/.eslintrc.local.* @@ -242,7 +243,6 @@ To correct it: move files to not match one of the following patterns: !/scripts/ !/tap-snapshots/ !/test/ - tap-testdir-*/ ------------------------------------------------------------------- ` diff --git a/workspace/test-workspace/.gitignore b/workspace/test-workspace/.gitignore index 38c58a7d..a96d056a 100644 --- a/workspace/test-workspace/.gitignore +++ b/workspace/test-workspace/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -19,4 +21,3 @@ !/scripts/ !/tap-snapshots/ !/test/ -tap-testdir-*/ diff --git a/workspace/test-workspace/package.json b/workspace/test-workspace/package.json index 148cf346..e20466cb 100644 --- a/workspace/test-workspace/package.json +++ b/workspace/test-workspace/package.json @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/template-oss.git", + "url": "https://github.com/rotu/npm-template-oss.git", "directory": "workspace/test-workspace" }, "keywords": [], From 57df6ee90c1726222875324bc731da74f13fb1a0 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 14 Sep 2023 12:56:20 -0500 Subject: [PATCH 3/4] Also add tap-testdir*/ to eslintrc --- .eslintrc.js | 1 + lib/content/eslintrc.js | 3 +-- .../test/apply/source-snapshots.js.test.cjs | 16 ++++++++++++++++ workspace/test-workspace/.eslintrc.js | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 11ee4479..0c65d1f5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, ignorePatterns: [ + 'tap-testdir*/', 'workspace/test-workspace/**', ], extends: [ diff --git a/lib/content/eslintrc.js b/lib/content/eslintrc.js index 8ee511c7..96996354 100644 --- a/lib/content/eslintrc.js +++ b/lib/content/eslintrc.js @@ -8,13 +8,12 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, - {{#if workspaceGlobs}} ignorePatterns: [ + 'tap-testdir*/', {{#each workspaceGlobs}} '{{ . }}', {{/each}} ], - {{/if}} extends: [ '@npmcli', ...localConfigs, diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index 6997fce3..d41da473 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -33,6 +33,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, @@ -1476,6 +1479,7 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, ignorePatterns: [ + 'tap-testdir*/', 'workspaces/a/**', 'workspaces/b/**', ], @@ -3146,6 +3150,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, @@ -3226,6 +3233,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, @@ -4528,6 +4538,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, @@ -4608,6 +4621,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspace/test-workspace/.eslintrc.js b/workspace/test-workspace/.eslintrc.js index 5db9f815..f21d26ec 100644 --- a/workspace/test-workspace/.eslintrc.js +++ b/workspace/test-workspace/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, From 454154ec334226306dc38babe20b15714c8c8d78 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 14 Sep 2023 17:00:48 -0500 Subject: [PATCH 4/4] revert accidental change to repository url --- package.json | 2 +- workspace/test-workspace/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a68347f4..c5910a63 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/rotu/npm-template-oss.git" + "url": "https://github.com/npm/template-oss.git" }, "keywords": [ "npm", diff --git a/workspace/test-workspace/package.json b/workspace/test-workspace/package.json index e20466cb..148cf346 100644 --- a/workspace/test-workspace/package.json +++ b/workspace/test-workspace/package.json @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/rotu/npm-template-oss.git", + "url": "https://github.com/npm/template-oss.git", "directory": "workspace/test-workspace" }, "keywords": [],