├── .DS_Store
├── .eslintrc.js
├── .gitignore
├── .prettierignore
├── .prettierrc.json
├── README.md
├── index.html
├── jsDev.fmp12
├── package-lock.json
├── package.json
├── scripts
├── generate-script-steps.js
├── reload-dev.js
├── start-fm-dev.js
└── upload.js
├── src
├── index.js
└── style.css
└── widget.config.js
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/integrating-magic/js-dev-environment/6ccc20c67fd4c437e1aae4ecc2d0ed7c4742942f/.DS_Store
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es2021: true,
5 | },
6 | extends: ["eslint:recommended", "prettier"],
7 | parserOptions: {
8 | ecmaVersion: "latest",
9 | sourceType: "module",
10 | },
11 | rules: {
12 | "no-var": "warn",
13 | "no-undef": "off",
14 | "no-unused-vars": "warn",
15 | },
16 | };
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .vscode
3 | dist
4 | import.log
5 | .parcel-cache
6 | .DS_Store'
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .vscode
3 | dist
4 | import.log
5 | .parcel-cache
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "arrowParens": "always",
3 | "bracketSpacing": true,
4 | "endOfLine": "lf",
5 | "htmlWhitespaceSensitivity": "css",
6 | "insertPragma": false,
7 | "jsxBracketSameLine": false,
8 | "jsxSingleQuote": false,
9 | "printWidth": 80,
10 | "proseWrap": "preserve",
11 | "quoteProps": "as-needed",
12 | "requirePragma": false,
13 | "semi": true,
14 | "singleQuote": false,
15 | "tabWidth": 2,
16 | "trailingComma": "es5",
17 | "useTabs": false,
18 | "vueIndentScriptAndStyle": false,
19 | "parser": "babel"
20 | }
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JS Dev Kit for FileMaker Developers
2 |
3 | *Develop, Render, and Deploy JavaScript for a FileMaker App*
4 |
5 | # This Kit
6 | ## What it does
7 | This environment allows a FileMaker developer to start coding their widget and see the results right away in a FileMaker file. Once done developing, the can be inlined and pushed to the FileMaker file for use offline.
8 |
9 | It's a template file, so you can use to start other projects.
10 | ## Consists of
11 | - A repository template on Github
12 | - A basic html / JS set up.
13 | - package.json file for install
14 | - A FileMaker file to show the widget rendered
15 | - Scripts to build and upload the inlined code to FileMaker
16 | ## TO GET STARTED Using this file
17 | 1. `npm install`
18 | 2. `npm start`
19 | 3. Open the jsDev.fmp12 file.
20 | 4. Allow it to work in Dev mode.
21 |
22 | At this point you should see the web viewer on the layout load up with the HTML and JavaScript here. Edit the JavaScript or the HTML and you'll see the render in the web viewer update.
23 |
24 | ## Use this kit
25 | Now you're ready to use this kit to create awesome JS widgets.
26 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
JS in FM is amazing
14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /jsDev.fmp12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/integrating-magic/js-dev-environment/6ccc20c67fd4c437e1aae4ecc2d0ed7c4742942f/jsDev.fmp12 -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js-dev-env", 3 | "version": "2.1.0", 4 | "author": "jeremy@integratingmagic.io", 5 | "license": "MIT", 6 | "description": "a generic development environment for developing JS in FileMaker", 7 | "scripts": { 8 | "start": "parcel index.html --no-source-maps", 9 | "reload": "node ./scripts/reload-dev", 10 | "deploy-to-fm": "npm run build && npm run upload", 11 | "build": "parcel build index.html", 12 | "upload": "node ./scripts/upload", 13 | "generate-script-steps": "node ./scripts/generate-script-steps", 14 | "clear-cache": "rm -rf .parcel-cache dist", 15 | "reset-dev": "npm run clear-cache && npm run start", 16 | "start-fm-dev": "node ./scripts/start-fm-dev", 17 | "open-dev-browser": "open http://localhost:1234" 18 | }, 19 | "browserslist": "> 0.5%, last 2 versions, not dead", 20 | "devDependencies": { 21 | "eslint": "^8.16.0", 22 | "eslint-config-prettier": "^8.5.0", 23 | "open": "^8.2.1", 24 | "parcel": "^2.8.1", 25 | "prettier": "2.6.2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /scripts/generate-script-steps.js: -------------------------------------------------------------------------------- 1 | const { exec, spawn } = require("child_process"); 2 | 3 | function pbcopy(data) { 4 | const proc = spawn("pbcopy"); 5 | proc.stdin.write(data); 6 | proc.stdin.end(); 7 | } 8 | 9 | function convertClipboardToFM() { 10 | exec( 11 | "osascript -e 'set the clipboard to (do shell script \"pbpaste\" as «class XMSS»)'", 12 | (error) => { 13 | if (error) { 14 | console.error(`exec error: ${error}`); 15 | return; 16 | } 17 | } 18 | ); 19 | } 20 | 21 | const xml = `