Skip to content

Commit

Permalink
Lerna setup, and ESLint, Jest and TS configs refactored (#293)
Browse files Browse the repository at this point in the history
* Lerna setup, and ESLint, Jest and TS configs refactored

* updates for CI, removed lint step due to copyright checking failures

* use local Lerna in CI

* add wildcard path for code coverage upload

* wildcards may need v2 of GitHub upload-artifact

* attempting CD fixes now for Lerna

* YAML typo on cd-preview

* still a YAML typo on cd-preview

* you need to add --yes for lerna version in CI

* typo in YAML (comment inside multi-line run command)

* docs build folders added to .gitignore

* updates based on PR feedback

* use explicit version for GitHub upload-artifact

* v0.0.1-featsetup-lerna-239690977-669.0

* moved lerna bootstrap before lerna version

* cannot use backslashes to refer to local Lerna on windows

* v0.0.1-featsetup-lerna-239757947-671.0

* was missing -- on npm script for version

* v0.0.1-featsetup-lerna-239785047-673.0

* Prevent Lerna from pushing prerelease tags

* v0.0.1-featsetup-lerna-239799074-675.0

* Prevent learna from pushing prelease tag

* Removed deprecated (and unused) Lerna skip-git option

* Force lerna to get version number from package.json

The default behavior is to look at the git history, but the preview does not push a tag into the history (see https://github.com/lerna/lerna/tree/master/commands/publish#readme for details).

* Added response to Lerna prompt on preview

* v0.0.1-0.1.1-featsetup-lerna-000-000.000.0

* Added confirmation to publish script

* Reverted `lerna.json`

* Prepared release CD script

Added a build step as a pre-publish step, and removed extraneous lerna bootstrap from preview CD.

* Added confirmation flag for preview publication

* remove linting from lint-staged

Co-authored-by: pmcb55 <[email protected]>
Co-authored-by: Nicolas Seydoux <[email protected]>
Co-authored-by: NSeydoux <[email protected]>
  • Loading branch information
4 people authored Sep 7, 2020
1 parent 8471054 commit ff09201
Show file tree
Hide file tree
Showing 232 changed files with 18,053 additions and 5,405 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
resources/
resources/
node_modules/
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier", "license-header"],
extends: [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
},
rules: {
"prettier/prettier": "error",
"@typescript-eslint/interface-name-prefix": ["error", "always"],
"import/no-unresolved": 0,
"license-header/header": ["error", "./resources/license-header.js"],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
},
};
20 changes: 0 additions & 20 deletions .eslintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/cd-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
# Remove non-alphanumeric characters
# See https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: echo "::set-env name=TAG_SLUG::$(echo ${GITHUB_REF#refs/heads/} | tr -cd '[:alnum:]-')"
- run: npm ci
- name: Prepare prerelease version
run: |
git config user.name $GITHUB_ACTOR
git config user.email gh-actions-${GITHUB_ACTOR}@github.com
# Make sure the prerelease is tagged with the branch name, and that they are sorted by build:
npm version prerelease --preid=$TAG_SLUG-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER
- run: npm ci
npm run version -- prerelease --preid=$TAG_SLUG-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER --yes --no-push
- run: npm run build
- run: npm publish --tag "$TAG_SLUG"
- run: npm run publish-preview -- --dist-tag "$TAG_SLUG" --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: CD-release

on:
push:
Expand Down Expand Up @@ -55,11 +55,19 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: npm ci
- name: Publish to npm
# If you want a package to be public (e.g. you'd expect
# `npm publish --access public` here), then just add this to the relevant
# `package.json` file:
# {
# "publishConfig": {
# "access": "public"
# }
# }
run: |
npm publish --access public
echo "Package published. To install, run:"
npm run publish -- --yes
echo "Packages published. To install, run:"
echo ""
echo " npm install @inrupt/solid-client-authn-browser"
echo " npm install @inrupt/solid-client-authn-XXXX"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Mark GitHub Deployment as successful
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ jobs:
path: node_modules
key: ${{ runner.os }}-node${{ runner.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run bootstrap -- --ci
- run: npm run build
- run: npm test
- run: npx prettier --check "{src,__tests__}/**"
- run: npm run test
- run: npx prettier --check "{packages/*/src,packages/*/__tests__}/**"
- run: npm audit --audit-level=moderate
- name: Archive code coverage results
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v2.1.4
with:
name: code-coverage-report
path: coverage
path: ./packages/*/coverage/
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ lerna-debug.log
packages/*/lib

# Documentation
docs/prose/build/
docs/api/build/
docs/api/source/api/
docs/dist/
packages/**/docs/prose/build/
packages/**/docs/api/build/
packages/**/docs/api/source/api/
packages/**/docs/dist/
22 changes: 2 additions & 20 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
# Changelog

This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### New features

## [0.1.1] - 2020-08-14

### Bugfixes

- The code wasn't shipped properly when publishing a non-dev release to NPMJS.

## [0.1.0] - 2020-08-10

### New features

First release! What's possible with this first release:

- Authenticate a Web app to a Solid Identity provider
- Perform an authenticated fetch to a Pod Server, using a DPoP token
This change log is intended to record changes made across all packages contained
within this mono-repo.
13 changes: 13 additions & 0 deletions NOTICE-TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###############################################################################
#
# This file is intended as a template, to be copied to contained packages and
# edited as appropriate for that particular package (including deleting this
# template pre-amble!), and renamed to remove the '-TEMPLATE' suffix.
#
###############################################################################

Inrupt `solid-client-authn-XXXX`
Copyright 2020 Inrupt Inc.

This product includes software developed at
Inrupt Inc. (https://inrupt.com/).
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module.exports = {
"^.+\\.(ts|tsx)?$": "ts-jest",
},
collectCoverageFrom: [
"src/**/*.ts",
"**/src/**/*.ts",
"!**/node_modules/**",
"!**/__tests__/**",
"!src/external-types/**",
"!src/index.ts",
"!**/src/external-types/**",
"!**/src/index.ts",
],
};
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packages": ["packages/*"],
"version": "0.1.1"
}
Loading

0 comments on commit ff09201

Please sign in to comment.