Skip to content

Commit

Permalink
Merge pull request #256 from NullVoxPopuli/maintenance
Browse files Browse the repository at this point in the history
General Maintenance
  • Loading branch information
NullVoxPopuli authored Mar 25, 2023
2 parents f0e9489 + 1987b28 commit e603d1c
Show file tree
Hide file tree
Showing 45 changed files with 2,735 additions and 2,024 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "NullVoxPopuli/highlightjs-glimmer" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["hljs-glimmer-tests-cjs", "hljs-glimmer-tests-esm"]
}
5 changes: 5 additions & 0 deletions .changeset/selfish-books-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"highlightjs-glimmer": patch
---

Removed some unused code.
14 changes: 0 additions & 14 deletions .github/actions/pnpm/action.yml

This file was deleted.

77 changes: 46 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,42 @@ on:
schedule:
- cron: "0 3 * * 0" # every Sunday at 3am

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
CI: true
TURBO_API: http://127.0.0.1:9080
TURBO_TOKEN: this-is-not-a-secret
TURBO_TEAM: myself

jobs:
lint_source:
name: Lint Source
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: pnpm lint:js

commits:
name: Commit Messages
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: felixmosh/turborepo-gh-artifacts@v2
with:
fetch-depth: 0

- uses: volta-cli/action@v4
- uses: wagoid/commitlint-github-action@v5.3.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: NullVoxPopuli/action-setup-pnpm@v1.1.0

lint:
name: Lint Source
runs-on: ubuntu-latest
needs: [install_dependencies]
steps:
- uses: actions/checkout@v3
- uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: NullVoxPopuli/action-setup-pnpm@v1.1.0
- run: pnpm lint

esm_tests:
name: ESM Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [install_dependencies]
strategy:
matrix:
node:
Expand All @@ -45,12 +53,10 @@ jobs:
- "18"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: actions/setup-node@v3
- uses: felixmosh/turborepo-gh-artifacts@v2
with:
node-version: ${{ matrix.node}}
- run: pnpm install

repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: NullVoxPopuli/action-setup-pnpm@v1.1.0
- name: Test Modules with ${{ matrix.node }}
run: pnpm test
working-directory: tests-esm
Expand All @@ -59,6 +65,7 @@ jobs:
name: CJS Tests
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [install_dependencies]
strategy:
matrix:
node:
Expand All @@ -67,11 +74,10 @@ jobs:
- "18"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: actions/setup-node@v3
- uses: felixmosh/turborepo-gh-artifacts@v2
with:
node-version: ${{ matrix.node}}
- run: pnpm install
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: NullVoxPopuli/action-setup-pnpm@v1.1.0
- name: Test CJS with ${{ matrix.node }}
run: pnpm test
working-directory: tests-cjs
Expand All @@ -81,24 +87,33 @@ jobs:
name: "Highlight.js Tests"
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [install_dependencies]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: NullVoxPopuli/action-setup-pnpm@v1.1.0
- run: scripts/hljs-test.sh
working-directory: highlightjs-glimmer

publish:
release:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
needs: [esm_tests, cjs_tests, hljs_tests]

steps:
- uses: actions/checkout@v3
- uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: NullVoxPopuli/action-setup-pnpm@v1.1.0
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
persist-credentials: false
- uses: ./.github/actions/pnpm
- name: Release
run: pnpm semantic-release
publish: pnpm release
title: "Release Preview"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 0 additions & 15 deletions config/ember-cli-update.json

This file was deleted.

30 changes: 29 additions & 1 deletion dist/glimmer.cjs.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,15 @@ function glimmer(hljs) {
end: /"/,
contains: [
XML_ENTITIES
/* MUSTACHE_EXPRESSION added later */
]
},
{
begin: /'/,
end: /'/,
contains: [
XML_ENTITIES
/* MUSTACHE_EXPRESSION added later */
]
}
]
Expand All @@ -180,15 +182,27 @@ function glimmer(hljs) {
BLOCK_PARAMS,
THIS_EXPRESSION,
ATTRIBUTES,
// {
// className: 'variable',
// keywords: KEYWORDS,
// match: /\s[\w\d-_^]+/
// },
// {
// match: /\b[a-z][a-zA-Z0-9-]+\b/,
// keywords: KEYWORDS,
// className: 'keyword'
// },
CURLY_NAME,
STRING
// NAME,
];
const SUB_EXPRESSION = {
keywords: KEYWORDS,
begin: regex.concat(
/\(/,
regex.lookahead(
regex.concat(
// /[^)]+/,
/\)/
)
)
Expand Down Expand Up @@ -241,6 +255,7 @@ function glimmer(hljs) {
ABS_NAME
]
},
// close tag
{
className: "tag",
begin: regex.concat(/<\/:?/, regex.lookahead(regex.concat(TAG_NAME, />/))),
Expand Down Expand Up @@ -317,10 +332,21 @@ function setupTemplateTag(_hljs, js) {
const GLIMMER_TEMPLATE_TAG = {
begin: /<template>/,
end: /<\/template>/,
/**
* @param {RegExpMatchArray} match
* @param {CallbackResponse} response
*/
isTrulyOpeningTag: (match, response) => {
const afterMatchIndex = match[0].length + match.index;
const nextChar = match.input[afterMatchIndex];
if (nextChar === "<" || nextChar === ",") {
if (
// HTML should not include another raw `<` inside a tag
// nested type?
// `<Array<Array<number>>`, etc.
nextChar === "<" || // the , gives away that this is not HTML
// `<T, A extends keyof T, V>`
nextChar === ","
) {
response.ignoreMatch();
return;
}
Expand All @@ -343,6 +369,8 @@ function setupTemplateTag(_hljs, js) {
variants: [
{
begin: GLIMMER_TEMPLATE_TAG.begin,
// we carefully check the opening tag to see if it truly
// is a tag and not a false positive
"on:begin": GLIMMER_TEMPLATE_TAG.isTrulyOpeningTag,
end: GLIMMER_TEMPLATE_TAG.end
}
Expand Down
6 changes: 6 additions & 0 deletions highlightjs-glimmer/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
vendor/
coverage/
node_modules/
.git/
.github/
5 changes: 5 additions & 0 deletions highlightjs-glimmer/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

const { configs } = require('@nullvoxpopuli/eslint-configs');

module.exports = configs.crossPlatform();
7 changes: 7 additions & 0 deletions highlightjs-glimmer/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/
vendor/
coverage/
node_modules/
.git/
.github/
*.md
18 changes: 18 additions & 0 deletions highlightjs-glimmer/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

module.exports = {
singleQuote: true,
printWidth: 100,
overrides: [
{
files: ['**/*.hbs'],
options: {
singleQuote: false,
},
},
{
files: ['**/*.gjs', '**/*.gts'],
plugins: ['prettier-plugin-ember-template-tag'],
},
],
};
2 changes: 2 additions & 0 deletions CHANGELOG.md → highlightjs-glimmer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# highlightjs-glimmer

## [2.0.1](https://github.com/NullVoxPopuli/highlightjs-glimmer/compare/v2.0.0...v2.0.1) (2022-11-06)


Expand Down
File renamed without changes.
Loading

0 comments on commit e603d1c

Please sign in to comment.