mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +00:00
feat: migrate to esm
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('./lib/cli.js')
|
||||
import './lib/cli.js';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@openstapps/projectmanagement",
|
||||
"description": "Main documentation and scripts for maintenance.",
|
||||
"version": "2.1.0",
|
||||
"type": "module",
|
||||
"license": "GPL-3.0-only",
|
||||
"repository": "git@gitlab.com:openstapps/projectmanagement.git",
|
||||
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
||||
@@ -67,8 +68,8 @@
|
||||
"prettier": "2.8.3",
|
||||
"rimraf": "4.4.0",
|
||||
"ts-node": "10.9.1",
|
||||
"typedoc": "0.22.18",
|
||||
"typescript": "4.4.4"
|
||||
"typedoc": "0.23.26",
|
||||
"typescript": "4.8.4"
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
*/
|
||||
import {Api} from '@openstapps/gitlab-api';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level';
|
||||
import {Colorize} from '@openstapps/logger/lib/transformations/colorize';
|
||||
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level.js';
|
||||
import {Colorize} from '@openstapps/logger/lib/transformations/colorize.js';
|
||||
import {Command} from 'commander';
|
||||
import {existsSync, readFileSync} from 'fs';
|
||||
import path from 'path';
|
||||
import {cwd, stdout} from 'process';
|
||||
import {GITLAB_API_URL} from './configuration';
|
||||
import {getUsedVersionMajorMinor} from './tasks/get-used-version';
|
||||
import {remind} from './tasks/remind';
|
||||
import {tidy} from './tasks/tidy';
|
||||
import {unlabel} from './tasks/unlabel';
|
||||
import {GITLAB_API_URL} from './configuration.js';
|
||||
import {getUsedVersionMajorMinor} from './tasks/get-used-version.js';
|
||||
import {remind} from './tasks/remind.js';
|
||||
import {tidy} from './tasks/tidy.js';
|
||||
import {unlabel} from './tasks/unlabel.js';
|
||||
|
||||
// add default handler for unhandled rejections
|
||||
process.on('unhandledRejection', async reason => {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Api} from '@openstapps/gitlab-api';
|
||||
import {Project} from '@openstapps/gitlab-api/lib/types';
|
||||
import {Project} from '@openstapps/gitlab-api/lib/types.js';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Label} from '@openstapps/gitlab-api/lib/types';
|
||||
import {Label} from '@openstapps/gitlab-api/lib/types.js';
|
||||
import setHours from 'date-fns/setHours';
|
||||
import nextThursday from 'date-fns/nextThursday';
|
||||
import previousThursday from 'date-fns/previousThursday';
|
||||
|
||||
@@ -20,10 +20,10 @@ import {
|
||||
MergeRequestState,
|
||||
Scope,
|
||||
User,
|
||||
} from '@openstapps/gitlab-api/lib/types';
|
||||
} from '@openstapps/gitlab-api/lib/types.js';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {WebClient} from '@slack/web-api';
|
||||
import {GROUPS, MAX_DEPTH_FOR_REMINDER, NOTE_PREFIX, SLACK_CHANNEL} from '../configuration';
|
||||
import {GROUPS, MAX_DEPTH_FOR_REMINDER, NOTE_PREFIX, SLACK_CHANNEL} from '../configuration.js';
|
||||
|
||||
/**
|
||||
* Remind people of open merge requests
|
||||
|
||||
@@ -20,13 +20,13 @@ import {
|
||||
MergeRequestState,
|
||||
Project,
|
||||
User,
|
||||
} from '@openstapps/gitlab-api/lib/types';
|
||||
} from '@openstapps/gitlab-api/lib/types.js';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {render} from 'mustache';
|
||||
import mustache from 'mustache';
|
||||
import path from 'path';
|
||||
import {cwd} from 'process';
|
||||
import {getProjects} from '../common';
|
||||
import {BOLD_LABELS, GROUPS, LABEL_WEIGHTS, NEXT_MEETING} from '../configuration';
|
||||
import {getProjects} from '../common.js';
|
||||
import {BOLD_LABELS, GROUPS, LABEL_WEIGHTS, NEXT_MEETING} from '../configuration.js';
|
||||
import differenceInWeeks from 'date-fns/differenceInWeeks';
|
||||
import formatISO from 'date-fns/formatISO';
|
||||
import format from 'date-fns/format';
|
||||
@@ -446,7 +446,7 @@ export async function generateReport(api: Api, label: string, template: string):
|
||||
timestamp: format(Date.now(), 'PPPPpp', {locale: de}),
|
||||
};
|
||||
|
||||
return render(template, structureForTemplate);
|
||||
return mustache.render(template, structureForTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,9 +21,9 @@ import {
|
||||
Milestone,
|
||||
Project,
|
||||
Scope,
|
||||
} from '@openstapps/gitlab-api/lib/types';
|
||||
} from '@openstapps/gitlab-api/lib/types.js';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {getProjects} from '../common';
|
||||
import {getProjects} from '../common.js';
|
||||
import {
|
||||
GROUPS,
|
||||
NEEDED_LABELS,
|
||||
@@ -31,7 +31,7 @@ import {
|
||||
NOTE_PREFIX,
|
||||
PROTECTED_BRANCHES,
|
||||
SCHOOLS,
|
||||
} from '../configuration';
|
||||
} from '../configuration.js';
|
||||
|
||||
/**
|
||||
* Tidy issues without milestone
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Api} from '@openstapps/gitlab-api';
|
||||
import {IssueState, Scope} from '@openstapps/gitlab-api/lib/types';
|
||||
import {IssueState, Scope} from '@openstapps/gitlab-api/lib/types.js';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {GROUPS, LAST_MEETING, NOTE_PREFIX} from '../configuration';
|
||||
import {GROUPS, LAST_MEETING, NOTE_PREFIX} from '../configuration.js';
|
||||
import isBefore from 'date-fns/isBefore';
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import {execSync} from 'child_process';
|
||||
import {suite, test} from '@testdeck/mocha';
|
||||
import {join} from 'path';
|
||||
import {dirSync} from 'tmp';
|
||||
import {getUsedVersion, getUsedVersionMajorMinor} from '../src/tasks/get-used-version';
|
||||
import {getUsedVersion, getUsedVersionMajorMinor} from '../src/tasks/get-used-version.js';
|
||||
|
||||
chai.use(chaiAsPromised);
|
||||
chai.should();
|
||||
|
||||
Reference in New Issue
Block a user