Skip to content

Commit

Permalink
more project reorg. added CI
Browse files Browse the repository at this point in the history
  • Loading branch information
martypdx committed Feb 26, 2024
1 parent 54fb95d commit babb690
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 61 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/packages/vite-plugin-azoth/test/out/**
/packages/vite-plugin-azoth/test/out/**
node_modules
docs
dist
22 changes: 22 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: is-valid-es-identifier CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: pnpm install
- run: pnpm lint
- run: pnpm test
env:
CI: true
10 changes: 5 additions & 5 deletions core/compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "compiler",
"version": "0.0.0",
"name": "@azoth-web/compiler",
"version": "1.7.0",
"description": "Azoth compiler",
"author": "Marty Nelson",
"license": "MIT",
Expand Down Expand Up @@ -36,13 +36,13 @@
"acorn-jsx": "^5.3.2",
"astring": "^1.8.6",
"html-void-elements": "^3.0.0",
"is-valid-var-name": "^1.0.2",
"rev-hash": "^4.1.0"
"is-valid-es-identifier": "^2.0.0",
"rev-hash": "^4.1.0",
"source-map": "^0.7.4"
},
"devDependencies": {
"install": "^0.13.0",
"npm": "^10.4.0",
"source-map": "^0.7.4",
"vitest": "^1.3.1"
}
}
97 changes: 54 additions & 43 deletions core/compiler/pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions core/compiler/transform/TemplateGenerator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { generate } from 'astring';
import { HtmlGenerator } from './HtmlGenerator.js';
import { Generator, writeNextLine } from './GeneratorBase.js';
import isValidName from 'is-valid-var-name';
import { isValidESIdentifier } from 'is-valid-es-identifier';
import { Analyzer } from './Analyzer.js';

export class TemplateGenerator extends Generator {
Expand Down Expand Up @@ -238,7 +238,7 @@ export class TemplateGenerator extends Generator {
const identity = node.name;
const propName = identity.name;
// TODO: refactor with component props
if(isValidName(propName)) {
if(isValidESIdentifier(propName)) {
state.write(`.`);
state.write(propName, node.name);
}
Expand Down
4 changes: 2 additions & 2 deletions core/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "runtime",
"version": "1.0.0",
"name": "@azoth-web/runtime",
"version": "1.7.0",
"description": "Azoth runtime",
"author": "martypdx",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion core/vite-plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compile } from 'compiler';
import { compile } from '../compiler/index.js';
import { createFilter } from '@rollup/pluginutils';
import { SourceNode, SourceMapConsumer } from 'source-map';
import path from 'node:path';
Expand Down
4 changes: 1 addition & 3 deletions core/vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"directory": "aetheria-core/vite-plugin"
},
"type": "module",
"scripts": {
"test": "exit 0"
},
"scripts": {},
"files": [
"index.js",
"dist"
Expand Down
2 changes: 1 addition & 1 deletion core/vite-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"type": "module",
"scripts": {
"test": "pnpm run test:build && vitest -w false ",
"test:onhold": "pnpm run test:build && vitest -w false ",
"test:build": "vite build -c ./test/vite.config.js",
"test:update": "rm -rf ./test/expected-out && cp -R ./test/out ./test/expected-out",
"build": "vite build"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test:compiler": "pnpm -F compiler test",
"test:test-utils": "pnpm -F test-utils test",
"test:plugin": "pnpm -F vite-plugin test",
"lint": "eslint ."
"lint": "eslint core"
},
"devDependencies": {
"@vitest/browser": "^1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"main": "index.js",
"scripts": {
"start": "vite --clearScreen=false --passWithNoTests",
"start": "vite --clearScreen=false",
"build": "vite build",
"preview": "vite preview",
"test": "vitest"
Expand All @@ -14,7 +14,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"azoth": "workspace:^",
"azoth/runtime": "workspace:runtime@*",
"npm": "^10.4.0",
"page": "^1.11.6"
},
Expand Down

0 comments on commit babb690

Please sign in to comment.