cam-fe-code-generator 0.0.1 → 0.0.2

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/cli.js CHANGED
@@ -6,31 +6,31 @@ const fs = require("fs");
6
6
  const path = require("path");
7
7
  const program = new commander_1.Command();
8
8
  program
9
- .name('cam')
10
- .description('CAM frontend code generator CLI')
11
- .version('0.0.1');
9
+ .name("cam")
10
+ .description("CAM frontend code generator CLI")
11
+ .version("0.0.2");
12
12
  program
13
- .command('init')
14
- .description('Initialize a new configuration file')
13
+ .command("init")
14
+ .description("Initialize a new configuration file")
15
15
  .action(() => {
16
16
  const configContent = {
17
17
  services: {},
18
18
  params: {
19
19
  param1: "",
20
- param2: ""
21
- }
20
+ param2: "",
21
+ },
22
22
  };
23
- const targetPath = path.join(process.cwd(), 'cam.config.json');
23
+ const targetPath = path.join(process.cwd(), "cam.config.json");
24
24
  if (fs.existsSync(targetPath)) {
25
- console.warn('cam.config.json already exists in the current directory.');
25
+ console.warn("cam.config.json already exists in the current directory.");
26
26
  return;
27
27
  }
28
28
  try {
29
29
  fs.writeFileSync(targetPath, JSON.stringify(configContent, null, 2));
30
- console.log('Successfully created cam.config.json');
30
+ console.log("Successfully created cam.config.json");
31
31
  }
32
32
  catch (error) {
33
- console.error('Failed to create cam.config.json:', error);
33
+ console.error("Failed to create cam.config.json:", error);
34
34
  process.exit(1);
35
35
  }
36
36
  });
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,yBAAyB;AACzB,6BAA6B;AAE7B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,iCAAiC,CAAC;KAC9C,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC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AG,EAAE;IACT,MAAM,aAAa,GAAG;QAClB,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE;YACJ,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;SACb;KACJ,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAE/D,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,CACR,0DAA0D,CAC7D,CAAC;QACF,OAAO;IACX,CAAC;IAED,IAAI,CAAC;QACD,EAAE,CAAC,aAAa,CACZ,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CACzC,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "cam-fe-code-generator",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
7
7
  "cam": "dist/cli.js"
8
8
  },
9
+ "files": [
10
+ "dist"
11
+ ],
9
12
  "scripts": {
10
13
  "test": "echo \"Error: no test specified\" && exit 1",
11
- "build": "tsc"
14
+ "build": "tsc",
15
+ "prepublishOnly": "npm run build"
12
16
  },
13
17
  "keywords": [
14
18
  "codegen",
@@ -29,4 +33,4 @@
29
33
  "publishConfig": {
30
34
  "access": "public"
31
35
  }
32
- }
36
+ }
package/src/cli.ts DELETED
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import * as fs from 'fs';
5
- import * as path from 'path';
6
-
7
- const program = new Command();
8
-
9
- program
10
- .name('cam')
11
- .description('CAM frontend code generator CLI')
12
- .version('0.0.1');
13
-
14
- program
15
- .command('init')
16
- .description('Initialize a new configuration file')
17
- .action(() => {
18
- const configContent = {
19
- services: {},
20
- params: {
21
- param1: "",
22
- param2: ""
23
- }
24
- };
25
-
26
- const targetPath = path.join(process.cwd(), 'cam.config.json');
27
-
28
- if (fs.existsSync(targetPath)) {
29
- console.warn('cam.config.json already exists in the current directory.');
30
- return;
31
- }
32
-
33
- try {
34
- fs.writeFileSync(targetPath, JSON.stringify(configContent, null, 2));
35
- console.log('Successfully created cam.config.json');
36
- } catch (error) {
37
- console.error('Failed to create cam.config.json:', error);
38
- process.exit(1);
39
- }
40
- });
41
-
42
- program.parse(process.argv);
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- // src/index.ts
2
- export function hello() {
3
- console.log('hello cam codegen')
4
- }
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "./src",
4
- "outDir": "./dist",
5
- "module": "CommonJS",
6
- "target": "ES2019",
7
- "sourceMap": true,
8
- "declaration": true,
9
- "declarationMap": true,
10
- "noUncheckedIndexedAccess": true,
11
- "exactOptionalPropertyTypes": true,
12
- "strict": true,
13
- "jsx": "react-jsx",
14
- "verbatimModuleSyntax": false,
15
- "isolatedModules": true,
16
- "noUncheckedSideEffectImports": true,
17
- "moduleDetection": "force",
18
- "skipLibCheck": true,
19
- }
20
- }