Skip to content

Commit f3a4692

Browse files
committed
feat: First checkin
0 parents  commit f3a4692

21 files changed

+6161
-0
lines changed

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint"],
5+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"]
6+
}

.gitignore

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
index.js
2+
index.js.map
3+
index.d.ts
4+
lib/**/*.d.ts
5+
lib/**/*.js
6+
lib/**/*.js.map
7+
test/**/*.js
8+
test/**/*.d.ts
9+
test/**/*.js.map
10+
.tscache
11+
# Created by .ignore support plugin (hsz.mobi)
12+
### Eclipse template
13+
14+
.metadata
15+
bin/
16+
tmp/
17+
*.tmp
18+
*.bak
19+
*.swp
20+
*~.nib
21+
local.properties
22+
.settings/
23+
.loadpath
24+
.recommenders
25+
26+
# External tool builders
27+
.externalToolBuilders/
28+
29+
# Locally stored "Eclipse launch configurations"
30+
*.launch
31+
32+
# PyDev specific (Python IDE for Eclipse)
33+
*.pydevproject
34+
35+
# CDT-specific (C/C++ Development Tooling)
36+
.cproject
37+
38+
# Java annotation processor (APT)
39+
.factorypath
40+
41+
# PDT-specific (PHP Development Tools)
42+
.buildpath
43+
44+
# sbteclipse plugin
45+
.target
46+
47+
# Tern plugin
48+
.tern-project
49+
50+
# TeXlipse plugin
51+
.texlipse
52+
53+
# STS (Spring Tool Suite)
54+
.springBeans
55+
56+
# Code Recommenders
57+
.recommenders/
58+
59+
# Scala IDE specific (Scala & Java development for Eclipse)
60+
.cache-main
61+
.scala_dependencies
62+
.worksheet
63+
### VisualStudioCode template
64+
.vscode/*
65+
!.vscode/settings.json
66+
!.vscode/tasks.json
67+
!.vscode/launch.json
68+
!.vscode/extensions.json
69+
### JetBrains template
70+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
71+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
72+
73+
# User-specific stuff:
74+
.idea/**/workspace.xml
75+
.idea/**/tasks.xml
76+
.idea/dictionaries
77+
78+
# Sensitive or high-churn files:
79+
.idea/**/dataSources/
80+
.idea/**/dataSources.ids
81+
.idea/**/dataSources.xml
82+
.idea/**/dataSources.local.xml
83+
.idea/**/sqlDataSources.xml
84+
.idea/**/dynamic.xml
85+
.idea/**/uiDesigner.xml
86+
87+
# Gradle:
88+
.idea/**/gradle.xml
89+
.idea/**/libraries
90+
91+
# CMake
92+
cmake-build-debug/
93+
94+
# Mongo Explorer plugin:
95+
.idea/**/mongoSettings.xml
96+
97+
## File-based project format:
98+
*.iws
99+
100+
## Plugin-specific files:
101+
102+
# IntelliJ
103+
out/
104+
105+
# mpeltonen/sbt-idea plugin
106+
.idea_modules/
107+
108+
# JIRA plugin
109+
atlassian-ide-plugin.xml
110+
111+
# Cursive Clojure plugin
112+
.idea/replstate.xml
113+
114+
# Crashlytics plugin (for Android Studio and IntelliJ)
115+
com_crashlytics_export_strings.xml
116+
crashlytics.properties
117+
crashlytics-build.properties
118+
fabric.properties
119+
### Jetbrains Missing template
120+
.idea
121+
.iml### Node template
122+
# Logs
123+
logs
124+
*.log
125+
npm-debug.log*
126+
yarn-debug.log*
127+
yarn-error.log*
128+
129+
# Runtime data
130+
pids
131+
*.pid
132+
*.seed
133+
*.pid.lock
134+
135+
# Directory for instrumented libs generated by jscoverage/JSCover
136+
lib-cov
137+
138+
# Coverage directory used by tools like istanbul
139+
coverage
140+
141+
# nyc test coverage
142+
.nyc_output
143+
144+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
145+
.grunt
146+
147+
# Bower dependency directory (https://bower.io/)
148+
bower_components
149+
150+
# node-waf configuration
151+
.lock-wscript
152+
153+
# Compiled binary addons (https://nodejs.org/api/addons.html)
154+
build/Release
155+
156+
# Dependency directories
157+
node_modules/
158+
jspm_packages/
159+
160+
# Typescript v1 declaration files
161+
typings/
162+
163+
# Optional npm cache directory
164+
.npm
165+
166+
# Optional eslint cache
167+
.eslintcache
168+
169+
# Optional REPL history
170+
.node_repl_history
171+
172+
# Output of 'npm pack'
173+
*.tgz
174+
175+
# Yarn Integrity file
176+
.yarn-integrity
177+
178+
# dotenv environment variables file
179+
.env
180+
181+

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock.json

