@akinon/projectzero 1.16.2 → 1.17.0
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 +4 -0
- package/commands/create.ts +7 -7
- package/dist/commands/create.js +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/commands/create.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface Answers {
|
|
|
20
20
|
[key: string]: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const repositorySlug = '
|
|
23
|
+
const repositorySlug = 'pz-next';
|
|
24
24
|
const tempDirPath = temp.mkdirSync('pz-temp');
|
|
25
25
|
const workingDir = path.resolve(process.cwd());
|
|
26
26
|
const rl = readline.createInterface({
|
|
@@ -101,7 +101,7 @@ const cloneRepository = () =>
|
|
|
101
101
|
const updatePackageJson = (brandName: string) => {
|
|
102
102
|
const packageJsonPath = path.resolve(
|
|
103
103
|
tempDirPath,
|
|
104
|
-
`./${repositorySlug}/package.json`
|
|
104
|
+
`./${repositorySlug}/apps/projectzeronext/package.json`
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
const packageJsonData = fs.readFileSync(packageJsonPath, {
|
|
@@ -118,7 +118,7 @@ const updatePackageJson = (brandName: string) => {
|
|
|
118
118
|
const updateAkinonJson = (brandName: string, projectDescription: string) => {
|
|
119
119
|
const akinonJsonPath = path.resolve(
|
|
120
120
|
tempDirPath,
|
|
121
|
-
`./${repositorySlug}/akinon.json`
|
|
121
|
+
`./${repositorySlug}/apps/projectzeronext/akinon.json`
|
|
122
122
|
);
|
|
123
123
|
|
|
124
124
|
const akinonJsonData = fs.readFileSync(akinonJsonPath, {
|
|
@@ -142,7 +142,7 @@ const updateAkinonJson = (brandName: string, projectDescription: string) => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
const copyEnv = (commerceUrl: string) => {
|
|
145
|
-
const repositoryPath = path.resolve(tempDirPath, `./${repositorySlug}
|
|
145
|
+
const repositoryPath = path.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/`);
|
|
146
146
|
|
|
147
147
|
const envExamplePath = path.resolve(repositoryPath, `./.env.example`);
|
|
148
148
|
const envPath = path.resolve(repositoryPath, `./.env`);
|
|
@@ -168,7 +168,7 @@ const copyEnv = (commerceUrl: string) => {
|
|
|
168
168
|
const updatePlugins = () => {
|
|
169
169
|
const pluginsPath = path.resolve(
|
|
170
170
|
tempDirPath,
|
|
171
|
-
`./${repositorySlug}/src/plugins.js`
|
|
171
|
+
`./${repositorySlug}/apps/projectzeronext/src/plugins.js`
|
|
172
172
|
);
|
|
173
173
|
|
|
174
174
|
fs.writeFileSync(pluginsPath, 'module.exports = [];');
|
|
@@ -208,13 +208,13 @@ export default async () => {
|
|
|
208
208
|
|
|
209
209
|
const slugifiedBrandName = slugify(answers.brandName);
|
|
210
210
|
|
|
211
|
-
fs.rmSync(path.resolve(tempDirPath, `./${repositorySlug}/.git`), {
|
|
211
|
+
fs.rmSync(path.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/.git`), {
|
|
212
212
|
recursive: true,
|
|
213
213
|
force: true
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
fs.cpSync(
|
|
217
|
-
path.resolve(tempDirPath, `./${repositorySlug}
|
|
217
|
+
path.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/`),
|
|
218
218
|
path.resolve(workingDir, `./${slugifiedBrandName}`),
|
|
219
219
|
{
|
|
220
220
|
recursive: true,
|
package/dist/commands/create.js
CHANGED
|
@@ -43,7 +43,7 @@ const temp_1 = __importDefault(require("temp"));
|
|
|
43
43
|
const exec = require('child_process').exec;
|
|
44
44
|
const loadingSpinner = require('loading-spinner');
|
|
45
45
|
temp_1.default.track();
|
|
46
|
-
const repositorySlug = '
|
|
46
|
+
const repositorySlug = 'pz-next';
|
|
47
47
|
const tempDirPath = temp_1.default.mkdirSync('pz-temp');
|
|
48
48
|
const workingDir = path_1.default.resolve(process.cwd());
|
|
49
49
|
const rl = readline.createInterface({
|
|
@@ -111,7 +111,7 @@ const cloneRepository = () => new Promise((resolve) => {
|
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
const updatePackageJson = (brandName) => {
|
|
114
|
-
const packageJsonPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/package.json`);
|
|
114
|
+
const packageJsonPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/package.json`);
|
|
115
115
|
const packageJsonData = fs.readFileSync(packageJsonPath, {
|
|
116
116
|
encoding: 'utf8',
|
|
117
117
|
flag: 'r'
|
|
@@ -119,7 +119,7 @@ const updatePackageJson = (brandName) => {
|
|
|
119
119
|
fs.writeFileSync(packageJsonPath, packageJsonData.replace(/"name": ".*"/, `"name": "${(0, utils_1.slugify)(brandName)}"`));
|
|
120
120
|
};
|
|
121
121
|
const updateAkinonJson = (brandName, projectDescription) => {
|
|
122
|
-
const akinonJsonPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/akinon.json`);
|
|
122
|
+
const akinonJsonPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/akinon.json`);
|
|
123
123
|
const akinonJsonData = fs.readFileSync(akinonJsonPath, {
|
|
124
124
|
encoding: 'utf8',
|
|
125
125
|
flag: 'r'
|
|
@@ -131,7 +131,7 @@ const updateAkinonJson = (brandName, projectDescription) => {
|
|
|
131
131
|
fs.writeFileSync(akinonJsonPath, updatedData);
|
|
132
132
|
};
|
|
133
133
|
const copyEnv = (commerceUrl) => {
|
|
134
|
-
const repositoryPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}
|
|
134
|
+
const repositoryPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/`);
|
|
135
135
|
const envExamplePath = path_1.default.resolve(repositoryPath, `./.env.example`);
|
|
136
136
|
const envPath = path_1.default.resolve(repositoryPath, `./.env`);
|
|
137
137
|
const envData = fs.readFileSync(envExamplePath, {
|
|
@@ -144,7 +144,7 @@ const copyEnv = (commerceUrl) => {
|
|
|
144
144
|
fs.copyFileSync(envExamplePath, envPath);
|
|
145
145
|
};
|
|
146
146
|
const updatePlugins = () => {
|
|
147
|
-
const pluginsPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/src/plugins.js`);
|
|
147
|
+
const pluginsPath = path_1.default.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/src/plugins.js`);
|
|
148
148
|
fs.writeFileSync(pluginsPath, 'module.exports = [];');
|
|
149
149
|
};
|
|
150
150
|
exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -165,11 +165,11 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
165
165
|
copyEnv(answers.commerceUrl);
|
|
166
166
|
updatePlugins();
|
|
167
167
|
const slugifiedBrandName = (0, utils_1.slugify)(answers.brandName);
|
|
168
|
-
fs.rmSync(path_1.default.resolve(tempDirPath, `./${repositorySlug}/.git`), {
|
|
168
|
+
fs.rmSync(path_1.default.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/.git`), {
|
|
169
169
|
recursive: true,
|
|
170
170
|
force: true
|
|
171
171
|
});
|
|
172
|
-
fs.cpSync(path_1.default.resolve(tempDirPath, `./${repositorySlug}
|
|
172
|
+
fs.cpSync(path_1.default.resolve(tempDirPath, `./${repositorySlug}/apps/projectzeronext/`), path_1.default.resolve(workingDir, `./${slugifiedBrandName}`), {
|
|
173
173
|
recursive: true,
|
|
174
174
|
force: true
|
|
175
175
|
});
|