Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "npm"
directories:
- "/"
- "test-project/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
30 changes: 30 additions & 0 deletions .github/linters/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import js from '@eslint/js'
import globals from 'globals'

export default [
{
ignores: ['node_modules/**']
},
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.jest,

// Dataform-specific globals
publish: 'readonly',
constant: 'readonly',
ctx: 'readonly',
}
},
rules: {
// Basic formatting rules
'indent': ['error', 2],
'quotes': ['error', 'single'],
'semi': ['error', 'never']
}
}
]
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
pull_request:
branches:
- 'main'

jobs:
lint-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run tests
run: npm test
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Package

on:
push:
tags:
- 'v*'

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run tests
run: npm test

- name: Publish to npm
run: npm publish
125 changes: 0 additions & 125 deletions examples.js

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getActionName(ctx) {
// Fallback: construct from proto target
if (ctx?.operation?.proto?.target) {
const target = ctx.operation.proto.target
return target ? `${target.database}.${target.name}` : null
return target ? `${target.database}.${target.schema}.${target.name}` : null
}

return null
Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
module.exports = {
testEnvironment: 'node',
collectCoverage: true,
collectCoverageFrom: [
'index.js'
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
coverageReporters: ['text'],
testMatch: [
'**/test/**/*.test.js'
]
Expand Down
Loading