vovk 0.2.3-beta.22 → 0.2.3-beta.23
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/cli/postinstall.js +20 -0
- package/package.json +2 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const fs = require('fs/promises');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const fileExists = async (path) => !!(await fs.stat(path).catch(() => false));
|
|
5
|
+
|
|
6
|
+
async function postinstall() {
|
|
7
|
+
const vovk = path.join(__dirname, '../../.vovk');
|
|
8
|
+
const js = path.join(vovk, 'index.js');
|
|
9
|
+
const ts = path.join(vovk, 'index.ts');
|
|
10
|
+
|
|
11
|
+
if ((await fileExists(js)) || (await fileExists(ts))) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
await fs.mkdir(vovk, { recursive: true });
|
|
16
|
+
await fs.writeFile(js, '/* postinstall */');
|
|
17
|
+
await fs.writeFile(ts, '/* postinstall */');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
void postinstall();
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vovk",
|
|
3
|
-
"version": "0.2.3-beta.
|
|
3
|
+
"version": "0.2.3-beta.23",
|
|
4
4
|
"description": "Structural add-on for Next.js",
|
|
5
5
|
"bin": "./cli/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"postinstall": "node ./cli/postinstall.js",
|
|
7
8
|
"upgrade": "npx npm-check-updates -u && npm i",
|
|
8
9
|
"test": "npm run lint-nofix && tsc --noemit && npm run unit",
|
|
9
10
|
"unit": "PORT=3210 concurrently \"sleep 20 && npm run test:unit\" \"npm run serve:unit\" --kill-others --success first",
|