-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from fleetbase/refactoring-and-type-declarations
Refactoring, gh workflow and type declarations
- Loading branch information
Showing
70 changed files
with
5,248 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ | |
"space-before-function-paren": 0, | ||
"comma-dangle": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: storefront-js | ||
|
||
on: | ||
push: | ||
branches: [main, dev-**] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [main, dev-**] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] # Build on Node.js 16 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: ~/.pnpm-store # Replace this with the path you want to cache | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
|
||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm run bundle | ||
|
||
npm_publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js 18.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
|
||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm run bundle | ||
|
||
- name: Set up npm | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc | ||
|
||
- name: Publish | ||
run: npm publish --access public | ||
|
||
github_publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js 18.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
|
||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm run bundle | ||
|
||
- name: Configure npm for GitHub registry | ||
run: | | ||
echo "@fleetbase:registry=https://npm.pkg.github.com/" >> ~/.npmrc | ||
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc | ||
- name: Publish to GitHub registry | ||
run: npm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,8 @@ | |
/.reify-cache | ||
/yarn.lock | ||
/package-lock.json | ||
.DS_Store | ||
.DS_Store | ||
|
||
# Ignore artifacts: | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm exec lint-staged | ||
pnpm exec lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# compiled output | ||
/dist/ | ||
dist/ | ||
/tmp/ | ||
|
||
# dependencies | ||
/node_modules/ | ||
LICENSE.md | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
trailingComma: 'es5', | ||
tabWidth: 4, | ||
semi: true, | ||
singleQuote: true, | ||
printWidth: 190, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,68 @@ | ||
{ | ||
"name": "@fleetbase/storefront", | ||
"version": "1.1.5", | ||
"description": "Fleetbase Storefront JS & Node SDK", | ||
"main": "dist/cjs/storefront.js", | ||
"module": "dist/esm/storefront.js", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"scripts": { | ||
"prebuild": "npm run lint", | ||
"lint": "eslint src", | ||
"lint:fix": "eslint src --fix", | ||
"lint:tests": "eslint tests", | ||
"bundle": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/*.test.js" | ||
}, | ||
"keywords": [ | ||
"fleetbase", | ||
"ecommerce", | ||
"api", | ||
"ondemand", | ||
"ecommerce", | ||
"last", | ||
"mile", | ||
"delivery", | ||
"logistics", | ||
"ecommerce", | ||
"app" | ||
], | ||
"author": "Ronald A. Richardson <[email protected]> (https://ron.dev)", | ||
"license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"@babel/core": "^7.14.0", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-decorators": "^7.13.15", | ||
"@babel/plugin-transform-spread": "^7.13.0", | ||
"@babel/polyfill": "^7.12.1", | ||
"@babel/preset-env": "^7.14.1", | ||
"@babel/register": "^7.13.16", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"chai": "^4.3.4", | ||
"eslint": "^7.26.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-plugin-import": "^2.16.0", | ||
"mocha": "^8.4.0", | ||
"rollup": "^2.61.0", | ||
"rollup-plugin-eslint": "^5.1.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"source-map-support": "^0.5.19" | ||
}, | ||
"dependencies": { | ||
"@fleetbase/sdk": "1.2.1", | ||
"date-fns": "^2.22.1" | ||
} | ||
"name": "@fleetbase/storefront", | ||
"version": "1.1.6", | ||
"description": "Fleetbase Storefront JS & Node SDK", | ||
"main": "dist/cjs/storefront.js", | ||
"module": "dist/esm/storefront.js", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"scripts": { | ||
"prebuild": "npm run lint", | ||
"lint": "eslint src", | ||
"lint:fix": "eslint src --fix", | ||
"lint:tests": "eslint tests", | ||
"bundle": "rollup -c", | ||
"dev": "rollup -c -w", | ||
"test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/**/*.test.js", | ||
"prepare": "husky install", | ||
"format": "prettier . --write" | ||
}, | ||
"lint-staged": { | ||
"**/*": "prettier --write --ignore-unknown" | ||
}, | ||
"keywords": [ | ||
"fleetbase", | ||
"ecommerce", | ||
"api", | ||
"ondemand", | ||
"ecommerce", | ||
"last", | ||
"mile", | ||
"delivery", | ||
"logistics", | ||
"ecommerce", | ||
"app" | ||
], | ||
"author": "Ronald A. Richardson <[email protected]> (https://ron.dev)", | ||
"license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"@babel/core": "^7.23.6", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/plugin-proposal-decorators": "^7.23.6", | ||
"@babel/plugin-transform-spread": "^7.23.3", | ||
"@babel/polyfill": "^7.12.1", | ||
"@babel/preset-env": "^7.23.6", | ||
"@babel/register": "^7.22.15", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"chai": "^4.3.10", | ||
"eslint": "^8.56.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^15.2.0", | ||
"mocha": "^10.2.0", | ||
"prettier": "3.1.1", | ||
"rollup": "^4.9.1", | ||
"rollup-plugin-eslint": "^7.0.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"source-map-support": "^0.5.21", | ||
"typescript": "^5.3.3" | ||
}, | ||
"dependencies": { | ||
"@fleetbase/sdk": "1.2.7", | ||
"date-fns": "^3.0.5" | ||
} | ||
} |
Oops, something went wrong.