Skip to content

Commit

Permalink
Set up 'create.js' for each template
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Jul 25, 2024
1 parent 1ff51ca commit 6e28e02
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/create-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@carto/create-angular",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"ng": "ng",
"dev": "ng serve --port 4000",
Expand Down
22 changes: 21 additions & 1 deletion packages/create-angular/scripts/create.js
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
console.log('angular::create')
#!/usr/bin/env node
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createProject } from '@carto/create-common';
import meow from 'meow';

const cli = meow(
`
Usage
$ yarn create @carto/angular <target-directory>
`,
{
importMeta: import.meta,
autoHelp: true,
autoVersion: true,
},
);

const templateDir = resolve(fileURLToPath(import.meta.url), '../..');
const targetDir = cli.input.at(0) || '.';
await createProject(templateDir, targetDir);
22 changes: 21 additions & 1 deletion packages/create-vue/scripts/create.js
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
console.log('vue::create')
#!/usr/bin/env node
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createProject } from '@carto/create-common';
import meow from 'meow';

const cli = meow(
`
Usage
$ yarn create @carto/vue <target-directory>
`,
{
importMeta: import.meta,
autoHelp: true,
autoVersion: true,
},
);

const templateDir = resolve(fileURLToPath(import.meta.url), '../..');
const targetDir = cli.input.at(0) || '.';
await createProject(templateDir, targetDir);

0 comments on commit 6e28e02

Please sign in to comment.