Skip to content

Commit

Permalink
Amira/restructure (#188)
Browse files Browse the repository at this point in the history
major structural changes
move to single project
  • Loading branch information
Amir Arad authored Feb 20, 2018
1 parent 7eb300a commit ea7cee8
Show file tree
Hide file tree
Showing 251 changed files with 3,444 additions and 18,269 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ typings/

# dotenv environment variables file
.env
*.vsix
19 changes: 4 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
language: node_js

sudo: false

node_js:
- 9
- 8

cache:
yarn: true

os:
- osx
- linux

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libsecret-1-dev
- g++-4.9

before_install:
- if [ $TRAVIS_OS_NAME == "linux" ]; then
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sleep 3;
fi

cache:
yarn: true


56 changes: 56 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/fixtures/demo",
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"preLaunchTask": "compile"
},
{
"name": "Attach to running server",
"type": "node",
"request": "attach",
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/dist/src/server/**/*.js"
],
"protocol": "inspector"
},
{
"name": "Test e2e",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceRoot}/fixtures/e2e-cases",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/dist/test/e2e"
],
"stopOnEntry": false,
"sourceMaps": true,
"preLaunchTask": "compile"
},
{
"name": "Test server",
"request": "launch",
"type": "node",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
"--require",
"ts-node/register",
"test/server/**/*.spec.ts"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector"
}
]
}
File renamed without changes.
23 changes: 23 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"identifier": "compile",
"type": "npm",
"script": "build",
"problemMatcher": [
"$tsc-watch"
]
}
]
}
4 changes: 4 additions & 0 deletions packages/client/.vscodeignore → .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
**/*.ts
.vscode/**/*
.vscode-test/**/*
src/**/*
test/**/*
test-kit/**/*
dist/test/**/*
dist/test-kit/**/*
run-test.js
tsconfig.json
tsconfig.publish.json
Expand Down
65 changes: 57 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ Readme for the extension itself is at https://github.com/wix/stylable-intelligen

