Skip to content

Commit

Permalink
Profiler refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Machy8 committed Nov 21, 2021
1 parent 4ee0a26 commit 20db976
Show file tree
Hide file tree
Showing 51 changed files with 2,619 additions and 1,107 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ rules:
line-comment-position: [error, {position: above, applyDefaultIgnorePatterns: false}]
lines-around-comment: [warn, {beforeBlockComment: true}]
max-depth: [error]
max-len: [error, 120]
max-len: [error, 120, {ignoreTemplateLiterals: true, ignoreRegExpLiterals: true, ignoreUrls: true}]
max-nested-callbacks: [error, 4]
new-cap: [error]
no-array-constructor: [error]
Expand All @@ -102,7 +102,6 @@ rules:
switch-colon-spacing: [error]
unicode-bom: [error]
wrap-regex: [error]
sort-imports: [error]

# Typescript
'@typescript-eslint/no-explicit-any': off
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: yarn eslint:check

- name: Jest tests
run: yarn jest:test
run: yarn jest:test+coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down
22 changes: 3 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,20 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stylify!</title>
<style>
[s-cloak] {
.s-cloak {
visibility: hidden;
content-visibility: hidden;
}
</style>
</head>
<body>

<template>
<button class="button"></button>
<div class="container"></div>
<h1 class="title"></h1>
</template>
<script>
let matched;
let content = document.querySelector('template').innerHTML
const regExp = new RegExp('"[^"]+"|\'[^\']+\'|`[^`]`', 'g');
while((matched = regExp.exec(content))) {
content = content.replace(matched[0], matched[0].replace('button', 'fuu'));
}
console.log(content);
</script>
<!-- <script type="module">
<script type="module">
import { Runtime, nativePreset } from './packages/stylify/esm/index.js';
import { Profiler } from './packages/profiler/esm/index.js'

new Profiler();
nativePreset.dev = true;
new Runtime(nativePreset);
</script> -->
</script>
</body>
</html>
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"bootstrap": "lerna bootstrap --force-local",
"rollup:run": "node --max-old-space-size=8192 --experimental-modules node_modules/.bin/rollup --configPlugin typescript={exclude:[\\'packages/**\\']}",
"watch": "yarn build -w && yarn",
"build": "yarn types && yarn rollup:run -c scripts/build.ts",
"build": "yarn rollup:run -c scripts/build.ts",
"types": "ts-node scripts/types.ts",
"autoprefixer:build": "packages=autoprefixer yarn build",
"autoprefixer:watch": "packages=autoprefixer yarn watch",
Expand All @@ -32,7 +32,8 @@
"profiler:watch": "packages=profiler yarn watch",
"eslint:check": "eslint packages/**/src/**/*.{js,ts}",
"eslint:fix": "yarn eslint:check --fix",
"jest:test": "jest --clearCache && jest --maxWorkers 1"
"jest:test": "jest --clearCache && jest --maxWorkers 1",
"jest:test+coverage": "jest --collect-coverage --coverageProvider=v8"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 20db976

Please sign in to comment.