Skip to content

Commit

Permalink
Update dependencies and config
Browse files Browse the repository at this point in the history
  • Loading branch information
shgysk8zer0 committed Sep 19, 2024
1 parent 732df12 commit 52f382d
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 96 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.json

This file was deleted.

39 changes: 11 additions & 28 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,16 @@ on:
- master
- release/*
jobs:
npm-test:
name: NPM Install and Test
build:
name: Node CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
submodules: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Restore cache
uses: actions/cache@v4
# use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Run npm test
run: npm test --if-present
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# `cache: npm` seems to require a `package-lock.json` file
# cache: npm
- run: npm i
- run: npm run build --if-present
- run: npm test
63 changes: 48 additions & 15 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,33 @@ on:
branches:
- master
- release/*
paths-ignore:
- '**/*.js' # Disable since ESLint is used and v9 config is incompatible
- '**/*.mjs'
- '**/*.cjs'
- '**/*.min.js'

###############
# Set the Job #
###############
jobs:
build:
strategy:
fail-fast: false
# matrix:
# language:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write


##################
# Load all steps #
##################
Expand All @@ -43,36 +59,53 @@ jobs:
##########################
- name: Checkout Code
uses: actions/checkout@v4
with:
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: docker://github/super-linter:v4
uses: super-linter/super-linter@v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: master
VALIDATE_YAML: true
VALIDATE_JSON: true
# VALIDATE_XML: true
VALIDATE_MD: true
# DEFAULT_BRANCH: master
# DEFAULT_WORKSPACE:
# ANSIBLE_DIRECTORY:
# ACTIONS_RUNNER_DEBUG: true
VALIDATE_ALL_CODEBASE: false
IGNORE_GENERATED_FILES: true
IGNORE_GITIGNORED_FILES: true
SUPPRESS_POSSUM: true
LOG_LEVEL: ERROR
LINTER_RULES_PATH: './'
EDITORCONFIG_FILE_NAME: '.editorconfig'
# JAVASCRIPT_ES_CONFIG_FILE: 'eslint.config.js'
CSS_FILE_NAME: '.stylelintrc.json'

# Valate Languages - Uncomment to Enable
# JS/TS/JSON Disabled until ESLint in super-linter is updated
# VALIDATE_HTML: true
VALIDATE_CSS: true
# VALIDATE_JAVASCRIPT_ES: true
# VALIDATE_JAVASCRIPT_STANDARD: true
# VALIDATE_JSON: true
# VALIDATE_XML: true
VALIDATE_MARKDOWN: true
VALIDATE_YAML: true
# VALIDATE_TYPESCRIPT_ES: true
# VALIDATE_TYPESCRIPT_STANDARD: true
# VALIDATE_JSX: true
# VALIDATE_TSX: true
# VALIDATE_BASH: true
# VALIDATE_PERL: true
# VALIDATE_PHP_BUILTIN: true
# VALIDATE_PYTHON: true
# VALIDATE_RUBY: true
# VALIDATE_COFFEE: true
# VALIDATE_ANSIBLE: true
# VALIDATE_JAVASCRIPT_ES: true
# VALIDATE_JAVASCRIPT_STANDARD: true
# VALIDATE_TYPESCRIPT_ES: true
# VALIDATE_TYPESCRIPT_STANDARD: true
# VALIDATE_DOCKER: true
# VALIDATE_GO: true
# VALIDATE_TERRAFORM: true
# VALIDATE_CSS: true
# ANSIBLE_DIRECTORY:
# ACTIONS_RUNNER_DEBUG: true
# DEFAULT_WORKSPACE:
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.3.1
20.9.0
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.1.2] - 2024-09-19

### Changed
- Update dependencies and config

## [v0.1.1] - 2024-03-02

### Changed
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { ignoreFile } from '@shgysk8zer0/eslint-config/ignoreFile.js';
import browser from '@shgysk8zer0/eslint-config/browser.js';