# Project Setup
* Clone this repo
* Run yarn (in this order) in: packages/server/, packages/client/ and project root
* To build server and copy to client: yarn start in packages/server/
* To build server and run tests: yarn test in packages/server/
* To run client tests from command line: yarn test in packages/client/
* To run client tests from command line, you must have no open instances of vscode. It is easier to run client tests from within vscode (see below).
* To run client tests from vscode, open vscode in pakages/client/ and choose the 'Launch Tests' launch configuration.
* To run server tests from vscode, open vscode in pakages/server/ and choose the 'run tests' launch configuration.
* To launch and debug the extension:
* Run `yarn` to install dependencies
* (investigate what's up with `postinstall` and `prepublish` hooks)
* Run `yarn vscode:prepublish` ?? (needs to investigate further)
* Run `yarn test` to test and build (both server and client)
* To launch and debug the extension: (needs to investigate further)
1. open vscode in packages/client/ and in packages/server/.
2. Choose the 'Launch Extension' configuration in the client vscode.
3. Once the extension is launched, choose the 'Attach' configuration in the server vscode.
Expand All @@ -31,3 +28,55 @@ Readme for the extension itself is at https://github.com/wix/stylable-intelligen
* Bug in completion text matching (mine): https://github.com/Microsoft/vscode/issues/34542
* Lots of explanations and links to code about how completions are ordered and filtered: https://github.com/Microsoft/vscode/issues/26096
* Link to activating completion ranking display: https://github.com/Microsoft/vscode/issues/41060#issuecomment-357879748


# Client
[![Build Status](https://travis-ci.org/wix/stylable-intelligence.svg?branch=master)](https://travis-ci.org/wix/stylable-intelligence)
[![Build Status](https://ci.appveyor.com/api/projects/status/6ky876hm9nycyu8m/branch/master?svg=true)](https://ci.appveyor.com/project/qballer/stylable-intelligence)

## Overview
Stylable Intelligence is an extension implementing the Language Server Protocol that provides IDE support for Stylable.

Stylable Intelligence is currently only supported in VSCode (version 1.18.0 and later). Support for JetBrains IDEs (WebStorm, IntelliJ) is planned.

Currently supported: Code Completions, Diagnostics, Go to Definition, Syntax Highlighting

All CSS language support functionality is also supported (hover hints, inline color picker, etc.). Some CSS diagnostics no longer apply in Stylable and are filtered out.

Other Language Server features will be added in the near future.


## Installation

### From VSCode Marketplace
Search VSCode Extension Marketplace for ['Stylable Intelligence'](https://marketplace.visualstudio.com/search?term=stylable-intelligence&target=VSCode&category=All%20categories&sortBy=Relevance).

Install extension.

Reload window when prompted by VsCode.

### From .vsix file
In VsCode extension menu, choose 'Install from VSIX'.

Double-click your .vsix file.

Reload window when prompted by VsCode.

## Known Issues

### Not supported yet (in rough order of priority):
* Mixins and JS imports - WIP
* Variants
* Esoteric syntax (-st-compose, -st-theme, -st-root, -st-global)
* Find References
* Rename/Refactor

# Server
stylable-intelligence-server
----------------------------
stylable-intelligence completion provider to be consumed outside
of the context of vscode extension.

```typescript
import {MinimalDocs, createProvider, Provider } from 'stylable-intelligence-server'
```
2 changes: 1 addition & 1 deletion cijoe.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
buildcmd: "build"
testcmd: "test:ci"
testcmd: "test"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
8 changes: 0 additions & 8 deletions lerna.json

This file was deleted.

110 changes: 98 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,118 @@
{
"name": "stylable-intelligence",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"license": "MIT",
"version": "0.0.3",
"description": "Stylable Language Services",
"scripts": {
"postinstall": "lerna bootstrap",
"test": "lerna run test",
"build": "echo Not Implemented",
"test:node": "npm run test",
"test:ci": "npm run test"
"reset": "yarn clear && rimraf node_modules && yarn install && yarn test",
"clear": "rimraf dist",
"build": "tsc -d",
"install": "node ./node_modules/vscode/bin/install",
"test": "yarn test:server && yarn build && yarn test:e2e",
"test:e2e": "node ./run-test",
"test:server": "mocha --require ts-node/register test/**/*.spec.ts",
"test:ci": "mocha --require ts-node/register --reporter mocha-env-reporter test/**/*.spec.ts && node ./run-test"
},
"dependencies": {
"bignumber": "^1.1.0",
"css-selector-tokenizer": "^0.7.0",
"doctrine": "^2.1.0",
"glob": "^7.1.2",
"htap": "^1.0.3",
"ipaddr": "^0.0.9",
"kissfs": "^0.5.3",
"lodash": "^4.17.5",
"pkg-dir": "^2.0.0",
"postcss": "^6.0.17",
"postcss-selector-parser": "^3.1.1",
"postcss-value-parser": "^3.3.0",
"stylable": "^5.1.3",
"tslib": "^1.9.0",
"typescript": "^2.6.2",
"vscode": "^1.1.10",
"vscode-css-languageservice": "3.0.5",
"vscode-languageclient": "^3.5.0",
"vscode-languageserver": "^3.5.0"
},
"devDependencies": {
"lerna": "^2.8.0",
"typescript": "~2.6.2",
"@types/autobahn": "^0.9.38",
"@types/chai": "^4.1.2",
"@types/chai-subset": "^1.3.1",
"@types/glob": "^5.0.35",
"@types/lodash": "^4.14.102",
"@types/mocha": "^2.2.48",
"@types/node": "8",
"@types/pkg-dir": "^2.0.0",
"@types/sinon": "^4.1.3",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"chai-subset": "^1.6.0",
"concurrently": "^3.5.1",
"glob": "^7.1.2",
"mocha": "^5.0.1",
"mocha-env-reporter": "^3.0.0",
"mocha-loader": "^1.1.3",
"ncp": "^2.0.0",
"polished": "^1.9.2",
"rimraf": "^2.6.2",
"sinon": "^4.3.0",
"sinon-chai": "^2.14.0",
"source-map-support": "^0.5.3",
"ts-node": "^4.1.0",
"umd-compat-loader": "^2.1.1",
"vsce": "^1.36.2"
},
"author": "Nadav Abraami ([email protected])",
"publisher": "Nadav Abraami (nadav@wix.com)",
"publisher": "wix",
"repository": {
"type": "git",
"url": "[email protected]:wixplosives/stylable-intelligence.git"
"url": "[email protected]:wix/stylable-intelligence.git"
},
"bugs": {
"url": "https://github.com/wixplosives/stylable-intelligence/issues"
"url": "https://github.com/wix/stylable-intelligence/issues"
},
"engines": {
"vscode": "^1.18.0"
},
"categories": [
"Languages",
"Snippets",
"Other"
],
"contributes": {
"languages": [
{
"id": "stylable",
"aliases": [
"Stylable"
],
"extensions": [
".st.css"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "stylable",
"scopeName": "source.stylable",
"path": "./src/client/stylable.tmLanguage.json"
}
]
},
"homepage": "https://github.com/wixplosives/stylable-intelligence#readme",
"activationEvents": [
"onLanguage:stylable"
],
"files": [
"dist/src"
],
"testGlob": "./dist/test/**/*.test.js?(x)",
"homepage": "https://github.com/wix/stylable-intelligence#readme",
"keywords": [
"typescript",
"tdd"
"stylable",
"css"
]
}
26 changes: 0 additions & 26 deletions packages/client/.vscode/launch.json

This file was deleted.

Loading

0 comments on commit ea7cee8

Please sign in to comment.