Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into #30-branch-name-and-is-pr-overrides
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/branch-utilities/package.json
#	packages/publish-helper/package.json
  • Loading branch information
Michael Wittwer committed Jul 13, 2024
2 parents 8f921f1 + bd306f0 commit 638659a
Show file tree
Hide file tree
Showing 45 changed files with 13,519 additions and 8,374 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,40 @@ jobs:
steps:
# checkout branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# 0 indicates all history, because publish requires tag information
fetch-depth: 0
# we need privileged access to publish to protected branch
token: ${{ secrets.GH_TOKEN_PUBLIC_REPO }}
# setup node and yarn cache
- name: Setup Node and Yarn Cache
uses: actions/setup-node@v3
# setup node and dependency cache
- name: Setup Node and NPM Cache
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
# yarn install
node-version-file: .nvmrc
cache: 'npm'
# install dependencies
- name: Install
run: HUSKY=0 yarn --frozen-lockfile
run: HUSKY=0 npm ci
# build lint plugins before linting
- name: Build lint plugins
run: yarn build:lint:ci
run: npm run build:lint:ci
# lint
- name: Lint
run: yarn lint:ci
run: npm run lint:ci
# test
- name: Test
run: yarn test:ci
run: npm run test:ci
# build
- name: Build
run: yarn build:ci
run: npm run build:ci
# publish
- name: Publish
run: |
npm config set //npm.pkg.github.com/:_authToken=$REGISTRY_TOKEN
git config user.email "[email protected]"
git config user.name "Github Actions"
yarn publish-libs
npm run publish-libs
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ lerna-debug.log
# System Files
.DS_Store
Thumbs.db

.nx/cache
.nx/workspace-data
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint -e $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged && npx lerna exec --concurrency 1 --stream lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Public helper packages with commonly used utilities / helpers.
>[![@shiftcode/branch-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fbranch-utilities%2Fpackage.json&label=%40shiftcode%2Fbranch-utilities)](packages/branch-utilities) \
>functions to read information about the current branch either locally or inside Github actions.
>[![@shiftcode/eslint-config-recommended](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-config-recommended%2Fpackage.json&label=%40shiftcode%2Feslint-config-recommended)](packages/eslint-config-recommended) \
>Our recommended config for eslint. We provide two versions, one for usage in node projects and one for Angular.
>[![@shiftcode/eslint-plugin-rules](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-plugin-rules%2Fpackage.json&label=%40shiftcode%2Feslint-plugin-rules)](packages/eslint-plugin-rules) \
>Contains some custom es lint rules. Those are used in our recommended eslint config.
>[![@shiftcode/publish-helper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fpublish-helper%2Fpackage.json&label=%40shiftcode%2Fpublish-helper)](packages/publish-helper)\
>scripts to prepare and publish libs inside mono-repos with lerna
Expand All @@ -20,8 +25,8 @@ Add a `.npmrc` file to the root of your project:
```

## Quick Start
* `yarn`
* `yarn build`
* `npm i`
* `npm run build`
* start developing


Expand All @@ -44,16 +49,16 @@ We use lerna to manage the packages.
- For lerna to know the topological order of packages, we define the dependencies between the packages in each individual package as `devDependency`
- For testing reasons we compile against the source code to run tests without prior compiling of the source, this requires `tsconfig.paths` definitions and also `moduleNameMapper` in `jest.config.js`


## ES Version
We support two runtimes: `node` and `latest browser versions`.

### Node^18
Node^18 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features and [100%](https://node.green/#ES2023) of `es2023` features.
### Node 20
Node 20 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features
(no version supports 100%) and [100%](https://node.green/#ES2023) of `es2023` features.
The only `es2022` feature that is currently not supported and needs a polyfill when using it is
[RegExp Match Indices (shows up in flags)](https://node.green/#ES2022-features-RegExp-Match-Indices---hasIndices-----d--flag-) (see [2ality blog](https://2ality.com/2019/12/regexp-match-indices.html) for insights).
Polyfill can be found here: https://www.npmjs.com/package/regexp-match-indices.

### Browser
For modern browsers the latest fully supported version is `es2021` (see [can-i-use](https://caniuse.com/?feats=mdn-javascript_builtins_string_replaceall,mdn-javascript_builtins_promise_any,mdn-javascript_builtins_weakref,mdn-javascript_operators_logical_or_assignment,mdn-javascript_operators_logical_and_assignment,mdn-javascript_operators_logical_nullish_assignment,mdn-javascript_grammar_numeric_separators,mdn-javascript_builtins_finalizationregistry)))
which therefore is the target for `@shiftcode/utilities` package.
For modern browsers the latest fully supported version is `es2023` (see [can-i-use](https://caniuse.com/?search=es2023))
which therefore is the target for `@shiftcode/utilities` package (see [package README](./packages/utilities/README.md)).
6 changes: 1 addition & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true,
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"command": {
"version": {
Expand Down
37 changes: 20 additions & 17 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build:ci",
"build",
"lint:ci",
"lint:src",
"test:ci"
]
}
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"outputs": [
"{projectRoot}/dist"
]
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"build:ci": {
"cache": true
},
"lint:ci": {
"cache": true
},
"lint:src": {
"cache": true
},
"test:ci": {
"cache": true
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": ["default"]
}
}
Loading

0 comments on commit 638659a

Please sign in to comment.