create-finalbuildwp 0.1.0 → 0.1.1
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/create-finalbuildwp.js +11 -6
- package/package.json +1 -1
- package/templates/gitignore +36 -0
|
@@ -110,19 +110,24 @@ async function main() {
|
|
|
110
110
|
fs.mkdirSync(target, { recursive: true });
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
// Шаблон без точки в имени: npm не кладёт в tarball файлы вроде templates/.gitignore
|
|
113
114
|
const tplRoot = path.join(__dirname, '..', 'templates');
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
const fileCopies = [
|
|
116
|
+
['composer.json', 'composer.json'],
|
|
117
|
+
['gitignore', '.gitignore'],
|
|
118
|
+
['README.md', 'README.md'],
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
for (const [srcName, destName] of fileCopies) {
|
|
122
|
+
const src = path.join(tplRoot, srcName);
|
|
118
123
|
let content = fs.readFileSync(src, 'utf8');
|
|
119
|
-
if (
|
|
124
|
+
if (srcName === 'composer.json') {
|
|
120
125
|
content = content
|
|
121
126
|
.replace(/\{\{VCS_URL\}\}/g, vcsUrl)
|
|
122
127
|
.replace(/\{\{COMPOSER_NAME\}\}/g, composerName)
|
|
123
128
|
.replace(/\{\{PACKAGE_CONSTRAINT\}\}/g, packageConstraint);
|
|
124
129
|
}
|
|
125
|
-
fs.writeFileSync(path.join(target,
|
|
130
|
+
fs.writeFileSync(path.join(target, destName), content, 'utf8');
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
console.log(`\nСоздан проект: ${target}\n`);
|
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Composer
|
|
2
|
+
/vendor/
|
|
3
|
+
composer.lock
|
|
4
|
+
|
|
5
|
+
# WordPress Core (в корне проекта после переноса)
|
|
6
|
+
/wp-admin/
|
|
7
|
+
/wp-includes/
|
|
8
|
+
/index.php
|
|
9
|
+
/xmlrpc.php
|
|
10
|
+
/license.txt
|
|
11
|
+
/readme.html
|
|
12
|
+
/wp-*.php
|
|
13
|
+
!/wp-config.php
|
|
14
|
+
|
|
15
|
+
/wordpress/
|
|
16
|
+
|
|
17
|
+
# WordPress Content
|
|
18
|
+
/wp-content/uploads/
|
|
19
|
+
/wp-content/upgrade/
|
|
20
|
+
/wp-content/backup-db/
|
|
21
|
+
/wp-content/advanced-cache.php
|
|
22
|
+
/wp-content/wp-cache-config.php
|
|
23
|
+
/wp-content/cache/
|
|
24
|
+
/wp-content/blogs.dir/
|
|
25
|
+
/wp-content/backups/
|
|
26
|
+
|
|
27
|
+
.env
|
|
28
|
+
auth.json
|
|
29
|
+
|
|
30
|
+
.DS_Store
|
|
31
|
+
Thumbs.db
|
|
32
|
+
*.log
|
|
33
|
+
.idea/
|
|
34
|
+
.vscode/
|
|
35
|
+
|
|
36
|
+
node_modules/
|