Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GianlucaGuarini committed Apr 4, 2022
1 parent 3920564 commit e5ba946
Showing 6 changed files with 5,769 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [14.x, 15.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
5,733 changes: 5,733 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@
],
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"chai": "^4.3.4",
"eslint": "^7.30.0",
"chai": "^4.3.6",
"eslint": "^8.12.0",
"eslint-config-riot": "^3.0.0",
"mocha": "^8.4.0",
"nyc": "^15.1.0"
@@ -44,16 +44,18 @@
"homepage": "https://github.com/riot/cli#readme",
"author": "Gianluca Guarini <gianluca.guarini@gmail.com> (http://gianlucaguarini.com/)",
"dependencies": {
"@babel/preset-typescript": "^7.14.5",
"@riotjs/compiler": "^6.0.0",
"@rollup/plugin-babel": "^5.3.0",
"chalk": "^4.1.1",
"chokidar": "^3.5.2",
"@babel/preset-typescript": "^7.16.7",
"@riotjs/compiler": "^6.1.3",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"cumpa": "^1.0.1",
"esm": "^3.2.25",
"glob": "^7.1.7",
"glob": "^7.2.0",
"optionator": "^0.9.1",
"rollup": "^2.53.1",
"rollup": "^2.70.1",
"rollup-plugin-riot": "^6.0.0"
}
}
14 changes: 2 additions & 12 deletions src/compile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {babel} from '@rollup/plugin-babel'
import { getRollupPlugins } from './util'
import {info} from './logger'
import riot from 'rollup-plugin-riot'
import {rollup} from 'rollup'

/**
@@ -11,16 +10,7 @@ import {rollup} from 'rollup'
export default async function compile(options) {
const bundle = await rollup({
input: options.input,
plugins: [
riot(options.riot),
babel({
presets: [[require.resolve('@babel/preset-typescript'), {
allExtensions: true
}]],
babelHelpers: 'bundled',
extensions: ['.js', '.ts', '.riot', '.html']
})
]
plugins: getRollupPlugins(options)
})

info(`${options.input} -> ${options.output.file}`)
20 changes: 20 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { babel } from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import riot from 'rollup-plugin-riot'

export function getRollupPlugins(options) {
return [
riot(options.riot),
nodeResolve(options.resolve),
commonjs(options.commonjs),
babel({
presets: [[require.resolve('@babel/preset-typescript'), {
allExtensions: true
}]],
babelHelpers: 'bundled',
extensions: ['.js', '.ts', '.riot', '.html'],
...options.babel
})
]
}
14 changes: 2 additions & 12 deletions src/watch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {babel} from '@rollup/plugin-babel'
import { getRollupPlugins } from './util'
import {info} from './logger'
import riot from 'rollup-plugin-riot'
import {watch as rollupWatch} from 'rollup'

/**
@@ -16,16 +15,7 @@ export default async function watch(options) {
return rollupWatch({
input,
output,
plugins: [
riot(options.riot),
babel({
presets: [[require.resolve('@babel/preset-typescript'), {
allExtensions: true
}]],
babelHelpers: 'bundled',
extensions: ['.js', '.ts', '.riot', '.html']
})
],
plugins: getRollupPlugins(options),
watch: {}
})
}

0 comments on commit e5ba946

Please sign in to comment.