motia 0.0.18 → 0.0.19
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/dist/src/cli.js +1 -1
- package/dist/src/create/index.js +17 -0
- package/package.json +3 -3
package/dist/src/cli.js
CHANGED
|
@@ -32,7 +32,7 @@ commander_1.program
|
|
|
32
32
|
.description('Prints the list of available templates')
|
|
33
33
|
.action(async () => {
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
35
|
-
const { templates } = require('./
|
|
35
|
+
const { templates } = require('./create/templates');
|
|
36
36
|
console.log(`📝 Available templates: \n\n ${Object.keys(templates).join('\n')}`);
|
|
37
37
|
});
|
|
38
38
|
commander_1.program
|
package/dist/src/create/index.js
CHANGED
|
@@ -134,6 +134,23 @@ const create = async ({ projectName, template }) => {
|
|
|
134
134
|
fs_1.default.writeFileSync(path_1.default.join(rootDir, 'package.json'), JSON.stringify(packageJsonContent, null, 2));
|
|
135
135
|
console.log('✅ package.json created');
|
|
136
136
|
}
|
|
137
|
+
else {
|
|
138
|
+
const packageJsonPath = path_1.default.join(rootDir, 'package.json');
|
|
139
|
+
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf-8'));
|
|
140
|
+
if (!packageJson.scripts) {
|
|
141
|
+
packageJson.scripts = {};
|
|
142
|
+
}
|
|
143
|
+
if (!packageJson.scripts.dev) {
|
|
144
|
+
packageJson.scripts.dev = 'motia dev';
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
packageJson.scripts.olddev = packageJson.scripts.dev;
|
|
148
|
+
packageJson.scripts.dev = 'motia dev';
|
|
149
|
+
console.log('📁 dev command already exists in package.json');
|
|
150
|
+
}
|
|
151
|
+
fs_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
152
|
+
console.log('✅ Updated dev command to package.json');
|
|
153
|
+
}
|
|
137
154
|
if (!checkIfFileExists(rootDir, 'tsconfig.json')) {
|
|
138
155
|
const tsconfigContent = {
|
|
139
156
|
compilerOptions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motia",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"motia": "dist/src/cli.js"
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"figlet": "^1.8.0",
|
|
12
12
|
"ts-node": "^10.9.2",
|
|
13
13
|
"yaml": "^2.7.0",
|
|
14
|
-
"@motiadev/core": "0.0.
|
|
15
|
-
"@motiadev/workbench": "0.0.
|
|
14
|
+
"@motiadev/core": "0.0.19",
|
|
15
|
+
"@motiadev/workbench": "0.0.19"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/figlet": "^1.7.0",
|