Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix workflow OS matrix #258

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
83 changes: 34 additions & 49 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,39 @@
name: Release and Publish

on:
push:
branches:
- master
- alpha
- beta
- next
push:
branches:
- main
- alpha
- beta
- next

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: npm install
run: npm install

- name: npm lint
run: npm run lint

- name: npm test
run: npm test

- name: Typecheck
run: npm run types

release:
name: Release
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: npm install
run: npm install

- name: Generate type definitions
run: npm run types

- name: npx semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: npm install
run: npm install

- name: npm lint
run: npm run lint

- name: npm types
run: npm run types

- name: npm test
run: npm test

- name: npx semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
57 changes: 33 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
name: Run Lint and Tests

on: push
on:
push:
branches-ignore:
- main
- alpha
- beta
- next

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm install

- name: npm lint
run: npm run lint

- name: npm test
run: npm test

- name: Typecheck
run: npm run types
build:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18, 20]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: npm install
run: npm install

- name: npm lint
run: npm run lint

- name: npm types
run: npm run types

- name: npm test
run: npm test
10 changes: 0 additions & 10 deletions .npmignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

13 changes: 13 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 4,
"overrides": [
{
"files": ["*.json", "*.yml"],
"options": {
"tabWidth": 2
}
}
]
}
22 changes: 22 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import js from '@eslint/js';

export default [
js.configs.recommended,
prettierConfig,
prettierPlugin,
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
global: true,
},
},
},
{
ignores: ['coverage/*', 'dist/*'],
},
];
1 change: 0 additions & 1 deletion example/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ const server = http.createServer(async (req, res) => {
});

server.listen(8080, 'localhost', () => {
// eslint-disable-next-line no-console
console.log('Server running at: http://localhost:8080');
});
2 changes: 1 addition & 1 deletion lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default class PodiumContext {
).then((result) => {
result.forEach((item, index) => {
const key = `${PREFIX}-${parsers[index][0]}`;
// eslint-disable-next-line no-param-reassign

incoming.context[decamelize(key, { separator: '-' })] = item;
});

Expand Down
1 change: 0 additions & 1 deletion lib/get-device-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export default class PodiumContextDeviceTypeParser {

/* istanbul ignore next */
if (!type) {
// eslint-disable-next-line no-underscore-dangle
const capabilities = Bowser.getParser(userAgent);
const platformType = capabilities.getPlatformType();
type = this[symCapabilitiesToType](platformType);
Expand Down
133 changes: 67 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,69 @@
{
"name": "@podium/context",
"version": "5.0.23",
"description": "Module to generate the context which is passed on requests from a Podium Layout server to a Podium Podlet server",
"type": "module",
"license": "MIT",
"keywords": [
"micro services",
"micro frontend",
"components",
"podium"
],
"repository": {
"type": "git",
"url": "[email protected]:podium-lib/context.git"
},
"bugs": {
"url": "https://github.com/podium-lib/issues"
},
"homepage": "https://podium-lib.io/",
"files": [
"package.json",
"CHANGELOG.md",
"README.md",
"LICENSE",
"dist",
"lib",
"types"
],
"main": "./lib/context.js",
"types": "./types/context.d.ts",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "tap --disable-coverage --allow-empty-coverage && tsc --project tsconfig.test.json",
"types": "tsc --declaration --emitDeclarationOnly"
},
"author": "",
"dependencies": {
"@metrics/client": "2.5.2",
"@podium/schemas": "5.0.5",
"@podium/utils": "5.0.7",
"abslog": "2.4.4",
"bcp47-validate": "^1.0.0",
"bowser": "^2.7.0",
"decamelize": "^6.0.0",
"lru-cache": "10.4.3"
},
"devDependencies": {
"@babel/eslint-parser": "7.24.7",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "11.1.0",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.3",
"@semantic-release/release-notes-generator": "12.1.0",
"@types/readable-stream": "4.0.14",
"eslint": "8.57.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.1.3",
"prettier": "3.3.2",
"semantic-release": "23.1.1",
"tap": "18.7.2",
"typescript": "5.4.5"
}
"name": "@podium/context",
"version": "5.0.23",
"description": "Module to generate the context which is passed on requests from a Podium Layout server to a Podium Podlet server",
"type": "module",
"license": "MIT",
"keywords": [
"micro services",
"micro frontend",
"components",
"podium"
],
"repository": {
"type": "git",
"url": "[email protected]:podium-lib/context.git"
},
"bugs": {
"url": "https://github.com/podium-lib/issues"
},
"homepage": "https://podium-lib.io/",
"files": [
"package.json",
"CHANGELOG.md",
"README.md",
"LICENSE",
"dist",
"lib",
"types"
],
"main": "./lib/context.js",
"types": "./types/context.d.ts",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "run-s test:*",
"test:unit": "tap --disable-coverage --allow-empty-coverage",
"test:types": "tsc --project tsconfig.test.json",
"types": "tsc --declaration --emitDeclarationOnly"
},
"author": "",
"dependencies": {
"@metrics/client": "2.5.2",
"@podium/schemas": "5.0.5",
"@podium/utils": "5.0.7",
"abslog": "2.4.4",
"bcp47-validate": "^1.0.0",
"bowser": "^2.7.0",
"decamelize": "^6.0.0",
"lru-cache": "10.4.3"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "11.1.0",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.3",
"@semantic-release/release-notes-generator": "12.1.0",
"@types/readable-stream": "4.0.14",
"eslint": "9.6.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"globals": "15.8.0",
"npm-run-all": "4.1.5",
"prettier": "3.3.2",
"semantic-release": "23.1.1",
"tap": "18.7.2",
"typescript": "5.4.5"
}
}
Loading