hoosat-create 1.4.3 → 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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/index.js +10 -9
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -96,6 +96,10 @@ I just dropped some dependancies from the repository and this will keep happenin
96
96
  Though for now the only goal seems to be to drop `react-helmet-async`.
97
97
 
98
98
  ## Release changes
99
+
100
+ ### 1.4.3 -> 1.4.4
101
+ - Why the heck I removed that #!/usr/bin/env node.. Now it's back.
102
+
99
103
  ### 1.4.2 -> 1.4.3
100
104
  - Update package.json to contain metadata
101
105
 
package/index.js CHANGED
@@ -1,10 +1,11 @@
1
- const { spawn } = require('child_process');
2
- const readline = require('readline');
3
- const fs = require('fs');
4
- const path = require('path');
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 = readline.createInterface({
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 = path.join(process.cwd(), 'package.json');
41
- const packageJsonContent = fs.readFileSync(packageJsonPath, 'utf8');
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
- fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
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
- module.exports = { askQuestion };
161
+ export default { askQuestion };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "hoosat-create",
3
- "version": "1.4.3",
3
+ "type": "module",
4
+ "version": "1.4.4",
4
5
  "description": "Hoosat - React & Typescript SSR project template.",
5
6
  "homepage": "https://example.com",
6
7
  "author": "Toni Lukkaroinen @ Hoosat Oy",