Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(216): Deno with spec #219

Merged
merged 29 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .eslintrc.json

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/deno.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean installation of Deno dependencies, cache/restore them, build the source code and run tests across different versions of Deno

name: Deno CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
build:
permissions:
contents: write
packages: write
id-token: write

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Deno 2.x
uses: denoland/setup-deno@v2
- run: deno install
- run: deno task test
- name: Publish to Deno.land
id: deno-publish
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: deno run --allow-net --allow-read --allow-write --allow-env https://deno.land/x/publish/mod.ts
env:
DENO_AUTH_TOKEN: ${{ secrets.DENO_AUTH_TOKEN }}
- name: Create release on publish
uses: ncipollo/release-action@v1
if: ${{ steps.deno-publish.outputs.type == 'published' }}
46 changes: 0 additions & 46 deletions .github/workflows/node.js.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ repos:
- id: gitleaks
- repo: local
hooks:
- id: eslint
name: eslint
entry: bash -c "npm run lint"
language: node
- id: lint
name: lint
entry: bash -c "deno lint"
language: deno
- id: test
name: test
entry: bash -c "npm run test"
entry: bash -c "deno test"
stages: [pre-push]
language: node
language: deno
64 changes: 22 additions & 42 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test/**/*.ts"
],
"internalConsoleOptions": "openOnSessionStart",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"request": "launch",
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**/*.js",
"${workspaceFolder}/node_modules/loupe/loupe.js",
],
"type": "node"
},
{
"args": [
"${workspaceFolder}/hc/BitScheme.hc",
"-t",
],
"internalConsoleOptions": "openOnSessionStart",
"name": "Testdoc BitScheme",
"program": "${workspaceFolder}/lib/src/cli/hc.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**/*.js",
"${workspaceFolder}/node_modules/loupe/loupe.js",
],
"type": "node"
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Program",
"type": "node",
"program": "${workspaceFolder}/main.ts",
"cwd": "${workspaceFolder}",
"env": {},
"runtimeExecutable": "/opt/homebrew/bin/deno",
"runtimeArgs": [
"run",
"--unstable",
"--inspect-wait",
"--allow-all"
],
"attachSimplePort": 9229
}
]
}
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib/"
"deno.enable": true,
"deno.lint": true,
"editor.defaultFormatter": "denoland.vscode-deno",
"deno.codeLens.test": true,
"deno.codeLens.implementations": true,
"deno.codeLens.references": true,
"deno.codeLens.referencesAllFunctions": true
}
57 changes: 0 additions & 57 deletions .vscode/tasks.json

This file was deleted.

23 changes: 0 additions & 23 deletions .vscode/tasks.json.old

This file was deleted.

26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@ version: 0.5.14

## Introduction

[Homoiconic C](https://theswanfactory.wordpress.com/2016/12/20/homoiconic-c-a-universal-language-for-code-and-data/) (HC) is a single universal language for code and data. This repository contains the first implementation of HC as an interpreter written in TypeScript running on `nodejs`.
[Homoiconic C](https://theswanfactory.wordpress.com/2016/12/20/homoiconic-c-a-universal-language-for-code-and-data/)
(HC) is a single universal language for code and data. This repository contains
the first implementation of HC as an interpreter written in TypeScript running
on `nodejs`.

It also contains a sample application called MAML, the [*Multipurpose Abstract Markup Language*](https://theswanfactory.wordpress.com/2016/11/08/introducing-maml-a-draft-proposal-for-html6/). MAML is a radically simple proposal for replacing all the existing web technologies (HMTL, CSS, JavaScript, SVG, etc.) with a single format based on HC.
It also contains a sample application called MAML, the
[_Multipurpose Abstract Markup Language_](https://theswanfactory.wordpress.com/2016/11/08/introducing-maml-a-draft-proposal-for-html6/).
MAML is a radically simple proposal for replacing all the existing web
technologies (HMTL, CSS, JavaScript, SVG, etc.) with a single format based on
HC.

HC can also be used to define easily-parseable variants of other common file formats (e.g., HCSV, HCSON).
HC can also be used to define easily-parseable variants of other common file
formats (e.g., HCSV, HCSON).

## Usage

```shell
npm install
deno install
export DEBUG=true # optional
npm run hc
deno task hc
```

This will launch the interpreter.
Expand All @@ -28,19 +36,21 @@ To generate and run the BitScheme documentation, type:
npm run bs:all
```

This will open the BitScheme.html file, and also run the documentation through the testdoc evaluator which will generate pass/fail messages.
This will open the BitScheme.html file, and also run the documentation through
the testdoc evaluator which will generate pass/fail messages.

## Development

1. Clone the [github repository](https://github.com/TheSwanFactory/hclang.git).

2. Install [node.js](https://nodejs.org/).

* e.g., `brew install node` on macOS.
- e.g., `brew install node` on macOS.

3. Run `npm test`.

NOTE: The [language-hclang](https://github.com/TheSwanFactory/language-hclang) vscode extension is still in development.
NOTE: The [language-hclang](https://github.com/TheSwanFactory/language-hclang)
vscode extension is still in development.

## Publishing

Expand Down
12 changes: 12 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"tasks": {
"hc": "deno run --allow-env src/cli/hc.ts",
"test": "deno fmt src && deno lint && deno test --allow-env --allow-read"
},
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.10"
},
"compilerOptions": {
"strict": true
}
}
Loading
Loading