Skip to content

Commit

Permalink
convert to esm (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed May 5, 2023
1 parent 0397876 commit 3dc2694
Show file tree
Hide file tree
Showing 62 changed files with 12,552 additions and 10,396 deletions.
90 changes: 45 additions & 45 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
ignore:
# node support !== >=12.10.0
- dependency-name: 'npmlog'
versions: ['>=6']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'are-we-there-yet'
versions: ['>=3']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'commander'
versions: ['>=9']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'pacote'
versions: ['>=13']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: '@npmcli/arborist'
versions: ['>=5']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'mocha'
versions: ['>=10']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'sinon'
versions: ['>=14']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
# ESM only version
- dependency-name: 'globby'
versions: ['>=12']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'pretty-bytes'
versions: ['>=6']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: 'p-queue'
versions: ['>=7']
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: '*'
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 0
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'monthly'
open-pull-requests-limit: 10
ignore:
# node support !== >=12.10.0
- dependency-name: 'npmlog'
versions: ['>=6']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'are-we-there-yet'
versions: ['>=3']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'commander'
versions: ['>=9']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'pacote'
versions: ['>=13']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: '@npmcli/arborist'
versions: ['>=5']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'mocha'
versions: ['>=10']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'sinon'
versions: ['>=14']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
# ESM only version
- dependency-name: 'globby'
versions: ['>=12']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'pretty-bytes'
versions: ['>=6']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: 'p-queue'
versions: ['>=7']
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- dependency-name: '*'
update-types: ['version-update:semver-minor', 'version-update:semver-patch']
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
open-pull-requests-limit: 0
38 changes: 20 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,27 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [12.x, 14.x, 16.x, 18.x]
node-version: [16.x, 18.x]
generator-version: ['']
include:
- os: ubuntu-latest
node-version: 14.x
generator-version: '2.0.5'
- os: ubuntu-latest
node-version: 14.x
generator-version: '^4'
- os: ubuntu-latest
node-version: 16.x
generator-version: '2.0.5'
- os: ubuntu-latest
node-version: 16.x
generator-version: '^4'

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm install yeoman-generator@${{ matrix.generator-version }}
if: matrix.generator-version != ''
- run: npm test
env:
CI: true
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install -g npm@^8
if: matrix.node-version == '14.x'
- run: npm ci
- run: npm install yeoman-generator@${{ matrix.generator-version }}
if: matrix.generator-version != ''
- run: npm test
env:
CI: true
93 changes: 46 additions & 47 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -19,56 +18,56 @@ jobs:
node-version: [14.x]

steps:
- name: Checkout yeoman-test
uses: actions/checkout@v3
with:
repository: yeoman/yeoman-test
path: yeoman-test
- name: Checkout yeoman-test
uses: actions/checkout@v3
with:
repository: yeoman/yeoman-test
path: yeoman-test

- name: Checkout yeoman-generator
uses: actions/checkout@v3
with:
repository: yeoman/generator
path: yeoman-generator
- name: Checkout yeoman-generator
uses: actions/checkout@v3
with:
repository: yeoman/generator
path: yeoman-generator

- name: Checkout yeoman-environment
uses: actions/checkout@v3
with:
path: yeoman-environment
- name: Checkout yeoman-environment
uses: actions/checkout@v3
with:
path: yeoman-environment

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-integration
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-integration
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- name: Run yeoman-test test
run: |
cd $GITHUB_WORKSPACE/yeoman-test
npm ci
npm install yeoman/generator#main
npm install ${{ github.repository }}#$GITHUB_REF
npm test
- name: Run yeoman-test test
run: |
cd $GITHUB_WORKSPACE/yeoman-test
npm ci
npm install yeoman/generator#main
npm install ${{ github.repository }}#$GITHUB_REF
npm test
- name: Run yeoman-generator test
if: always()
run: |
cd $GITHUB_WORKSPACE/yeoman-generator
npm ci
npm install yeoman/yeoman-test#main
npm install ${{ github.repository }}#$GITHUB_REF
npm test
- name: Run yeoman-generator test
if: always()
run: |
cd $GITHUB_WORKSPACE/yeoman-generator
npm ci
npm install yeoman/yeoman-test#main
npm install ${{ github.repository }}#$GITHUB_REF
npm test
- name: Run yeoman-environment test
if: always()
run: |
cd $GITHUB_WORKSPACE/yeoman-environment
npm ci
npm install yeoman/yeoman-test#main
npm install yeoman/generator#main
npm test
- name: Run yeoman-environment test
if: always()
run: |
cd $GITHUB_WORKSPACE/yeoman-environment
npm ci
npm install yeoman/yeoman-test#main
npm install yeoman/generator#main
npm test
20 changes: 10 additions & 10 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: "Close stale issues"
name: 'Close stale issues'
on:
schedule:
- cron: "0 0 * * *"
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed'
days-before-stale: 30
days-before-close: 5
stale-issue-label: 'stale'
exempt-issue-labels: 'not stale'
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed'
days-before-stale: 30
days-before-close: 5
stale-issue-label: 'stale'
exempt-issue-labels: 'not stale'
3 changes: 3 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
parallel: true,
};
4 changes: 0 additions & 4 deletions .mocharc.json

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
coverage
.nyc_output
**/fixtures/**
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Prettier configuration

printWidth: 140
singleQuote: true
tabWidth: 2
useTabs: false
trailingComma: all

# js and ts rules:
arrowParens: avoid

# jsx and tsx rules:
bracketSameLine: false
bracketSpacing: true

endOfLine: auto
33 changes: 33 additions & 0 deletions .xo-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"space": true,
"envs": ["es2020", "node", "mocha"],
"prettier": true,
"ignores": ["test/fixtures"],
"rules": {
"unicorn/prefer-module": "off",
"import/no-dynamic-require": "off",
"padding-line-between-statements": "off",
"unicorn/prefer-spread": "off",
"prefer-spread": "off",
"prefer-rest-params": "off",
"node/prefer-promises/fs": "off",
"promise/prefer-await-to-then": "off",
"unicorn/no-array-reduce": "off",
"unicorn/import-style": "off",
"import/extensions": "off",
"unicorn/no-this-assignment": "off",
"import/order": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-push-push": "off",
"node/prefer-global/buffer": "off",
"node/prefer-global/process": "off"
},
"overrides": [
{
"files": "test/*",
"rules": {
"max-nested-callbacks": "off"
}
}
]
}

0 comments on commit 3dc2694

Please sign in to comment.