Skip to content

Commit 24af088

Browse files
authored
Reimplement cheatsheet using html (#619)
* Cheatsheet nx html generation * HTML cheatsheet talon side * HTML cheatsheet VSCode extension-side * Tweak deploy * identifier => id * Tweaks from PR feedback * Rename dir * update defaults.json * Remove nx-welcome.tsx
1 parent d9fa044 commit 24af088

File tree

88 files changed

+38531
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+38531
-12
lines changed

.github/workflows/deploy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
- run: yarn install --frozen-lockfile
2323
- run: yarn run compile
2424
- run: yarn run prepare-for-extension-publish
25+
- name: Initialize cursorless-nx subdir
26+
run: npm ci
27+
working-directory: cursorless-nx
28+
- name: Build cheatsheet html
29+
run: nx build cheatsheet-local
30+
working-directory: cursorless-nx
2531
- name: Publish to Open VSX Registry
2632
uses: HaaLeo/publish-vscode-extension@v1
2733
id: publishToOpenVSX

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ dist
33
node_modules
44
.vscode-test/
55
*.vsix
6-
package-lock.json
6+
/package-lock.json
77
*.DS_Store
88

99
# TypeDoc output

.vscodeignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
**
22
!CHANGELOG.md
3+
!LICENSE
4+
!NOTICE.md
5+
!README.md
6+
!build-info.json
37
!cursorless-snippets/**
8+
!dist/assets/cheatsheet-local/index.html
49
!dist/extension.js
510
!images/hats/**
611
!images/icon.png
7-
!LICENSE
8-
!NOTICE.md
912
!package.json
10-
!README.md
1113
!schemas/**
1214
!third-party-licenses.csv
13-
!build-info.json

cursorless-nx/.eslintrc.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nrwl/nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nrwl/nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nrwl/nx/javascript"],
32+
"rules": {}
33+
}
34+
]
35+
}

cursorless-nx/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db

cursorless-nx/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
4+
/coverage

cursorless-nx/.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

cursorless-nx/.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"firsttris.vscode-jest-runner",
6+
"dbaeumer.vscode-eslint"
7+
]
8+
}

cursorless-nx/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Cursorless
2+
3+
This project was generated using [Nx](https://nx.dev).
4+
5+
<p style="text-align: center;"><img src="https://github.com/raw/nrwl/nx/master/images/nx-logo.png" width="450"></p>
6+
7+
🔎 **Smart, Fast and Extensible Build System**
8+
9+
## Adding capabilities to your workspace
10+
11+
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
12+
13+
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.
14+
15+
Below are our core plugins:
16+
17+
- [React](https://reactjs.org)
18+
- `npm install --save-dev @nrwl/react`
19+
- Web (no framework frontends)
20+
- `npm install --save-dev @nrwl/web`
21+
- [Angular](https://angular.io)
22+
- `npm install --save-dev @nrwl/angular`
23+
- [Nest](https://nestjs.com)
24+
- `npm install --save-dev @nrwl/nest`
25+
- [Express](https://expressjs.com)
26+
- `npm install --save-dev @nrwl/express`
27+
- [Node](https://nodejs.org)
28+
- `npm install --save-dev @nrwl/node`
29+
30+
There are also many [community plugins](https://nx.dev/community) you could add.
31+
32+
## Generate an application
33+
34+
Run `nx g @nrwl/react:app my-app` to generate an application.
35+
36+
> You can use any of the plugins above to generate applications as well.
37+
38+
When using Nx, you can create multiple applications and libraries in the same workspace.
39+
40+
## Generate a library
41+
42+
Run `nx g @nrwl/react:lib my-lib` to generate a library.
43+
44+
> You can also use any of the plugins above to generate libraries as well.
45+
46+
Libraries are shareable across libraries and applications. They can be imported from `@cursorless/mylib`.
47+
48+
## Development server
49+
50+
Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
51+
52+
## Code scaffolding
53+
54+
Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component.
55+
56+
## Build
57+
58+
Run `nx build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
59+
60+
## Running unit tests
61+
62+
Run `nx test my-app` to execute the unit tests via [Jest](https://jestjs.io).
63+
64+
Run `nx affected:test` to execute the unit tests affected by a change.
65+
66+
## Running end-to-end tests
67+
68+
Run `nx e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).
69+
70+
Run `nx affected:e2e` to execute the end-to-end tests affected by a change.
71+
72+
## Understand your workspace
73+
74+
Run `nx graph` to see a diagram of the dependencies of your projects.
75+
76+
## Further help
77+
78+
Visit the [Nx Documentation](https://nx.dev) to learn more.
79+
80+
## ☁ Nx Cloud
81+
82+
### Distributed Computation Caching & Distributed Task Execution
83+
84+
<p style="text-align: center;"><img src="https://github.com/raw/nrwl/nx/master/images/nx-cloud-card.png"></p>
85+
86+
Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly.
87+
88+
Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers.
89+
90+
Visit [Nx Cloud](https://nx.app/) to learn more.

cursorless-nx/apps/.gitkeep

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["src/plugins/index.js"],
11+
"rules": {
12+
"@typescript-eslint/no-var-requires": "off",
13+
"no-undef": "off"
14+
}
15+
}
16+
]
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"fileServerFolder": ".",
3+
"fixturesFolder": "./src/fixtures",
4+
"integrationFolder": "./src/integration",
5+
"modifyObstructiveCode": false,
6+
"supportFile": "./src/support/index.ts",
7+
"pluginsFile": false,
8+
"video": true,
9+
"videosFolder": "../../dist/cypress/apps/cheatsheet-local-e2e/videos",
10+
"screenshotsFolder": "../../dist/cypress/apps/cheatsheet-local-e2e/screenshots",
11+
"chromeWebSecurity": false
12+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"sourceRoot": "apps/cheatsheet-local-e2e/src",
4+
"projectType": "application",
5+
"targets": {
6+
"e2e": {
7+
"executor": "@nrwl/cypress:cypress",
8+
"options": {
9+
"cypressConfig": "apps/cheatsheet-local-e2e/cypress.json",
10+
"devServerTarget": "cheatsheet-local:serve:development"
11+
},
12+
"configurations": {
13+
"production": {
14+
"devServerTarget": "cheatsheet-local:serve:production"
15+
}
16+
}
17+
},
18+
"lint": {
19+
"executor": "@nrwl/linter:eslint",
20+
"outputs": ["{options.outputFile}"],
21+
"options": {
22+
"lintFilePatterns": ["apps/cheatsheet-local-e2e/**/*.{js,ts}"]
23+
}
24+
}
25+
},
26+
"tags": [],
27+
"implicitDependencies": ["cheatsheet-local"]
28+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]"
4+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { getGreeting } from '../support/app.po';
2+
3+
describe('cheatsheet-local', () => {
4+
beforeEach(() => cy.visit('/'));
5+
6+
it('should display welcome message', () => {
7+
// Custom command example, see `../support/commands.ts` file
8+
cy.login('[email protected]', 'myPassword');
9+
10+
// Function helper example, see `../support/app.po.ts` file
11+
getGreeting().contains('Welcome cheatsheet-local');
12+
});
13+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getGreeting = () => cy.get('h1');
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
11+
// eslint-disable-next-line @typescript-eslint/no-namespace
12+
declare namespace Cypress {
13+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
14+
interface Chainable<Subject> {
15+
login(email: string, password: string): void;
16+
}
17+
}
18+
//
19+
// -- This is a parent command --
20+
Cypress.Commands.add('login', (email, password) => {
21+
console.log('Custom command example: Login', email, password);
22+
});
23+
//
24+
// -- This is a child command --
25+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
26+
//
27+
//
28+
// -- This is a dual command --
29+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
30+
//
31+
//
32+
// -- This will overwrite an existing command --
33+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"sourceMap": false,
5+
"outDir": "../../dist/out-tsc",
6+
"allowJs": true,
7+
"types": ["cypress", "node"]
8+
},
9+
"include": ["src/**/*.ts", "src/**/*.js"]
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
[
4+
"@nrwl/react/babel",
5+
{
6+
"runtime": "automatic"
7+
}
8+
]
9+
],
10+
"plugins": []
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by:
2+
# 1. autoprefixer to adjust CSS to support the below specified browsers
3+
# 2. babel preset-env to adjust included polyfills
4+
#
5+
# For additional information regarding the format and rule options, please see:
6+
# https://github.com/browserslist/browserslist#queries
7+
#
8+
# If you need to support different browsers in production, you may tweak the list below.
9+
10+
last 1 Chrome version
11+
last 1 Firefox version
12+
last 2 Edge major versions
13+
last 2 Safari major version
14+
last 2 iOS major versions
15+
Firefox ESR
16+
not IE 9-11 # For IE 9-11 support, remove 'not'.

0 commit comments

Comments
 (0)