Implement basic build arch

This commit is contained in:
Bret Comnes 2019-11-11 15:51:48 -07:00
parent 3fa8edc051
commit 363449e7b5
No known key found for this signature in database
GPG Key ID: 3705F4634DC3A1AC
8 changed files with 110 additions and 0 deletions

13
action.yml Normal file
View File

@ -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'

10
dist/bundle.cjs.js vendored Normal file
View File

@ -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;

4
index.js Normal file
View File

@ -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')

0
lib/client.js Normal file
View File

7
main.js Normal file
View File

@ -0,0 +1,7 @@
// ESM syntax is supported.
const thing = { foo: 'bar' }
export {
thing
}
console.log(thing)

47
package.json Normal file
View File

@ -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 <bcomnes@gmail.com> (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"
}
}

20
rollup.config.js Normal file
View File

@ -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()
]
}
]

9
test.js Normal file
View File

@ -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')
})