Skip to content

Commit

Permalink
Merge field-kit-utils into field-scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Aug 29, 2023
1 parent cffcb9d commit 45ad0b7
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 69 deletions.
45 changes: 17 additions & 28 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"workspaces": [
"packages/create-field-module",
"packages/field-kit",
"packages/field-kit-utils",
"packages/field-scripts",
"packages/field-module-tasks",
"packages/farm-ui"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-field-module/bin/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"farmOS"
],
"devDependencies": {
"@farmos.org/field-scripts": "2.0.0-alpha.1"
"@farmos.org/field-scripts": "2.0.0-alpha.2"
}
}
24 changes: 0 additions & 24 deletions packages/field-kit-utils/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/field-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
},
"dependencies": {
"@farmos.org/farmos-map": "^1.4.2",
"@farmos.org/field-scripts": "2.0.0-alpha.2",
"@turf/turf": "^5.1.6",
"farmos": "^2.0.0-beta.14",
"farm-ui": "2.0.0-alpha.2",
"field-kit-utils": "2.0.0-alpha.1",
"ramda": "^0.27.1",
"uuid": "^8.3.2",
"vue": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/field-kit/src/field-modules/import.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolveModulePathname } from 'field-kit-utils/constants';
import { resolveModulePathname } from '@farmos.org/field-scripts';
import { getHost } from '../farm/remote';

// Takes module info from the API and uses it to inject a script tag and run
Expand Down
3 changes: 1 addition & 2 deletions packages/field-kit/src/field-modules/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { reactive, readonly } from 'vue';
import { compose, map, path } from 'ramda';
import { kebab } from 'field-kit-utils/string-case';
import { FM_API_ENDPOINT } from 'field-kit-utils/constants';
import { FM_API_ENDPOINT, kebab } from '@farmos.org/field-scripts';
import farm from '../farm';
import { alert } from '../warnings/alert';
import importFieldModule from './import';
Expand Down
2 changes: 1 addition & 1 deletion packages/field-kit/src/field-modules/mount.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
assoc, compose, curry, evolve, map, mapObjIndexed, pick, prop,
} from 'ramda';
import { kebab } from 'field-kit-utils/string-case';
import { kebab } from '@farmos.org/field-scripts';
import { upsertModuleConfig } from './index';

const parseWidgetName = curry((modName, widget) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/field-module-tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Jamie Gaehring <gaehj457@gmail.com> (https://jgaehring.com)",
"license": "GPL-3.0-or-later",
"devDependencies": {
"@farmos.org/field-scripts": "2.0.0-alpha.1"
"@farmos.org/field-scripts": "2.0.0-alpha.2"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/field-scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `field-scripts`
Shared scripts and tooling for the development environment and build tools used both farmOS Field Kit and its associated Field Modules. Powered by [Vite](https://vitejs.dev).
Shared scripts, tooling and utilities for the development environment and build process used by both farmOS Field Kit and its associated Field Modules. Powered by [Vite](https://vitejs.dev).

These are included in the dependencies when [`create-field-module`](https://www.npmjs.com/package/@jgaehring/create-field-module) is used to scaffold projects.
2 changes: 1 addition & 1 deletion packages/field-scripts/build-module/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { build } from 'vite';
import createVuePlugin from '@vitejs/plugin-vue';
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';
import jsYaml from 'js-yaml';
import { snake } from 'field-kit-utils/string-case.js';
import { snake } from '../lib/string-case.js';
import fieldModulePlugin from './rollup-plugin-field-module.js';

const writeYaml = (filepath, data) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/field-scripts/develop-module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { createRequire } from 'module';
import { createServer } from 'vite';
import createVuePlugin from '@vitejs/plugin-vue';
import { viteCommonjs } from '@originjs/vite-plugin-commonjs';
import { FM_API_ENDPOINT, FM_SCRIPT_DIR } from 'field-kit-utils/constants.js';
import { snake } from 'field-kit-utils/string-case.js';
import { FM_API_ENDPOINT, FM_SCRIPT_DIR } from '../lib/constants.js';
import { snake } from '../lib/string-case.js';
import createMockServer from './mock-server.js';

const require = createRequire(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion packages/field-scripts/develop-module/mock-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import http from 'http';
import { FM_API_ENDPOINT, resolveModulePathname } from 'field-kit-utils/constants.js';
import { FM_API_ENDPOINT, resolveModulePathname } from '../lib/constants.js';
import { fmtScript, fmtJsonApi } from '../shared/format.js';

const trimPath = p => (typeof p === 'string' ? p : '').replaceAll(/^\/|\/$/g, '');
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/field-scripts/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './constants.js';
export * from './string-case.js';
File renamed without changes.
5 changes: 2 additions & 3 deletions packages/field-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@farmos.org/field-scripts",
"version": "2.0.0-alpha.1",
"version": "2.0.0-alpha.2",
"description": "Node scripts for farmOS Field Kit and Field Modules.",
"bin": "bin/field-scripts.js",
"main": "bin/field-scripts.js",
"main": "lib/index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -16,7 +16,6 @@
"dependencies": {
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@vitejs/plugin-vue": "^4.2.3",
"field-kit-utils": "2.0.0-alpha.1",
"js-yaml": "^4.1.0",
"minimist": "^1.2.8",
"ramda": "^0.28.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/field-scripts/shared/format.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import { evolve } from 'ramda';
import { snake } from 'field-kit-utils/string-case.js';
import { snake } from '../lib/string-case.js';

const fmtImport = (name, value) =>
(value ? `import ${name} from '${value}';` : '');
Expand Down

0 comments on commit 45ad0b7

Please sign in to comment.