hoosat-create 1.4.2 → 1.4.4
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/README.md +6 -1
- package/index.js +10 -9
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ listen(server, port, () => {
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
## License
|
|
91
|
-
This template is licensed under the
|
|
91
|
+
This template is licensed under the ISC License. Feel free to use it for your own projects or as a starting point for your own templates.
|
|
92
92
|
|
|
93
93
|
## Message
|
|
94
94
|
|
|
@@ -97,6 +97,11 @@ Though for now the only goal seems to be to drop `react-helmet-async`.
|
|
|
97
97
|
|
|
98
98
|
## Release changes
|
|
99
99
|
|
|
100
|
+
### 1.4.3 -> 1.4.4
|
|
101
|
+
- Why the heck I removed that #!/usr/bin/env node.. Now it's back.
|
|
102
|
+
|
|
103
|
+
### 1.4.2 -> 1.4.3
|
|
104
|
+
- Update package.json to contain metadata
|
|
100
105
|
|
|
101
106
|
### 1.4.1 -> 1.4.2
|
|
102
107
|
- Remove download-git-repo dependancy from hoosat-create
|
package/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import { createInterface } from 'readline';
|
|
4
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
5
|
+
import { join } from 'path';
|
|
5
6
|
|
|
6
7
|
const repository = 'https://github.com/Hoosat-Oy/hoosat-template.git';
|
|
7
|
-
const rl =
|
|
8
|
+
const rl = createInterface({
|
|
8
9
|
input: process.stdin,
|
|
9
10
|
output: process.stdout
|
|
10
11
|
});
|
|
@@ -37,15 +38,15 @@ async function run() {
|
|
|
37
38
|
// Change directory to the project directory
|
|
38
39
|
process.chdir(destination);
|
|
39
40
|
// Modify the package.json
|
|
40
|
-
const packageJsonPath =
|
|
41
|
-
const packageJsonContent =
|
|
41
|
+
const packageJsonPath = join(process.cwd(), 'package.json');
|
|
42
|
+
const packageJsonContent = readFileSync(packageJsonPath, 'utf8');
|
|
42
43
|
const packageJson = JSON.parse(packageJsonContent);
|
|
43
44
|
packageJson.name = destination;
|
|
44
45
|
packageJson.description = description;
|
|
45
46
|
packageJson.author = author;
|
|
46
47
|
packageJson.license = license;
|
|
47
48
|
packageJson.keywords = keywordList;
|
|
48
|
-
|
|
49
|
+
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
49
50
|
console.log('Project package.json has been modified.');
|
|
50
51
|
// Do NPM install for dependencies.
|
|
51
52
|
const install = spawn('npm', ['install'], { stdio: 'inherit' });
|
|
@@ -157,4 +158,4 @@ function containsInvalidCharacters(input) {
|
|
|
157
158
|
run();
|
|
158
159
|
|
|
159
160
|
// Export the askQuestion function for testing purposes
|
|
160
|
-
|
|
161
|
+
export default { askQuestion };
|
package/package.json
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoosat-create",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.4.4",
|
|
4
5
|
"description": "Hoosat - React & Typescript SSR project template.",
|
|
6
|
+
"homepage": "https://example.com",
|
|
7
|
+
"author": "Toni Lukkaroinen @ Hoosat Oy",
|
|
8
|
+
"license": "ISC",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/Hoosat-Oy/hoosat-create/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/Hoosat-Oy/hoosat-create"
|
|
15
|
+
},
|
|
5
16
|
"main": "index.js",
|
|
6
17
|
"bin": {
|
|
7
18
|
"hoosat-create": "index.js"
|
|
8
19
|
},
|
|
9
20
|
"scripts": {
|
|
10
21
|
"test": "node index.js"
|
|
11
|
-
}
|
|
12
|
-
"author": "",
|
|
13
|
-
"license": "ISC"
|
|
22
|
+
}
|
|
14
23
|
}
|