Skip to content

Commit

Permalink
feat: rewrite to make it more extensible (#81)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: bin scripts are now `template-oss-apply` and
`template-oss-check`
renamed apply props `rootRepo`, `rootModule`,
`workspaceRepo`, `workspaceModule`
  • Loading branch information
lukekarrys committed Mar 16, 2022
1 parent f80526a commit 605ccbd
Show file tree
Hide file tree
Showing 100 changed files with 5,221 additions and 2,066 deletions.
5 changes: 2 additions & 3 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// This file is automatically added by @npmcli/template-oss. Do not edit.
/* This file is automatically added by @npmcli/template-oss. Do not edit. */

module.exports = {
extends: ['@commitlint/config-conventional'],
// If you change rules be sure to also update release-please.yml
rules: {
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'chore', 'deps']],
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'deps', 'chore']],
'header-max-length': [2, 'always', 80],
'subject-case': [0, 'always', ['lower-case', 'sentence-case', 'start-case']],
},
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is automatically added by @npmcli/template-oss. Do not edit.
/* This file is automatically added by @npmcli/template-oss. Do not edit. */

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

Expand Down
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* @npm/cli-team
# This file is automatically added by @npmcli/template-oss. Do not edit.

* @npm/cli-team
88 changes: 44 additions & 44 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,52 @@
name: Bug
description: File a bug/issue
title: "[BUG] <title>"
labels: [Bug, Needs Triage]
labels: [ Bug, Needs Triage ]

body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](./issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
value: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **npm**: 7.6.3
- **Node**: 13.14.0
- **OS**: Ubuntu 20.04
- **platform**: Macbook Pro
value: |
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](./issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
value: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **npm**: 7.6.3
- **Node**: 13.14.0
- **OS**: Ubuntu 20.04
- **platform**: Macbook Pro
value: |
- npm:
- Node:
- OS:
- platform:
validations:
required: false

validations:
required: false
25 changes: 13 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

version: 2

updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
allow:
- dependency-type: direct
versioning-strategy: increase
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
allow:
- dependency-type: direct
versioning-strategy: increase
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
37 changes: 28 additions & 9 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,40 @@
name: Audit

on:
workflow_dispatch: null
schedule:
# "At 01:00 on Monday" https://crontab.guru/#0_1_*_*_1
- cron: "0 1 * * 1"
workflow_dispatch:

jobs:
audit:
name: npm audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.email "ops+npm-cli@npmjs.com"
git config --global user.name "npm cli ops bot"
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install deps
run: npm i --package-lock
- name: Audit
run: npm audit
node-version: 16.x
- name: Update to workable npm (windows)
# 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: Update npm to 7
# If we do test on npm 10 it needs npm7
if: matrix.node-version <= 10
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Update npm to latest
if: matrix.node-version > 10
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- run: npm i --package-lock
- run: npm audit
71 changes: 55 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
name: CI

on:
workflow_dispatch: null
pull_request:
branches:
- '*'
push:
branches:
- main
Expand All @@ -16,37 +19,68 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.email "ops+npm-cli@npmjs.com"
git config --global user.name "npm cli ops bot"
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm i --prefer-online -g npm@latest
node-version: 16.x
- name: Update to workable npm (windows)
# 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: Update npm to 7
# If we do test on npm 10 it needs npm7
if: matrix.node-version <= 10
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Update npm to latest
if: matrix.node-version > 10
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- run: npm i
- run: npm run lint

test:
strategy:
fail-fast: false
matrix:
node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
node-version:
- 12.13.0
- 12.x
- 14.15.0
- 14.x
- 16.0.0
- 16.x
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: cmd
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash
- os: windows-latest
shell: cmd
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.email "ops+npm-cli@npmjs.com"
git config --global user.name "npm cli ops bot"
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
node-version: 16.x
- name: Update to workable npm (windows)
# 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
Expand All @@ -55,7 +89,12 @@ jobs:
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Update npm
- name: Update npm to 7
# If we do test on npm 10 it needs npm7
if: matrix.node-version <= 10
run: npm i --prefer-online --no-fund --no-audit -g npm@7
- name: Update npm to latest
if: matrix.node-version > 10
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- run: npm i
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches:
- main
- latest
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches:
- main
- latest
schedule:
# "At 03:00 on Monday" https://crontab.guru/#0_3_*_*_1
- cron: "0 3 * * 1"
Expand All @@ -24,15 +28,17 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: [ javascript ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- uses: actions/checkout@v3
- name: Setup git user
run: |
git config --global user.email "ops+npm-cli@npmjs.com"
git config --global user.name "npm cli ops bot"
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit 605ccbd

Please sign in to comment.