Skip to content

Commit 3ca589c

Browse files
committed
refactor: move projects into packages dir
Retarget all required references.
1 parent 8b7fcad commit 3ca589c

Some content is hidden

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

42 files changed

+105
-80
lines changed

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"tasks": [
44
{
55
"type": "shell",
6-
"command": "npx nx build syntaxes",
6+
"command": "npx nx build packages/syntaxes",
77
"label": "build_syntaxes",
88
"problemMatcher": ["$tsc"]
99
},
1010
{
1111
"type": "shell",
1212
"label": "watch",
1313
"isBackground": true,
14-
"command": "npx nx affected --target=build --exclude=syntaxes -- --watch",
14+
"command": "npx nx affected --target=build --exclude=packages/syntaxes -- --watch",
1515
"group": {
1616
"kind": "build",
1717
"isDefault": true

nx.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,38 @@
44
"default": {
55
"runner": "@nrwl/nx-cloud",
66
"options": {
7-
"cacheableOperations": ["build", "lint", "test", "e2e"],
7+
"cacheableOperations": [
8+
"build",
9+
"lint",
10+
"test",
11+
"e2e"
12+
],
813
"accessToken": "MzZlZTRmZGMtYTI3Ny00NmIxLThlNjctMmZhM2E3MGM4ZDcwfHJlYWQtd3JpdGU="
914
}
1015
}
1116
},
1217
"defaultBase": "main",
1318
"targetDefaults": {
1419
"test": {
15-
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"]
20+
"inputs": [
21+
"default",
22+
"^default",
23+
"{workspaceRoot}/jest.preset.js"
24+
]
1625
},
1726
"lint": {
18-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
27+
"inputs": [
28+
"default",
29+
"{workspaceRoot}/.eslintrc.json"
30+
]
1931
},
2032
"build": {
21-
"dependsOn": ["^build"]
33+
"dependsOn": [
34+
"^build"
35+
]
2236
}
37+
},
38+
"workspaceLayout": {
39+
"libsDir": "packages"
2340
}
24-
}
41+
}

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"CCCP",
2424
"Cortex Command Community Project"
2525
],
26-
"main": "./dist/client/extension",
26+
"main": "dist/packages/client/src/extension",
2727
"contributes": {
2828
"configuration": {
2929
"type": "object",
@@ -43,12 +43,21 @@
4343
"messages",
4444
"verbose"
4545
],
46-
"default": "off",
46+
"default": "verbose",
4747
"description": "Traces the communication between VS Code and the language server."
4848
}
4949
}
5050
},
5151
"languages": [
52+
{
53+
"id": "plaintext",
54+
"extensions": [
55+
".txt"
56+
],
57+
"aliases": [
58+
"Plain Text"
59+
]
60+
},
5261
{
5362
"id": "ccini",
5463
"aliases": [
@@ -58,14 +67,14 @@
5867
"extensions": [
5968
".ini"
6069
],
61-
"configuration": "./language-configuration.json"
70+
"configuration": "packages/syntaxes/src/language-configuration.json"
6271
}
6372
],
6473
"grammars": [
6574
{
6675
"language": "ccini",
6776
"scopeName": "source.ccini",
68-
"path": "dist/syntaxes/ccini.tmLanguage.json"
77+
"path": "dist/packages/syntaxes/ccini.tmLanguage.json"
6978
}
7079
]
7180
},
@@ -118,4 +127,4 @@
118127
"vscode-languageserver-textdocument": "^1.0.4",
119128
"vscode-test": "^1.6.1"
120129
}
121-
}
130+
}
File renamed without changes.

client/.eslintrc.json renamed to packages/client/.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"extends": ["../.eslintrc.json"],
2+
"extends": ["../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
44
"overrides": [
55
{
66
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
77
"parserOptions": {
8-
"project": ["client/tsconfig.*?.json"]
8+
"project": ["packages/client/tsconfig.*?.json"]
99
},
1010
"rules": {}
1111
},
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable */
22
export default {
3-
displayName: 'server',
4-
preset: '../jest.preset.js',
3+
displayName: 'packages/client',
4+
preset: '../../jest.preset.js',
55
globals: {
66
'ts-jest': {
77
tsconfig: '<rootDir>/tsconfig.spec.json',
@@ -12,5 +12,5 @@ export default {
1212
'^.+\\.[tj]sx?$': 'ts-jest',
1313
},
1414
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
15-
coverageDirectory: '../coverage/server',
15+
coverageDirectory: '../../coverage/packages/client',
1616
};

client/package.json renamed to packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ccini-client",
2+
"name": "client",
33
"version": "0.0.1",
44
"repository": {
55
"type": "git",

server/project.json renamed to packages/client/project.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
{
2-
"name": "server",
3-
"$schema": "../node_modules/nx/schemas/project-schema.json",
4-
"sourceRoot": "server/src",
2+
"name": "packages/client",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "packages/client/src",
55
"projectType": "library",
66
"targets": {
77
"build": {
88
"executor": "@nrwl/js:tsc",
99
"outputs": ["{options.outputPath}"],
1010
"options": {
11-
"outputPath": "dist/server",
12-
"tsConfig": "server/tsconfig.lib.json",
13-
"packageJson": "server/package.json",
14-
"main": "server/src/index.ts",
15-
"assets": ["server/*.md"]
11+
"outputPath": "dist/packages/client",
12+
"tsConfig": "packages/client/tsconfig.lib.json",
13+
"packageJson": "packages/client/package.json",
14+
"main": "packages/client/src/index.ts",
15+
"assets": ["packages/client/*.md"]
1616
}
1717
},
1818
"lint": {
1919
"executor": "@nrwl/linter:eslint",
2020
"outputs": ["{options.outputFile}"],
2121
"options": {
22-
"lintFilePatterns": ["server/**/*.ts"]
22+
"lintFilePatterns": ["packages/client/**/*.ts"]
2323
}
2424
},
2525
"test": {
2626
"executor": "@nrwl/jest:jest",
2727
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
2828
"options": {
29-
"jestConfig": "server/jest.config.ts",
29+
"jestConfig": "packages/client/jest.config.ts",
3030
"passWithNoTests": true
3131
}
3232
}

client/src/extension.ts renamed to packages/client/src/extension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ let client: LanguageClient;
1818
export function activate(context: ExtensionContext) {
1919
// The server is implemented in node
2020
const serverModule = context.asAbsolutePath(
21-
path.join('server', 'out', 'server.js')
21+
path.join('dist', 'packages', 'server', 'src', 'server.js')
2222
);
23+
console.log('PEEEEEE');
2324

2425
// If the extension is launched in debug mode then the debug server options are used
2526
// Otherwise the run options are used

0 commit comments

Comments
 (0)