Skip to content

Commit

Permalink
Switch to Class-based as main implementation (#13)
Browse files Browse the repository at this point in the history
Switch to `Class-based` as main implementation
  • Loading branch information
EmptyWork authored Aug 9, 2023
2 parents ef14b81 + ef2a551 commit 595db70
Show file tree
Hide file tree
Showing 19 changed files with 5,500 additions and 630 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"env": {
"test": {
"plugins": ["@babel/plugin-transform-modules-commonjs"]
}
}
}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Jest Test

on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [main]
workflow_dispatch:

jobs:
install:
name: Install and Test

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Install
run: npm ci

- name: Test with Jest
run: npm test
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
node_modules/

/out/
/src/urlList.js
/legacy/src/urlList.js
/src/urlList.class.js

.gitlog

test.js
test.js
performance.js
4 changes: 1 addition & 3 deletions index.class.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { existsSync, copyFileSync } from 'fs'
import ThesisLighthouse from './src/lib/application.class.js'
if (!existsSync('./src/urlList.class.js')) copyFileSync('./src/urlList.class.example', './src/urlList.class.js')
import Config from "./src/urlList.class.js"

const app = new ThesisLighthouse(Config)
const app = new ThesisLighthouse(Config).start()
4 changes: 2 additions & 2 deletions index.js → legacy/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { series } from 'async'
import { exec } from 'child_process'
import { readFileSync, writeFileSync, existsSync, mkdirSync, copyFileSync } from 'fs'
if (!existsSync('./src/urlList.js')) copyFileSync('./src/urlList.example', './src/urlList.js')
if (!existsSync('./legacy/src/urlList.js')) copyFileSync('./legacy/src/urlList.example', './legacy/src/urlList.js')
import { urlList, options, execOptions } from './src/urlList.js'
import { makeCommandFromURL } from './src/lib/commandHandlers.js'
import { getCategoriesFromCategoriesFlags, getCurrentCategories } from './src/lib/categoriesHandlers.js'
Expand Down Expand Up @@ -70,7 +70,7 @@ const main = (urlList, options) => {
const isOptionsCategories = getCategoriesFlags(options?.categories)
const currentFlags = `${isOptionsCategories}--output json --disable-full-page-screenshot --chrome-flags="--no-sandbox --headless --disable-gpu"`

console.log(`TLighthouse ${process.env.npm_package_version} - Thesis Example Code`)
console.log(`[Legacy] TLighthouse ${process.env.npm_package_version} - Thesis Example Code`)
console.log(`Running with these Flags: ${currentFlags}\n`)

urlList.forEach((url, index) => { testURL(url, options) })
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 595db70

Please sign in to comment.