Skip to content

Commit

Permalink
use pactup and modernize repo
Browse files Browse the repository at this point in the history
  • Loading branch information
salamaashoush committed May 28, 2024
1 parent f013838 commit 514b6ed
Show file tree
Hide file tree
Showing 21 changed files with 4,999 additions and 8,912 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Typecheck
run: nr typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: nr build

- name: Test
run: nr test
16 changes: 13 additions & 3 deletions .github/workflows/publish_extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ name: Deploy Extension
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
node-version: 20
- run: npm ci
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Publish to Open VSX Registry
continue-on-error: true
uses: HaaLeo/publish-vscode-extension@v1
Expand Down
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
*.code-workspace
.cache
.DS_Store
.idea
*.log
*.tgz
*.vsix
coverage
dist
lib-cov
logs
node_modules
out
.vscode/
pact-0.0.6.vsix
temp
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-workspace-root-check=true
node-linker=hoisted
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint"]
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
}
9 changes: 3 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
// A launch configuration that launches the extension inside a new window
// 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": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "npm: dev"
}
]
}
24 changes: 16 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
],
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "always"
}
"source.organizeImports": "never"
},
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true
}
18 changes: 12 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"script": "dev",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
"problemMatcher": [
{
"base": "$ts-webpack-watch",
"background": {
"activeOnStart": true,
"beginsPattern": "Build start",
"endsPattern": "Build success"
}
}
],
"group": "build"
}
]
}
18 changes: 5 additions & 13 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
node_modules/**
!node_modules/vscode-jsonrpc/**
!node_modules/vscode-languageclient/**
!node_modules/vscode-languageserver-protocol/**
!node_modules/vscode-languageserver-types/**
!node_modules/{minimatch,brace-expansion,concat-map,balanced-match}/**
!node_modules/{semver,lru-cache,yallist}/**
!node_modules/@pact-toolbox/**
src
node_modules
test
.github
.vscode
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ It’s designed from the ground up to support the unique challenges of developin

Pact is designed with safety in mind. Its design is informed by existing approaches to smart contracts as well as stored procedure languages like SQL and LISP. Pact resembles a general-purpose, Turing-complete language. It includes LISP-like syntax, user functions, modules, and imperative style.

For more information please visit:
For more information please visit:

https://pact-language.readthedocs.io/
https://www.kadena.io/
<https://docs.kadena.io/build/>
<https://www.kadena.io/>

## Features

Expand All @@ -28,11 +28,35 @@ https://www.kadena.io/
## Requirements

- For tracing and coverage: [pact](https://github.com/kadena-io/pact)
- For completion: [pact-lsp](https://github.com/kadena-io/pact-lsp)
- For LSP: [pact-5](https://github.com/kadena-io/pact-5) if not installed we use [pactup](https://github.com/kadena-community/pactup) to install it.

## Extension Settings

Pact executable and pact-lsp paths can be set from the settings menu.
## `pact.executable`

- **Type**: `string`
- **Default**: `"pact"`
- **Description**: The name or path to the pact executable, if version is not pact 5 we will run `npx pactup install development-latest` to install pact 5

## `pact.enableTrace`

- **Type**: `boolean`
- **Default**: `true`
- **Description**: Enable pact trace output.

## `pact.enableCoverage`

- **Type**: `boolean`
- **Default**: `false`
- **Description**: Enable code coverage. Requires coverage extension for display.

## `pact.enableLsp`

- **Type**: `boolean`
- **Default**: `true`
- **Description**: Enable the pact-lsp.
-
- `pact.pactExecutable` pact binary path if not provider we use

## Release Notes

Expand Down Expand Up @@ -61,6 +85,4 @@ Fixed support for .repl files and lowered the minimal required VSCode version

Initial release of the highlighting syntax


-----------------------------------------------------------------------------------------------------------

---
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
ignores: ['dist'],
});
Loading

0 comments on commit 514b6ed

Please sign in to comment.