export default [ignoreFile, browser()];
57 changes: 55 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aegisjsproject/styles",
"version": "0.1.1",
"version": "0.1.2",
"description": "Pre-made and reusable styles for `@aegisjsproject/core`",
"keywords": [
"aegis",
Expand Down Expand Up @@ -86,6 +86,7 @@
"homepage": "https://github.com/AegisJSProject/styles#readme",
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",
"@shgysk8zer0/eslint-config": "^1.0.1",
"eslint": "^9.10.0",
"http-server": "^14.1.1",
"rollup": "^4.9.6"
Expand Down
4 changes: 2 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
script-src 'self' https://unpkg.com/@shgysk8zer0/ https://unpkg.com/@aegisjsproject/ 'sha384-RT8/jXa3tV8Aauh9mL7PPogrsOeGCZNnM+GYKnXiACl8RUsAuyPtexdx/oXkKHDj';
style-src 'self' blob: data:;
connect-src https://icanhazdadjoke.com https://unpkg.com/@shgysk8zer0/ https://unpkg.com/@kernvalley/;
trusted-types empty#html empty#script sanitizer-raw#html default;
trusted-types empty#html empty#script aegis-sanitizer#html default;
require-trusted-types-for 'script';" />
<title>Aegis Styles Test</title>
<script type="importmap" integrity="sha384-RT8/jXa3tV8Aauh9mL7PPogrsOeGCZNnM+GYKnXiACl8RUsAuyPtexdx/oXkKHDj">
Expand All @@ -25,7 +25,7 @@
}
}
</script>
<script type="application/javascript" defer="" referrerpolicy="no-referrer" crossorigin="anonymous" integrity="sha384-Shkrmxly5RI9mCU8DQr6l4VLVJzjPzgx9KP/f5i7pEcl7ZUt0wHiAweGjbpjU2d5" src="https://unpkg.com/@shgysk8zer0/polyfills@0.3.1/all.min.js" fetchpriority="auto"></script>
<script type="application/javascript" defer="" referrerpolicy="no-referrer" crossorigin="anonymous" integrity="sha384-CP/nVh8lHR1uyEXUkbQ4YZijSR9xfxvXCVxsFVsWs1FjURa8jEqvpz0c3VL8Rw0e" src="https://unpkg.com/@shgysk8zer0/polyfills@0.4.3/all.min.js" fetchpriority="auto"></script>
<script type="application/javascript" defer="" referrerpolicy="no-referrer" crossorigin="anonymous" integrity="sha384-55L/wO9o0uIVTeubRIDQB4bewfNqyxrj4OXuxlW24NMEk+ioZwMHVw/tFV78mM+k" src="https://unpkg.com/@shgysk8zer0/kazoo@0.3.1/harden.js" fetchpriority="auto"></script>
<script type="module" referrerpolicy="no-referrer" src="./index.js"></script>
</head>
Expand Down
17 changes: 16 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { addStyles } from '@aegisjsproject/core';

addStyles(document, btn, reset, baseTheme, darkTheme, lightTheme);

document.getElementById('toggle').addEventListener('click', () => {
document.getElementById('toggle').addEventListener('click', async () => {
switch(document.documentElement.dataset.theme) {
case 'light':
document.documentElement.dataset.theme = 'dark';
Expand All @@ -18,4 +18,19 @@ document.getElementById('toggle').addEventListener('click', () => {
}

document.getElementById('cur').textContent = document.documentElement.dataset.theme;

await cookieStore.set({
name: 'theme',
value: document.documentElement.dataset.theme,
path: '/test/',
sameSite: 'strict',
secure: true,
});
});

cookieStore.get('theme').then(cookie => {
if (typeof cookie?.value === 'string') {
document.documentElement.dataset.theme = cookie.value;
document.getElementById('cur').textContent = document.documentElement.dataset.theme;
}
});

0 comments on commit 52f382d

Please sign in to comment.