Skip to content

Commit

Permalink
Merge field-scripts into @farmos.org/field-kit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Aug 29, 2023
1 parent d21713a commit 708400d
Show file tree
Hide file tree
Showing 21 changed files with 139 additions and 109 deletions.
171 changes: 114 additions & 57 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "field-kit",
"name": "field-kit-monorepo",
"version": "2.0.0-alpha.8",
"description": "A modular, offline-first companion app to farmOS.",
"author": "farmOS team",
"license": "GPLv3",
"private": true,
"scripts": {
"build": "npm run build --workspace=field-kit",
"build": "npm run build --workspace=@farmos.org/field-kit",
"clean": "npx -y rimraf node_modules **/node_modules/ package-lock.json && npm i",
"dev:field-kit": "npm run start --workspace=field-kit",
"dev:field-kit": "npm run start --workspace=@farmos.org/field-kit",
"dev:field-module-tasks": "npm run start --workspace=field-module-tasks",
"start": "npm run dev:field-kit",
"storybook": "npm run --workspace=@farmos.org/field-components storybook",
Expand All @@ -17,7 +17,6 @@
"workspaces": [
"packages/create-field-module",
"packages/field-kit",
"packages/field-scripts",
"packages/field-module-tasks",
"packages/field-components"
],
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.2"
"@farmos.org/field-kit": "2.0.0-alpha.8"
}
}
File renamed without changes.
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 '../../namespaces/string-case.js';
import { snake } from '../../../namespaces/index.js';
import fieldModulePlugin from './rollup-plugin-field-module.js';

const writeYaml = (filepath, data) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ 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 '../../namespaces/constants.js';
import { snake } from '../../namespaces/string-case.js';
import { FM_API_ENDPOINT, FM_SCRIPT_DIR, snake } from '../../../namespaces/index.js';
import createMockServer from './mock-server.js';

const require = createRequire(import.meta.url);
Expand Down Expand Up @@ -32,7 +31,7 @@ export default async function develop(options = {}) {
const mockServer = createMockServer(config);
mockServer.listen(mockPort, 'localhost');

const fieldKitEntry = require.resolve('field-kit');
const fieldKitEntry = require.resolve('@farmos.org/field-kit');
const root = path.dirname(fieldKitEntry);

const devServer = await createServer({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import http from 'http';
import { FM_API_ENDPOINT, resolveModulePathname } from '../../namespaces/constants.js';
import { FM_API_ENDPOINT, resolveModulePathname } from '../../../namespaces/index.js';
import { fmtScript, fmtJsonApi } from '../format.js';

const trimPath = p => (typeof p === 'string' ? p : '').replaceAll(/^\/|\/$/g, '');
Expand Down
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 '../namespaces/string-case.js';
import { snake } from '../../namespaces/index.js';

const fmtImport = (name, value) =>
(value ? `import ${name} from '${value}';` : '');
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/field-kit/namespaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Namespaces
These utilities are shared by the core application logic in `src` as well as the dev/build tooling in `bin/field-scripts`. Maintaining conformity between them is vital for establishing the contract with the farmOS REST API while enforcing correct syntax for the internal namespacing of field modules.
File renamed without changes.
File renamed without changes.
15 changes: 10 additions & 5 deletions packages/field-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "field-kit",
"name": "@farmos.org/field-kit",
"version": "2.0.0-alpha.8",
"description": "A modular, offline-first companion app to farmOS.",
"author": "Jamie Gaehring <gaehj457@gmail.com> (https://jgaehring.com)",
"license": "GPL-3.0-or-later",
"private": true,
"private": false,
"main": "main.js",
"type": "module",
"bin": {
"field-scripts": "bin/field-scripts/index.js"
},
"scripts": {
"start": "npm run dev",
"BROKEN-test": "mocha --require test-setup.js 'src/**/*.test.js' --watch",
Expand All @@ -18,17 +22,16 @@
"dependencies": {
"@farmos.org/field-components": "2.0.0-alpha.3",
"@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",
"ramda": "^0.27.1",
"ramda": "^0.28.0",
"uuid": "^8.3.2",
"vue": "^3.1.0",
"vue-router": "^4.0.12",
"wellknown": "^0.5.0"
},
"devDependencies": {
"@originjs/vite-plugin-commonjs": "^1.0.1",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/runtime-dom": "^3.2.26",
"eslint": "^7.32.0",
Expand All @@ -37,6 +40,8 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-vue": "^8.2.0",
"js-yaml": "^4.1.0",
"minimist": "^1.2.8",
"vite": "^4.3.9",
"vite-plugin-pwa": "^0.16.4"
},
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 '@farmos.org/field-scripts';
import { resolveModulePathname } from '../../namespaces';
import { getHost } from '../farm/remote';

// Takes module info from the API and uses it to inject a script tag and run
Expand Down
2 changes: 1 addition & 1 deletion packages/field-kit/src/field-modules/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { reactive, readonly } from 'vue';
import { compose, map, path } from 'ramda';
import { FM_API_ENDPOINT, kebab } from '@farmos.org/field-scripts';
import { FM_API_ENDPOINT, kebab } from '../../namespaces';
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 '@farmos.org/field-scripts';
import { kebab } from '../../namespaces';
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.2"
"@farmos.org/field-kit": "2.0.0-alpha.8"
},
"repository": {
"type": "git",
Expand Down
32 changes: 0 additions & 32 deletions packages/field-scripts/package.json

This file was deleted.

0 comments on commit 708400d

Please sign in to comment.