Skip to content

Commit 03239e8

Browse files
committed
[init] merge npm template to pre-release code, to keep history
1 parent 76cdffc commit 03239e8

29 files changed

+698
-37
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!--- STOP! Before you open an issue please search this repository's issues to see if it has already been reported. This helps reduce duplicate issues from being created. -->
2+
3+
### Expected Behaviour
4+
5+
### Actual Behaviour
6+
7+
### Reproduce Scenario (including but not limited to)
8+
9+
#### Steps to Reproduce
10+
11+
#### Platform and Version
12+
13+
#### Sample Code that illustrates the problem
14+
15+
#### Logs taken while reproducing problem

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--- Provide a general summary of your changes in the Title above
2+
Use Angular Commit Message Conventions in commits -
3+
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-header
4+
-->
5+
6+
## Description
7+
8+
<!--- Describe your changes in detail -->
9+
10+
## Related Issue
11+
12+
<!--- This project only accepts pull requests related to open issues
13+
If suggesting a new feature or change, please discuss it in an issue first
14+
If fixing a bug, there should be an issue describing it with steps to reproduce -->
15+
<!--
16+
To automatically close linked issue when PR is merged.
17+
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
18+
-->
19+
20+
Fixes #
21+
22+
## Types of changes
23+
24+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
25+
26+
- [ ] Bug fix (non-breaking change which fixes an issue)
27+
- [ ] New feature (non-breaking change which adds functionality)
28+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
29+
30+
## Checklist:
31+
32+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
33+
34+
- [ ] My code follows the code style of this project.
35+
- [ ] I have read the **[CONTRIBUTING](docs/CONTRIBUTING.mnd)** document.
36+
- [ ] All new and existing tests passed.

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: [ $default-branch ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
node-version: [16.x]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Build Library
29+
run: npm run build --if-present
30+
- name: Run Tests
31+
run: npm test --if-present

.github/workflows/codeql-analysis.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '20 12 * * 0'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'javascript' ]
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v2
35+
36+
# Initializes the CodeQL tools for scanning.
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v1
39+
with:
40+
languages: ${{ matrix.language }}
41+
42+
- run: npm run build --if-present
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@v1

.github/workflows/manual-release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Manual Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version'
7+
type: choice
8+
required: true
9+
default: patch
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
dryRun:
15+
description: 'DryRun'
16+
type: boolean
17+
default: true
18+
# ENV and Config
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
GIT_AUTHOR_NAME: github-actions
23+
GIT_AUTHOR_EMAIL: [email protected]
24+
GIT_COMMITTER_NAME: github-actions
25+
GIT_COMMITTER_EMAIL: [email protected]
26+
CI: true
27+
CONFIG_NODE_VERSION: '["16.x"]'
28+
CONFIG_OS: '["ubuntu-latest"]'
29+
# Main Job
30+
jobs:
31+
config:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
NODE_VERSION: ${{ steps.set-config.outputs.CONFIG_NODE_VERSION }}
35+
OS: ${{ steps.set-config.outputs.CONFIG_OS }}
36+
steps:
37+
- id: set-config
38+
run: |
39+
echo "CONFIG_NODE_VERSION=${{ toJSON(env.CONFIG_NODE_VERSION) }}" >> $GITHUB_OUTPUT
40+
echo "CONFIG_OS=${{ toJSON(env.CONFIG_OS) }}" >> $GITHUB_OUTPUT
41+
release:
42+
name: Test, Build and force Release
43+
needs: config
44+
45+
runs-on: ${{ matrix.OS }}
46+
strategy:
47+
matrix:
48+
OS: ${{ fromJSON(needs.config.outputs.OS) }}
49+
NODE_VERSION: ${{ fromJSON(needs.config.outputs.NODE_VERSION) }}
50+
51+
steps:
52+
- name: Checkout repo
53+
uses: actions/checkout@v3
54+
- name: Setup Node.js ${{ matrix.NODE_VERSION }}
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: ${{ matrix.NODE_VERSION }}
58+
- name: Commit trigger
59+
run: |
60+
git commit --allow-empty -m "${{ github.event.inputs.version }}: Trigger Manual Release"
61+
- name: Install dependencies
62+
run: npm ci
63+
- name: Build Library
64+
run: npm run build --if-present
65+
- name: Run Tests
66+
run: npm test --if-present
67+
- name: Publish npm package
68+
uses: cycjimmy/semantic-release-action@v3
69+
with:
70+
dry_run: ${{ github.event.inputs.dryRun == 'true' }}
71+
extra_plugins: |
72+
@semantic-release/changelog
73+
@semantic-release/git

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Test, Build and Release
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ ubuntu-latest ]
15+
node-version: [ 16.x ]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix['node-version'] }}
24+
- name: Install dependencies
25+
run: npm ci
26+
- name: Build Library
27+
run: npm run build --if-present
28+
- name: Run Tests
29+
run: npm test --if-present
30+
- name: Release
31+
uses: cycjimmy/semantic-release-action@v3
32+
with:
33+
dry_run: true
34+
extra_plugins: |
35+
@semantic-release/changelog
36+
@semantic-release/git
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
GIT_AUTHOR_NAME: github-actions
41+
GIT_AUTHOR_EMAIL: [email protected]
42+
GIT_COMMITTER_NAME: github-actions
43+
GIT_COMMITTER_EMAIL: [email protected]
44+
CI: true

.gitignore

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
1-
npm-debug.log
2-
node_modules
3-
package-lock.json
4-
.npmrc
1+
# Logs
2+
logs
3+
*.log
4+
5+
# IDE
6+
.project
7+
.classpath
8+
.settings
9+
.idea/
10+
*.iml*
11+
*.ipr
12+
.brackets.json
13+
.vscode/
14+
.history
15+
16+
# OS
17+
.DS_Store
18+
*.swp
19+
20+
# Node related files
21+
node_modules/
22+
node/
23+
bin/
24+
typings
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
.stylelintcache
29+
.eslintcache
30+
31+
# env
32+
\.env

.npmignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.eslintrc
2+
.nyc_output
3+
rollup.config.js
4+
.prettierrc
5+
.git
6+
.prettierignore
7+
**/.git/
8+
**/node_modules/
9+
yarn.lock
10+
/dev
11+
/docs
12+
/public
13+
/coverage
14+
/.vscode
15+
/tests
16+
/temp
17+
/templates
18+
/demos
19+
/src
20+
.github

.releaserc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/changelog",
8+
{
9+
"changelogFile": "docs/CHANGELOG.md"
10+
}
11+
],
12+
"@semantic-release/npm",
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["docs/CHANGELOG.md", "package.json"]
17+
}
18+
]
19+
]
20+
}

0 commit comments

Comments
 (0)