.prettierrc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tabWidth: 2
2+
semi: false
3+
printWidth: 140
4+
singleQuote: true

Gruntfile.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
module.exports = function (grunt) {
2+
grunt.initConfig({
3+
eslint: {
4+
files: {
5+
src: ['index.ts', 'lib/**/*.ts', 'test/**/*.ts', '!index.d.ts', '!lib/**/*.d.ts', '!test/**/*.d.ts'],
6+
},
7+
},
8+
clean: {
9+
coverage: ['test/coverage'],
10+
},
11+
ts: {
12+
default: {
13+
tsconfig: true,
14+
},
15+
},
16+
copy: {
17+
test: {
18+
files: {
19+
'test/coverage/instrument/': 'test/**/*.js',
20+
},
21+
options: {
22+
expand: true,
23+
},
24+
},
25+
},
26+
instrument: {
27+
files: ['index.js', 'lib/**/*.js'],
28+
options: {
29+
lazy: true,
30+
basePath: 'test/coverage/instrument/',
31+
},
32+
},
33+
mochaTest: {
34+
test: {
35+
options: {
36+
reporter: 'spec',
37+
quiet: false,
38+
},
39+
src: ['test/coverage/instrument/test/**/*.js'],
40+
},
41+
},
42+
storeCoverage: {
43+
options: {
44+
dir: 'test/coverage/reports',
45+
},
46+
},
47+
remapIstanbul: {
48+
build: {
49+
src: 'test/coverage/reports/coverage.json',
50+
options: {
51+
reports: {
52+
json: 'test/coverage/reports/coverage-mapped.json',
53+
},
54+
},
55+
},
56+
},
57+
makeReport: {
58+
src: 'test/coverage/reports/coverage-mapped.json',
59+
options: {
60+
type: 'lcov',
61+
dir: 'test/coverage/reports',
62+
print: 'detail',
63+
},
64+
},
65+
})
66+
67+
grunt.loadNpmTasks('grunt-ts')
68+
grunt.loadNpmTasks('grunt-eslint')
69+
grunt.loadNpmTasks('grunt-mocha-test')
70+
grunt.loadNpmTasks('grunt-istanbul')
71+
grunt.loadNpmTasks('remap-istanbul')
72+
grunt.loadNpmTasks('grunt-contrib-clean')
73+
grunt.loadNpmTasks('grunt-contrib-copy')
74+
75+
grunt.registerTask('build', ['eslint', 'ts'])
76+
77+
grunt.registerTask('default', ['build'])
78+
79+
grunt.registerTask('test', [
80+
'build',
81+
'clean:coverage',
82+
'copy:test',
83+
'instrument',
84+
'mochaTest:test',
85+
'storeCoverage',
86+
'remapIstanbul',
87+
'makeReport',
88+
])
89+
90+
grunt.registerTask('release', ['test'])
91+
}

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# confluence-outdated - Constant validation of Confluence document outdates
2+
3+
## Introduction
4+
5+
Tell something about your typescript module.
6+
7+
## Building
8+
9+
To test and build this package, simply use grunt:
10+
11+
grunt test

index.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @module confluence-outdated
3+
*/
4+
/**
5+
*/
6+
7+
// import needed modules
8+
9+
import * as loglevel from 'loglevel'
10+
import Bluebird = require('bluebird')
11+
12+
/**
13+
* confluence-outdated - Constant validation of Confluence document outdates
14+
*/
15+
export class ExampleClass {
16+
/**
17+
* Use a logger instance to log, what you're doing
18+
*/
19+
private _log: loglevel.Logger = null
20+
21+
constructor() {
22+
this._log = loglevel.getLogger('confluence-outdated:ExampleClass')
23+
}
24+
25+
/**
26+
* Be nice.
27+
* @param {string} name Who are you?
28+
* @return {Bluebird<string>} My greets to you
29+
*/
30+
public helloWorld(name: string): Bluebird<string> {
31+
if (name === '') {
32+
return Bluebird.reject(new Error('Found nobody to greet'))
33+
}
34+
return Bluebird.resolve(`Hello ${name}`)
35+
}
36+
}

lib/api/check.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* A description of a check
3+
*/
4+
export interface Check {
5+
/**
6+
* A list of labels that the document must have
7+
*/
8+
labels: Array<string>
9+
10+
/**
11+
* The maximum age of the document
12+
*/
13+
maxAge: number
14+
}
15+
16+
/**
17+
* An implementation of the check interface
18+
*/
19+
export class Check implements Check {
20+
public labels: Array<string>
21+
public maxAge: number
22+
23+
constructor(labels: Array<string>, maxAge: number) {
24+
this.labels = labels
25+
this.maxAge = maxAge
26+
}
27+
}

0 commit comments

Comments
 (0)