Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

fix(deps): upgrade to node v18.14.2 + setup semantic-release on CI #153

Merged
merged 7 commits into from
Mar 2, 2023
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
32 changes: 23 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"

strategy:
matrix:
node-version: [10.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version-file: '.nvmrc'
cache: 'npm'
- name: install deps
run: npm ci
env:
Expand All @@ -33,3 +28,22 @@ jobs:
- run: npm run lint
env:
CI: true
release:
needs:
- build
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# to prevent "You're not authorized to push to this branch"
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm install --prefer-offline --no-audit
- run: npx semantic-release
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.5.0
v18.14.2
42 changes: 21 additions & 21 deletions dist/next-step-for-trello.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const getFirstResult = (fct) => function () {
// inject code into the page's context (unrestricted)
function injectJs (jsString, options) {
options = options || {}
var scr = document.createElement('script')
const scr = document.createElement('script')
scr.id = options.id
scr.textContent = jsString;
// (appending text to a function to convert it's src to string only works in Chrome)
Expand Down Expand Up @@ -221,14 +221,14 @@ const MODES = [
// app state

const userPrefs = new UserPrefs('aj-nextstep-json')
var analytics = new Analytics('UA-1858235-21')
var currentMode = userPrefs.getValue('defaultMode', 1)
var needsRefresh = true // true = all, or { cardUrls }
var refreshing = false
var token // needed by onCheckItem, populated by getToken()
var initialized = false // populated by init()
var watching = false // populated by watchForChanges()
var announcement
const analytics = new Analytics('UA-1858235-21')
let currentMode = userPrefs.getValue('defaultMode', 1)
let needsRefresh = true // true = all, or { cardUrls }
let refreshing = false
let token // needed by onCheckItem, populated by getToken()
let initialized = false // populated by init()
let watching = false // populated by watchForChanges()
let announcement

function showCompleted () {
return MODES[currentMode].showCompleted
Expand All @@ -241,7 +241,7 @@ function setMode (modeIndex) {
analytics.trackEvent(MODES[currentMode].label, 'click')
}

var MENU_ITEMS = MODES.map((mode, i) => {
const MENU_ITEMS = MODES.map((mode, i) => {
return Object.assign(mode, {
modeIndex: i,
onClick: () => setMode(i)
Expand Down Expand Up @@ -290,12 +290,12 @@ function toggleLoadingUI (state) {
}

function initToolbarButton () {
var btn = document.createElement('a')
const btn = document.createElement('a')
btn.href = 'http://adrienjoly.com/chrome-next-step-for-trello'
btn.title = 'Click to toggle display of next task(s)'
btn.id = 'aj-nextstep-btn'
btn.className = 'board-header-btn board-header-btn-without-icon'
var iconUrl = getAssetURL('icon.png')
const iconUrl = getAssetURL('icon.png')
btn.innerHTML = '<span class="board-header-btn-text">' +
'<div id="aj-nextstep-loading" class="uil-reload-css"><div></div></div>' +
'<img class="aj-nextstep-icon" src="' + iconUrl + '" />' +
Expand Down Expand Up @@ -468,7 +468,7 @@ const renderMarkdownPlaceholders = (text, placeholders) =>
function renderMarkdown (text) {
// Code and links should not have Markdown formatting applied. So remove
// them from the text and replace with placeholders for now.
var placeholders = getMarkdownPlaceholders(text)
const placeholders = getMarkdownPlaceholders(text)
text = replaceMarkdownWithPlaceholders(text, placeholders)
// Apply markdown rendering to the remaining text
text = renderMarkdownSymbols(text)
Expand Down Expand Up @@ -499,14 +499,14 @@ function onCheckItem (evt) {
return
}
// let's check that item
var item = evt.currentTarget.parentNode
const item = evt.currentTarget.parentNode
item.classList.add('aj-checking')
item.style.height = item.offsetHeight + 'px'
// let's tell trello
var path = 'cards/' + item.getAttribute('data-card-id') +
const path = 'cards/' + item.getAttribute('data-card-id') +
'/checklist/' + item.getAttribute('data-checklist-id') +
'/checkItem/' + item.getAttribute('data-item-id')
var urlEncodedData = 'state=complete&token=' + token.trim()
const urlEncodedData = 'state=complete&token=' + token.trim()
fetchFromTrello(path, {
method: 'PUT',
headers: {
Expand Down Expand Up @@ -534,8 +534,8 @@ const getCardUrlFromTitleElement = (cardTitleElement) => {
}

function setCardContent (cardTitleElement, items) {
var cardElement = cardTitleElement.parentNode
var taskList = cardElement.getElementsByClassName('aj-task-list')[0]
const cardElement = cardTitleElement.parentNode
let taskList = cardElement.getElementsByClassName('aj-task-list')[0]
// if task list div does not exist => create it
if (!taskList) {
taskList = document.createElement('div')
Expand All @@ -548,8 +548,8 @@ function setCardContent (cardTitleElement, items) {
.map((item) => Object.assign(item, { cardUrl: getCardUrlFromTitleElement(cardTitleElement) }))
.map(renderItem).join('\n')
// attach click handlers on checkboxes
var checkboxes = taskList.getElementsByClassName('aj-checkbox-tick')
for (var i = 0; i < checkboxes.length; ++i) {
const checkboxes = taskList.getElementsByClassName('aj-checkbox-tick')
for (let i = 0; i < checkboxes.length; ++i) {
checkboxes[i].addEventListener('click', onCheckItem)
}
}
Expand Down Expand Up @@ -590,7 +590,7 @@ function updateCards (toRefresh) {
const isToolbarInstalled = () => document.getElementById('aj-nextstep-mode')

function installToolbar () {
var headerElements = document.getElementsByClassName('board-header-btns')
const headerElements = document.getElementsByClassName('board-header-btns')
if (headerElements.length) {
const btn = initToolbarButton() // creates #aj-nextstep-mode
headerElements[0].appendChild(btn)
Expand Down
Loading