memma 0.1.0 → 0.1.1
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
CHANGED
|
@@ -13,7 +13,7 @@ Memma produces close structural and stylistic approximations of existing UIs,
|
|
|
13
13
|
enabling developers to jumpstart applications and iterate from a meaningful
|
|
14
14
|
starting codebase instead of a blank project.
|
|
15
15
|
|
|
16
|
-
](https://www.npmjs.com/package/memma)
|
|
17
17
|
[](https://github.com/6207ALS/memma/blob/commands/LICENSE)
|
|
18
18
|
|
|
19
19
|
## Features
|
|
@@ -113,4 +113,4 @@ $ memma reset
|
|
|
113
113
|
|
|
114
114
|
## License
|
|
115
115
|
|
|
116
|
-
Memma is released under the [MIT License]().
|
|
116
|
+
Memma is released under the [MIT License](https://github.com/6207ALS/memma/blob/main/LICENSE).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,WAAW,SAGA,CAAC"}
|
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
// src/commands/init.ts
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { log } from '../../utils/logger.js';
|
|
4
|
+
import { resolveDirectory } from '../../utils/resolveDirectory.js';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import ora from 'ora';
|
|
8
|
+
export const initCommand = new Command('init')
|
|
9
|
+
.description('Initialize a new Memma project')
|
|
10
|
+
.argument('[dir]', 'Target directory', '.')
|
|
11
|
+
.action(actionHandler);
|
|
12
|
+
async function actionHandler(dir) {
|
|
13
|
+
log('Initialization command executed.');
|
|
14
|
+
log(resolveDirectory(dir));
|
|
15
|
+
}
|
|
16
|
+
async function actionHandler2(targetDir = '.') {
|
|
17
|
+
const spinner = ora('Initializing Menna project...').start();
|
|
18
|
+
// Resolve user provided target directory to absolute path
|
|
19
|
+
targetDir = resolveDirectory(targetDir);
|
|
20
|
+
// 1. Create folder if doesn't exist
|
|
21
|
+
await fs.ensureDir(targetDir);
|
|
22
|
+
// 2. Create configuration file
|
|
23
|
+
const config = {
|
|
24
|
+
projectName: path.basename(targetDir) || 'my-memma-project',
|
|
25
|
+
outputDir: './components',
|
|
26
|
+
splitComponents: true,
|
|
27
|
+
};
|
|
28
|
+
// Create configuration file in target directory
|
|
29
|
+
await fs.writeJson(path.join(targetDir, 'menna.config.json'), config, {
|
|
30
|
+
spaces: 2,
|
|
31
|
+
});
|
|
32
|
+
// 3. Create components folder in target directory
|
|
33
|
+
await fs.ensureDir(path.join(targetDir, 'components'));
|
|
34
|
+
spinner.succeed('Menna project initialized!');
|
|
35
|
+
console.log('Next: run `npx menna generate <URL>` to start generating components.');
|
|
36
|
+
}
|
|
2
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,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1",
|
|
4
4
|
"description": "Visual-to-Code CLI Tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"gradient-string": "^3.0.0",
|
|
36
36
|
"openai": "^6.2.0",
|
|
37
37
|
"ora": "^9.0.0",
|
|
38
|
+
"prettier": "^3.8.0",
|
|
38
39
|
"semver": "^7.7.2"
|
|
39
40
|
},
|
|
40
41
|
"repository": {
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
50
51
|
"@typescript-eslint/parser": "^8.44.0",
|
|
51
52
|
"eslint-config-prettier": "^10.1.8",
|
|
52
|
-
"prettier": "^3.6.2",
|
|
53
53
|
"ts-node": "^10.9.2",
|
|
54
54
|
"typescript": "^5.9.2"
|
|
55
55
|
}
|