Skip to content

Commit

Permalink
Fix #63 Extend guillotine
Browse files Browse the repository at this point in the history
  • Loading branch information
ComLock committed Feb 28, 2024
1 parent 79d81e2 commit f50e7bf
Show file tree
Hide file tree
Showing 26 changed files with 5,636 additions and 1,203 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Coverage

on: [ push ]

jobs:

build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Test
run: npm test

- uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/coverage/
/node_modules/

### OSX ###
Expand Down
32 changes: 18 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
plugins {
id 'maven-publish'
id 'com.enonic.defaults' version '2.1.5'
id 'com.enonic.xp.app' version '3.4.0'
id 'maven-publish'
id 'com.enonic.defaults' version '2.1.5'
id 'com.enonic.xp.app' version '3.4.0'
id 'com.github.node-gradle.node' version '7.0.1'
}

app {
name = project.appName
displayName = 'Sitemap XML'
vendorName = 'Enonic AS'
vendorUrl = 'https://enonic.com'
systemVersion = "${xpVersion}"
name = project.appName
displayName = 'Sitemap XML'
vendorName = 'Enonic AS'
vendorUrl = 'https://enonic.com'
systemVersion = "${xpVersion}"
}

dependencies {
include "com.enonic.xp:lib-context:${xpVersion}"
include "com.enonic.xp:lib-content:${xpVersion}"
include "com.enonic.xp:lib-context:${xpVersion}"
include "com.enonic.xp:lib-content:${xpVersion}"
include "com.enonic.xp:lib-portal:${xpVersion}"

include 'com.enonic.lib:lib-cache:2.2.0'
include "com.enonic.lib:lib-xslt:2.1.1"
}

repositories {
mavenLocal()
mavenCentral()
xp.enonicRepo()
mavenLocal()
mavenCentral()
xp.enonicRepo()
}

node {
Expand Down Expand Up @@ -87,5 +91,5 @@ tasks.register('npmTest', NpmTask) {
// If you ALWAYS want to SKIP `test` and `check` tasks on development build, wrap this inside an 'if...'
// if (!(project.hasProperty('dev') || project.hasProperty('development'))) {
check.dependsOn npmCheck
// test.dependsOn npmTest
test.dependsOn npmTest
// }
33 changes: 33 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export default {
collectCoverageFrom: [
'src/main/resources/**/*.{ts,tsx}',
// '!src/**/*.d.ts',
],
coverageProvider: 'v8',
globals: {
app: {
name: 'com.enonic.app.sitemapxml',
config: {}
}
},
moduleNameMapper: {
'/guillotine/(.*)': '<rootDir>/src/main/resources/guillotine/$1',
'/lib/app-sitemapxml/(.*)': '<rootDir>/src/main/resources/lib/app-sitemapxml/$1',
},
preset: 'ts-jest/presets/js-with-babel-legacy',
testEnvironment: 'node',
testMatch: [
'<rootDir>/test/**/*.(spec|test).{ts,tsx}'
],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
}
]
},
transformIgnorePatterns: [
'/node_modules/(?!(@enonic-types/guillotine)/)'
],
}
Loading

0 comments on commit f50e7bf

Please sign in to comment.