Skip to content

Commit

Permalink
Move create-field-module to its own package.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Aug 29, 2023
1 parent bf9d817 commit e06e435
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
],
ignorePatterns: [
'packages/field-kit/src/l10n/**',
'packages/field-scripts/create-module/template/**',
'packages/create-field-module/bin/template/**',
],
// add your custom rules here
rules: {
Expand Down
25 changes: 21 additions & 4 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"workspaces": [
"packages/create-field-module",
"packages/field-kit",
"packages/field-kit-utils",
"packages/field-scripts",
Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions packages/create-field-module/bin/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env node

/* eslint-disable no-console */

import create from './index.js';

async function run() {
const args = process.argv.slice(2);
try {
const targetDir = args[0];
await create(targetDir);
} catch (error) {
console.error(error);
process.exit(1);
}
}

run();
24 changes: 24 additions & 0 deletions packages/create-field-module/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "create-field-module",
"version": "2.0.0-alpha.1",
"description": "Scaffold a Field Module for development with farmOS Field Kit.",
"bin": "bin/run.js",
"main": "bin/run.js",
"type": "module",
"keywords": [
"farmOS"
],
"author": "Jamie Gaehring <gaehj457@gmail.com> (https://jgaehring.com)",
"license": "GPL-3.0-or-later",
"dependencies": {
"prompts": "^2.4.2"
},
"repository": {
"type": "git",
"url": "git+https://github.com/farmOS/field-kit.git"
},
"bugs": {
"url": "https://github.com/farmOS/field-kit/issues"
},
"homepage": "https://farmos.org"
}
10 changes: 0 additions & 10 deletions packages/field-scripts/bin/field-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ async function run() {
process.exit(1);
}
}
if (script === 'create-module') {
const { default: create } = await import('../create-module/index.js');
try {
const targetDir = rest[0];
await create(targetDir);
} catch (error) {
console.error(error);
process.exit(1);
}
}
}

run();
2 changes: 0 additions & 2 deletions packages/field-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
"dependencies": {
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@vitejs/plugin-vue": "^4.2.3",
"field-kit": "2.0.0-alpha.8",
"field-kit-utils": "2.0.0-alpha.1",
"js-yaml": "^4.1.0",
"prompts": "^2.4.2",
"ramda": "^0.28.0",
"vite": "^4.3.9"
},
Expand Down

0 comments on commit e06e435

Please sign in to comment.