Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update low impact npm pkgs #322

Merged
merged 1 commit into from
Mar 5, 2022
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
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
echo "DOCKER_TAG=$(echo ${GITHUB_REPOSITORY#*/}):$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.3.0
uses: docker/setup-buildx-action@v1.6.0
with:
install: true
- name: Cache Docker layers
Expand All @@ -24,13 +24,13 @@ jobs:
key: ${{runner.os}}-buildx-${{github.sha}}
restore-keys: ${{runner.os}}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v1.9.0
uses: docker/login-action@v1.14.1
with:
registry: ${{env.REGISTRY}}
username: ${{env.REPO_OWNER}}
password: ${{secrets.CR_PAT}}
- name: Build and push
uses: docker/build-push-action@v2.4.0
uses: docker/build-push-action@v2.9.0
with:
context: .
file: ./Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:15.4
FROM node:16.14

RUN apt-get update && \
apt-get install -y lsof vim libgtk-3-0 libatk1.0-0 libx11-xcb1 libnss3 libxss1 libasound2
apt-get install -y lsof vim libgtk-3-0 libatk1.0-0 libx11-xcb1 libnss3 libxss1 libasound2 libdrm2 libgbm-dev

WORKDIR /code/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import hbs from 'htmlbars-inline-precompile';
import { setupRenderingTest } from '../../../../tests/helpers';

module('Integration | Component | welcome-page', function (hooks) {
Expand Down
2 changes: 1 addition & 1 deletion lib/builders/build-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function(buildConfig={
};

if (!cliArguments.testing) {
await fs.rmdir(`${projectRoot}/tmp`, { recursive: true });
await fs.rm(`${projectRoot}/tmp`, { recursive: true, force: true });
}

await fs.mkdir(`${projectRoot}/tmp/assets`, { recursive: true });
Expand Down
2 changes: 1 addition & 1 deletion lib/builders/build-dist-folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default function(buildConfig={

function resetDistFolder(outputDirectory) {
return new Promise((resolve, reject) => {
fs.rmdir(outputDirectory, { recursive: true })
fs.rm(outputDirectory, { recursive: true, force: true })
.then(() => fs.mkdir(outputDirectory, { recursive: true }))
.then(() => fs.mkdir(`${outputDirectory}/assets`, { recursive: true }))
.then(() => resolve())
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function removeIfExists(path, projectRoot) {

async function removeFolder(path, projectRoot) {
try {
await fs.rmdir(path);
await fs.rm(path, { recursive: true, force: true });

Console.log(chalk.red('deleted'), path.replace(`${projectRoot}/`, ''));
} catch {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function(defaults={
const projectRoot = await findProjectRoot();
const ENV = (await import(`${projectRoot}/config/environment.js`)).default(OPTIONS.environment);

await fs.rmdir(`${projectRoot}/tmp`, { recursive: true });
await fs.rm(`${projectRoot}/tmp`, { recursive: true, force: true });
await fs.mkdir(`${projectRoot}/tmp`);
await fs.mkdir(`${projectRoot}/tmp/assets`);

Expand Down
8 changes: 1 addition & 7 deletions lib/utils/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ export function spinner(text) {
process.stdout.cursorTo = () => {};
process.stdout.moveCursor = () => {};

const spinner = ora({ text: text, stream: process.stdout }).start();

spinner.isEnabled = true; // TODO: maybe take this out
spinner.color = 'green';
spinner.interval = 50;

return spinner;
return ora({ text: text, stream: process.stdout, isEnabled: true, color: 'green', interval: 50 }).start();
}

export default { spinner, log, error };
23 changes: 14 additions & 9 deletions lib/utils/recursive-file-lookup.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import klaw from 'klaw';
import through2 from 'through2';
import pathExists from './path-exists.js';

// NOTE: could be optimized by an in memory tree
export default function(directory, extensions, options={}) {
return new Promise((resolve) => {
const items = []; // NOTE: files, directories, symlinks, etc

klaw(directory, { depthLimit: options.depthLimit || -1 })
.pipe(through2.obj(function(item, enc, next) {
if (!item.stats.isDirectory() && shouldIncludeItem(item, extensions) && pipeFilter(options, item)) {
this.push(item);
}
pathExists(directory)
.then(() => {
klaw(directory, { depthLimit: options.depthLimit || -1 })
.pipe(through2.obj(function(item, enc, next) {
if (!item.stats.isDirectory() && shouldIncludeItem(item, extensions) && pipeFilter(options, item)) {
this.push(item);
}

next();
}))
.on('data', (item) => items.push(item.path))
.on('end', () => resolve(items));
next();
}))
.on('data', (item) => items.push(item.path))
.on('end', () => resolve(items));
})
.catch(() => resolve(items));
});
}

Expand Down
Loading