@atom-learning/components 12.0.0-beta.1 → 12.0.0-beta.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/dist/codemods/bin.js
CHANGED
|
@@ -448,6 +448,12 @@ var transform = async (file) => {
|
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
+
const source = file.getFullText();
|
|
452
|
+
const flaggedBefore = /\/\* TODO\(ds-v12\)[^*]*\*\/\s*$/;
|
|
453
|
+
const flaggedAfter = /^\s*\/\* TODO\(ds-v12\)/;
|
|
454
|
+
const pending = edits.filter((edit) => !edit.text.includes(TODO) || !(flaggedBefore.test(source.slice(Math.max(0, edit.start - 300), edit.start)) || flaggedAfter.test(source.slice(edit.end))));
|
|
455
|
+
edits.length = 0;
|
|
456
|
+
edits.push(...pending);
|
|
451
457
|
if (!edits.length) return void 0;
|
|
452
458
|
let text = file.getFullText();
|
|
453
459
|
for (const edit of edits.sort((a, b) => b.start - a.start || b.end - a.end)) text = `${text.slice(0, edit.start)}${edit.text}${text.slice(edit.end)}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atom-learning/components",
|
|
3
|
-
"version": "12.0.0-beta.
|
|
3
|
+
"version": "12.0.0-beta.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/Atom-Learning/components#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "git+https://github.com/Atom-Learning/components.git"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
|
-
"atom-components-codemod": "./
|
|
16
|
+
"atom-components-codemod": "./scripts/codemod.mjs"
|
|
17
17
|
},
|
|
18
18
|
"source": "src/index.ts",
|
|
19
19
|
"files": [
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"src/utilities.css",
|
|
24
24
|
"src/responsive-variant-classes.css",
|
|
25
25
|
"scripts/vite-plugin-tailwind-responsive-variant-classes.mjs",
|
|
26
|
-
"scripts/generate-responsive-variant-classes.mjs"
|
|
26
|
+
"scripts/generate-responsive-variant-classes.mjs",
|
|
27
|
+
"scripts/codemod.mjs"
|
|
27
28
|
],
|
|
28
29
|
"type": "module",
|
|
29
30
|
"sideEffects": false,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The bin entry for atom-components-codemod. It's committed rather than built,
|
|
3
|
+
// because npm checks bin files when it reads package.json, before
|
|
4
|
+
// prepublishOnly builds dist; the codemods themselves live in dist/codemods.
|
|
5
|
+
import '../dist/codemods/bin.js'
|