extension-create 3.8.5 → 3.8.7
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/module.cjs +10 -7
- package/package.json +4 -3
package/dist/module.cjs
CHANGED
|
@@ -765,21 +765,24 @@ const globalLines = [
|
|
|
765
765
|
];
|
|
766
766
|
async function writeGitignore(projectPath) {
|
|
767
767
|
const gitIgnorePath = external_path_namespaceObject.join(projectPath, '.gitignore');
|
|
768
|
-
const
|
|
768
|
+
const paths = new Set();
|
|
769
|
+
let currentContents = '';
|
|
770
|
+
currentContents = await promises_namespaceObject.readFile(gitIgnorePath, 'utf8').catch((err)=>{
|
|
771
|
+
if ('ENOENT' === err.code) return '';
|
|
769
772
|
console.error(err);
|
|
770
773
|
throw err;
|
|
771
774
|
});
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
autoClose: false
|
|
775
|
-
})){
|
|
776
|
-
line = line.trim();
|
|
775
|
+
for (const rawLine of currentContents.split(/\r?\n/)){
|
|
776
|
+
const line = rawLine.trim();
|
|
777
777
|
if (0 !== line.length) paths.add(line);
|
|
778
778
|
}
|
|
779
779
|
const linesToAdd = globalLines.filter((line)=>!paths.has(line));
|
|
780
780
|
while('' === linesToAdd[linesToAdd.length - 1])linesToAdd.pop();
|
|
781
|
+
if (0 === linesToAdd.length) return;
|
|
781
782
|
console.log(writingGitIgnore());
|
|
782
|
-
|
|
783
|
+
const shouldPrefixWithNewline = currentContents.length > 0 && !currentContents.endsWith('\n');
|
|
784
|
+
const contentToAppend = `${shouldPrefixWithNewline ? '\n' : ''}${linesToAdd.join('\n')}`;
|
|
785
|
+
await promises_namespaceObject.appendFile(gitIgnorePath, contentToAppend).catch((err)=>{
|
|
783
786
|
console.error(err);
|
|
784
787
|
throw err;
|
|
785
788
|
});
|
package/package.json
CHANGED
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"development": "./module.
|
|
14
|
+
"development": "./dist/module.cjs",
|
|
15
15
|
"types": "./dist/module.d.ts",
|
|
16
16
|
"import": "./dist/module.cjs",
|
|
17
|
-
"require": "./dist/module.cjs"
|
|
17
|
+
"require": "./dist/module.cjs",
|
|
18
|
+
"default": "./dist/module.cjs"
|
|
18
19
|
}
|
|
19
20
|
},
|
|
20
21
|
"main": "./dist/module.cjs",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"dist"
|
|
24
25
|
],
|
|
25
26
|
"name": "extension-create",
|
|
26
|
-
"version": "3.8.
|
|
27
|
+
"version": "3.8.7",
|
|
27
28
|
"description": "The standalone extension creation engine for Extension.js",
|
|
28
29
|
"author": {
|
|
29
30
|
"name": "Cezar Augusto",
|