Skip to content

Commit

Permalink
updated: use pure esm modules
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed May 24, 2024
1 parent a47f714 commit 7a87234
Show file tree
Hide file tree
Showing 13 changed files with 1,494 additions and 2,748 deletions.
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ engines:

ratings:
paths:
- "src/**.js"
- 'src/**.js'

exclude_patterns:
- "test/**"
- 'test/**'
6 changes: 1 addition & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
extends: eslint-config-riot

parserOptions:
ecmaVersion: 9
sourceType: 'module'

globals:
sinon: true
chai: true
chai: true
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ name: test

on:
push:
branches: [ main, dev ]
branches: [main, dev]
pull_request:
branches: [ main, dev ]
branches: [main, dev]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import prettierConfig from '@riotjs/prettier-config'
export default prettierConfig
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# create-riot

Riot.js Components and Projects scaffolder

# Usage

Run the following command to create a new Riot.js project starting from an official template

```
npm init riot
```
Expand All @@ -15,18 +17,14 @@ npm init riot
[![MIT License][license-image]][license-url]
[![Coverage Status][coverage-image]][coverage-url]

[ci-image]:https://img.shields.io/github/actions/workflow/status/riot/create-riot/test.yml?style=flat-square
[ci-url]:https://github.com/riot/create-riot/actions

[license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]:LICENSE

[npm-version-image]:http://img.shields.io/npm/v/create-riot.svg?style=flat-square
[npm-downloads-image]:http://img.shields.io/npm/dm/create-riot.svg?style=flat-square
[npm-url]:https://npmjs.org/package/create-riot

[coverage-image]:https://img.shields.io/coveralls/riot/create-riot/main.svg?style=flat-square
[coverage-url]:https://coveralls.io/r/riot/create-riot/?branch=main

[codeclimate-image]:https://api.codeclimate.com/v1/badges/5712496768a9da5988b3/maintainability
[codeclimate-url]:https://codeclimate.com/github/riot/create-riot
[ci-image]: https://img.shields.io/github/actions/workflow/status/riot/create-riot/test.yml?style=flat-square
[ci-url]: https://github.com/riot/create-riot/actions
[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE
[npm-version-image]: http://img.shields.io/npm/v/create-riot.svg?style=flat-square
[npm-downloads-image]: http://img.shields.io/npm/dm/create-riot.svg?style=flat-square
[npm-url]: https://npmjs.org/package/create-riot
[coverage-image]: https://img.shields.io/coveralls/riot/create-riot/main.svg?style=flat-square
[coverage-url]: https://coveralls.io/r/riot/create-riot/?branch=main
[codeclimate-image]: https://api.codeclimate.com/v1/badges/5712496768a9da5988b3/maintainability
[codeclimate-url]: https://codeclimate.com/github/riot/create-riot
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env node

// Set options as a parameter, environment variable, or rc file.
// eslint-disable-next-line no-global-assign
require = require('esm')(module) // eslint-disable-line
const createRiotAPI = require('./src/index.js')
import createRiotAPI from './src/index.js'

if (module.parent) {
module.exports = createRiotAPI
/* istanbul ignore next */
} else createRiotAPI.default()
createRiotAPI()
Loading

0 comments on commit 7a87234

Please sign in to comment.