Skip to content

Commit

Permalink
feat: template repo
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Jan 2, 2023
1 parent 1e82454 commit e17dee4
Show file tree
Hide file tree
Showing 93 changed files with 3,781 additions and 1,952 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* This file is automatically added by @npmcli/template-oss. Do not edit. */

'use strict'

const { readdirSync: readdir } = require('fs')

const localConfigs = readdir(__dirname)
.filter((file) => file.startsWith('.eslintrc.local.'))
.map((file) => `./${file}`)

module.exports = {
root: true,
ignorePatterns: [
'cli/**',
'theme/**',
],
extends: [
'@npmcli',
...localConfigs,
],
}
22 changes: 22 additions & 0 deletions .eslintrc.local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
overrides: [{
files: ['src/**'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
},
env: {
commonjs: true,
es2022: true,
browser: true,
node: false,
},
rules: {
'max-len': 'off',
'import/no-extraneous-dependencies': 'off',
'no-unused-vars': 'off',
},
}],
}
26 changes: 18 additions & 8 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Assign Product Management to all open PRs
* @MylesBorins @monishcm

# Assign cli team to cli related PRs
# In general these should be closed and pointed towards the CLI
# repo... we should automate this
/cli @npm/cli-team
/content/cli @npm/cli-team
# This file is automatically added by @npmcli/template-oss. Do not edit.

* @npm/cli-team

# Documentation content
/content/ @MylesBorins @monishcm
/src/ @MylesBorins @monishcm
/static/ @MylesBorins @monishcm
/.reuse/ @MylesBorins @monishcm
/CONTENT-MODEL.md @MylesBorins @monishcm

# Licensing
/LICENSES/ @MylesBorins @monishcm
/LICENSE @MylesBorins @monishcm
/LICENSE-CODE @MylesBorins @monishcm

# CLI content
/content/cli/ @npm/cli-team
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

blank_issues_enabled: true
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
version: 2

updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
- package-ecosystem: npm
directory: cli/
schedule:
Expand All @@ -15,3 +27,15 @@ updates:
prefix-development: chore
labels:
- "Dependencies"
- package-ecosystem: npm
directory: theme/
schedule:
interval: daily
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
40 changes: 40 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: Audit

on:
workflow_dispatch:
schedule:
# "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
- cron: "0 8 * * 1"

jobs:
audit:
name: Audit Dependencies
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
- name: Install Dependencies
run: npm i --no-audit --no-fund --package-lock
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
9 changes: 4 additions & 5 deletions .github/workflows/ci-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
run: npm i --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w cli
- name: Post Lint
Expand All @@ -57,9 +58,6 @@ jobs:
- name: Linux
os: ubuntu-latest
shell: bash
- name: Windows
os: windows-latest
shell: cmd
node-version:
- 18.x
runs-on: ${{ matrix.platform.os }}
Expand All @@ -77,6 +75,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Update Windows npm
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
Expand All @@ -96,7 +95,7 @@ jobs:
- name: npm Version
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
run: npm i --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/ci-theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: CI - theme

on:
workflow_dispatch:
pull_request:
paths:
- theme/**
push:
branches:
- main
- latest
paths:
- theme/**
schedule:
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
- cron: "0 9 * * 1"

jobs:
lint:
name: Lint
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: npm
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
- name: Install Dependencies
run: npm i --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w theme
- name: Post Lint
run: npm run postlint --ignore-scripts -w theme

test:
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
node-version:
- 18.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Update Windows npm
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
cd package
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Install npm@7
if: startsWith(matrix.node-version, '10.')
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Install npm@latest
if: ${{ !startsWith(matrix.node-version, '10.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
- name: Install Dependencies
run: npm i --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -w theme
Loading

0 comments on commit e17dee4

Please sign in to comment.