@joystick.js/cli-canary 0.0.0-canary.649 → 0.0.0-canary.650
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
cd ${e?.name} && joystick${a?.release==="canary"?"-canary":""} start`)},1e3)};var
|
|
1
|
+
import s from"fs";import o from"chalk";import c from"child_process";import n from"util";import t from"replace-in-files";import m from"./build_package_json.js";import l from"../../lib/cli_log.js";import u from"../../lib/loader.js";import p from"../../lib/node_path_polyfills.js";import i from"../../lib/get_platform_safe_path.js";const{cp:d,writeFile:y,mkdir:r}=s.promises,f=n.promisify(c.exec),$=(e="")=>y(`./${e}/package.json`,m(e)),j=async(e={},a={})=>{process.loader=new u,process.loader.print("Creating app..."),a?.release&&!["production","canary"].includes(a.release)&&(l("Must pass either production or canary for --release.",{level:"danger",docs:"https://docs.cheatcode.co/joystick/cli/create"}),process.exit(0)),await d(`${p?.__package}/commands/create/template`,`./${e.name}`,{recursive:!0}),await $(e.name),await r(`./${e?.name}/.joystick`,{recursive:!0}),await r(`./${e?.name}/fixtures`,{recursive:!0}),await r(`./${e?.name}/indexes`,{recursive:!0}),await r(`./${e?.name}/lib`,{recursive:!0}),await r(`./${e?.name}/private`,{recursive:!0}),await r(`./${e?.name}/queues`,{recursive:!0}),await r(`./${e?.name}/routes`,{recursive:!0}),await r(`./${e?.name}/uploaders`,{recursive:!0}),await r(`./${e?.name}/tests`,{recursive:!0}),await r(`./${e?.name}/websockets`,{recursive:!0}),a?.release==="canary"&&(await t({files:[i(`${process.cwd()}/${e?.name}/**/*.js`)],from:/(@joystick.js\/node)(?!-)/g,to:"@joystick.js/node-canary",optionsForFiles:{ignore:["**/node_modules/**"]}}),await t({files:[i(`${process.cwd()}/${e?.name}/**/*.js`)],from:/(@joystick.js\/ui)(?!-)/g,to:"@joystick.js/ui-canary",optionsForFiles:{ignore:["**/node_modules/**"]}})),setTimeout(async()=>{process.loader.print("Installing dependencies..."),await f(`cd ./${e?.name} && npm install --save @joystick.js/ui${a?.release==="canary"?"-canary":""}@latest @joystick.js/node${a?.release==="canary"?"-canary":""}@latest @joystick.js/test${a?.release==="canary"?"-canary":""}@latest`),console.log(`${o.green("Project created! To get started, run:")}
|
|
2
|
+
cd ${e?.name} && joystick${a?.release==="canary"?"-canary":""} start`)},1e3)};var q=j;export{q as default};
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import build_package_json from "./build_package_json.js";
|
|
|
7
7
|
import cli_log from '../../lib/cli_log.js';
|
|
8
8
|
import Loader from "../../lib/loader.js";
|
|
9
9
|
import node_path_polyfills from '../../lib/node_path_polyfills.js';
|
|
10
|
+
import get_platform_safe_path from '../../lib/get_platform_safe_path.js';
|
|
10
11
|
|
|
11
12
|
const { cp: copy_directory, writeFile, mkdir } = fs.promises;
|
|
12
13
|
const exec = util.promisify(child_process.exec);
|
|
@@ -43,7 +44,7 @@ const create = async (args = {}, options = {}) => {
|
|
|
43
44
|
|
|
44
45
|
if (options?.release === 'canary') {
|
|
45
46
|
await replace_in_files({
|
|
46
|
-
files: [`${process.cwd()}/${args?.name}/**/*.js`],
|
|
47
|
+
files: [get_platform_safe_path(`${process.cwd()}/${args?.name}/**/*.js`)],
|
|
47
48
|
from: /(@joystick.js\/node)(?!-)/g,
|
|
48
49
|
to: '@joystick.js/node-canary',
|
|
49
50
|
optionsForFiles: {
|
|
@@ -54,7 +55,7 @@ const create = async (args = {}, options = {}) => {
|
|
|
54
55
|
});
|
|
55
56
|
|
|
56
57
|
await replace_in_files({
|
|
57
|
-
files: [`${process.cwd()}/${args?.name}/**/*.js`],
|
|
58
|
+
files: [get_platform_safe_path(`${process.cwd()}/${args?.name}/**/*.js`)],
|
|
58
59
|
from: /(@joystick.js\/ui)(?!-)/g,
|
|
59
60
|
to: '@joystick.js/ui-canary',
|
|
60
61
|
optionsForFiles: {
|