diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..8fc9f27 --- /dev/null +++ b/action.yml @@ -0,0 +1,13 @@ +name: 'Deploy to Neocities' +description: 'Github Action to deplpoy a folder to Neocities.org' +branding: + icon: cat + color: yellow +inputs: + api-token: # api token for site to deploy to + description: 'Neocities API token for site to deploy to' + required: true +outputs: # none +runs: + using: 'node12' + main: 'dist/bundle.js' diff --git a/dist/bundle.cjs.js b/dist/bundle.cjs.js new file mode 100644 index 0000000..afa878b --- /dev/null +++ b/dist/bundle.cjs.js @@ -0,0 +1,10 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// ESM syntax is supported. +const thing = { foo: 'bar' }; + +console.log(thing); + +exports.thing = thing; diff --git a/index.js b/index.js new file mode 100644 index 0000000..1ccadc9 --- /dev/null +++ b/index.js @@ -0,0 +1,4 @@ +// Set options as a parameter, environment variable, or rc file. +// eslint-disable-next-line no-global-assign +require = require('esm')(module/* , options */) +module.exports = require('./main.js') diff --git a/lib/client.js b/lib/client.js new file mode 100644 index 0000000..e69de29 diff --git a/main.js b/main.js new file mode 100644 index 0000000..927d3de --- /dev/null +++ b/main.js @@ -0,0 +1,7 @@ +// ESM syntax is supported. +const thing = { foo: 'bar' } +export { + thing +} + +console.log(thing) diff --git a/package.json b/package.json new file mode 100644 index 0000000..c6312a7 --- /dev/null +++ b/package.json @@ -0,0 +1,47 @@ +{ + "name": "deploy-to-neocities", + "version": "0.0.0", + "description": "Github Action to deplpoy a folder to Neocities.org", + "main": "index.js", + "module": "main.js", + "private": true, + "scripts": { + "test": "run-s test:*", + "test:deps": "dependency-check . --no-dev --no-peer", + "test:standard": "standard", + "test:tape": "tape -r esm test.js", + "clean": "rimraf dist && mkdirp dist", + "build": "run-s clean build:*", + "build:browserify": "rollup --config" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/bcomnes/deploy-to-neocities.git" + }, + "keywords": [], + "author": "Bret Comnes (https://bret.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/bcomnes/deploy-to-neocities/issues" + }, + "homepage": "https://github.com/bcomnes/deploy-to-neocities#readme", + "devDependencies": { + "dependency-check": "^4.1.0", + "esm": "^3.2.25", + "mkdirp": "^0.5.1", + "npm-run-all": "^4.1.5", + "rimraf": "^3.0.0", + "rollup": "^1.26.5", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-node-builtins": "^2.1.2", + "rollup-plugin-node-globals": "^1.4.0", + "rollup-plugin-node-resolve": "^5.2.0", + "standard": "^13.1.0", + "tape": "^4.11.0", + "tape-promise": "^4.0.0" + }, + "dependencies": { + "@actions/core": "^1.2.0", + "@actions/github": "^1.1.0" + } +} diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..a0cc349 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,20 @@ + +import resolve from 'rollup-plugin-node-resolve' +import commonjs from 'rollup-plugin-commonjs' +import builtins from 'rollup-plugin-node-builtins' +import globals from 'rollup-plugin-node-globals' + +export default [ + { + input: 'main.js', + output: [ + { file: 'dist/bundle.cjs.js', format: 'cjs' } + ], + plugins: [ + resolve(), + commonjs(), + globals(), + builtins() + ] + } +] diff --git a/test.js b/test.js new file mode 100644 index 0000000..5acecae --- /dev/null +++ b/test.js @@ -0,0 +1,9 @@ +import tape from 'tape' +import ptape from 'tape-promise' +import { thing } from './main' +const test = ptape(tape) + +test('a test', async t => { + console.log(thing) + t.ok('pass') +})