Skip to content

Export CJS files #3

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

Merged
merged 6 commits into from
Oct 24, 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
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": ["bloq", "prettier"],
"ignorePatterns": ["src-cjs"],
"overrides": [
{
"extends": ["bloq/markdown"],
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/publish-to-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish to NPM

author: Gabriel Montes

description: Sets up Node, runs the prepublishOnly script and publishes the package to the NPM registry

inputs:
token:
description: The NPM access token to use when publishing
required: true

runs:
using: composite
steps:
- uses: hemilabs/actions/setup-node-env@main
- run: npm run --if-present prepublishOnly
shell: bash
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ inputs.token }}

branding:
color: blue
icon: package
10 changes: 1 addition & 9 deletions .github/workflows/js-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,4 @@ concurrency:

jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: npm ci
- run: npm run format:check
- run: npm run lint
uses: hemilabs/actions/.github/workflows/js-checks.yml@main
6 changes: 1 addition & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: npm ci
- uses: JS-DevTools/npm-publish@v3
- uses: ./.github/actions/publish-to-npm
with:
token: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.eslintcache
.vscode
node_modules
src-cjs
6 changes: 6 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"@babel/plugin-transform-modules-commonjs",
"babel-plugin-add-module-exports"
]
}
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const formatFiles = "prettier --ignore-unknown --write";
const lintFiles = "eslint --cache --fix --quiet";
const sortPackageJsonFiles = "node bin/cli.js";
const sortPackageJsonFiles = "better-sort-package-json";

const config = {
"!(*.{js,md}|package.json)": [formatFiles],
Expand Down
Loading