Skip to content

Commit

Permalink
Update create_field script and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Aug 10, 2024
1 parent c8c592a commit cce6b57
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 7 deletions.
18 changes: 13 additions & 5 deletions bin/create_field.cjs → bin/create_field.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const path = require('node:path');
const fs = require('node:fs/promises');
const { spawn } = require('node:child_process');
const prompts = require('prompts');
const chalk = require('chalk');
import chalk from "chalk";

import prompts from "prompts";
import {spawn} from "node:child_process";
import fs from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const projectDir = path.resolve(__dirname + '/../');
const templatesPath = path.resolve(__dirname + '/templates');
Expand Down Expand Up @@ -53,6 +58,9 @@ const fieldName = {
`> Create:\t\t\t\t${chalk.green(
getViewComponentFile().replace(projectDir + path.sep, '')
)}\n` +
`> Create:\t\t\t\t${chalk.green(
getFormComponentFile().replace(projectDir + path.sep, '')
)}\n` +
`> Add a new type to:\t\t\t${chalk.green(typesFile.replace(projectDir + path.sep, ''))}\n` +
`> Add a new Field export to:\t\t${chalk.green(
libIndexFile.replace(projectDir + path.sep, '')
Expand Down
4 changes: 2 additions & 2 deletions bin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"main": "create_field.cjs",
"license": "proprietary",
"scripts": {
"create": "node create_field.cjs"
"create": "node create_field.mjs"
},
"devDependencies": {
"chalk": "^4.1.2",
"chalk": "^5.3.0",
"prompts": "^2.4.2"
}
}
46 changes: 46 additions & 0 deletions bin/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cce6b57

Please sign in to comment.