makepack 1.0.2 → 1.0.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/package.json +1 -1
- package/src/actions/create/files/package-json.js +4 -4
- package/src/actions/create/files/project-react-js.js +4 -1
- package/src/actions/create/files/project-react-ts.js +4 -1
- package/src/actions/create/files/tsconfig.js +1 -0
- package/src/actions/pack.js +1 -1
- package/src/actions/serve.js +0 -1
- package/src/helpers.js +2 -27
package/package.json
CHANGED
|
@@ -6,15 +6,15 @@ export default (args) => {
|
|
|
6
6
|
|
|
7
7
|
if (args.template.includes("react")) {
|
|
8
8
|
dependencies = {
|
|
9
|
-
"react": "^
|
|
10
|
-
"react-dom": "^
|
|
9
|
+
"react": "^19.0.0",
|
|
10
|
+
"react-dom": "^19.0.0"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
if (args.template.includes("typescript")) {
|
|
15
15
|
devDependencies["typescript"] = "^4.4.2"
|
|
16
|
-
devDependencies["@types/react"] = "^
|
|
17
|
-
devDependencies["@types/react-dom"] = "^
|
|
16
|
+
devDependencies["@types/react"] = "^19.0.2"
|
|
17
|
+
devDependencies["@types/react-dom"] = "^19.0.2"
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const json = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default (args) => {
|
|
2
2
|
const content = `import React from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
|
|
3
5
|
const App = () => {
|
|
4
6
|
return (
|
|
5
7
|
<div style={{ textAlign: 'center', marginTop: '50px' }}>
|
|
@@ -16,7 +18,8 @@ const App = () => {
|
|
|
16
18
|
</div>
|
|
17
19
|
);
|
|
18
20
|
};
|
|
19
|
-
|
|
21
|
+
const root = createRoot(document.getElementById('root'));
|
|
22
|
+
root.render(<App />);
|
|
20
23
|
`
|
|
21
24
|
return {
|
|
22
25
|
content,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default args => {
|
|
2
2
|
const content = `import React from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
|
|
3
5
|
const App: React.FC = () => {
|
|
4
6
|
return (
|
|
5
7
|
<div style={{ textAlign: 'center', marginTop: '50px' }}>
|
|
@@ -16,7 +18,8 @@ const App: React.FC = () => {
|
|
|
16
18
|
</div>
|
|
17
19
|
);
|
|
18
20
|
}
|
|
19
|
-
|
|
21
|
+
const root = createRoot(document.getElementById('root'));
|
|
22
|
+
root.render(<App />);
|
|
20
23
|
`
|
|
21
24
|
return {
|
|
22
25
|
content,
|
package/src/actions/pack.js
CHANGED
|
@@ -3,7 +3,7 @@ import fs from 'fs-extra';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { glob } from 'glob'
|
|
5
5
|
import ts from 'typescript'
|
|
6
|
-
import { execSync, logLoader } from '../helpers';
|
|
6
|
+
import { execSync, logLoader } from '../helpers.js';
|
|
7
7
|
|
|
8
8
|
const pack = async (args) => {
|
|
9
9
|
args.outdir = 'pack'
|
package/src/actions/serve.js
CHANGED
package/src/helpers.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import child_process from 'child_process'
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import fs from 'fs';
|
|
4
3
|
import { fileURLToPath } from 'url'
|
|
5
|
-
export const packageDir = process.cwd() + "/node_modules/xanos"
|
|
6
|
-
export const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
4
|
|
|
5
|
+
export const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
6
|
|
|
9
7
|
export const logLoader = (message = "") => {
|
|
10
8
|
const spinner = ['|', '/', '-', '\\'];
|
|
@@ -23,18 +21,6 @@ export const logLoader = (message = "") => {
|
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
export const exec = (command) => {
|
|
27
|
-
child_process.exec(command, (error, stdout, stderr) => {
|
|
28
|
-
if (error) {
|
|
29
|
-
console.error("Error:", error);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
console.log(stdout.toString());
|
|
33
|
-
console.error("stderr:", stderr);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
24
|
export const execSync = (command, option = {}) => {
|
|
39
25
|
try {
|
|
40
26
|
const result = child_process.execSync(command, {
|
|
@@ -46,15 +32,4 @@ export const execSync = (command, option = {}) => {
|
|
|
46
32
|
} catch (error) {
|
|
47
33
|
console.error(`Command failed: ${error.message}`);
|
|
48
34
|
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export const packageJson = () => {
|
|
53
|
-
try {
|
|
54
|
-
const data = fs.readFileSync('./package.json', 'utf8');
|
|
55
|
-
return JSON.parse(data);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error('Error reading package.json', error);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
35
|
+
};
|