Skip to content

build: make dist paths align with source file paths #1733

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

Merged
merged 1 commit into from
Aug 4, 2022
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
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/client/*.js"
"${workspaceFolder}/dist/client/src/*.js"
],
"preLaunchTask": {
"type": "npm",
Expand All @@ -37,7 +37,7 @@
"port": 6009,
"restart": true,
"outFiles": [
"${workspaceFolder}/dist/server/*.js"
"${workspaceFolder}/dist/server/src/*.js"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import * as path from 'path';
import * as vscode from 'vscode';
import * as lsp from 'vscode-languageclient/node';

import {OpenOutputChannel, ProjectLoadingFinish, ProjectLoadingStart, SuggestStrictMode, SuggestStrictModeParams} from '../common/notifications';
import {GetComponentsWithTemplateFile, GetTcbRequest, GetTemplateLocationForComponent, IsInAngularProject, RunNgccRequest} from '../common/requests';
import {resolve, Version} from '../common/resolver';
import {OpenOutputChannel, ProjectLoadingFinish, ProjectLoadingStart, SuggestStrictMode, SuggestStrictModeParams} from '../../common/notifications';
import {GetComponentsWithTemplateFile, GetTcbRequest, GetTemplateLocationForComponent, IsInAngularProject, RunNgccRequest} from '../../common/requests';
import {resolve, Version} from '../../common/resolver';

import {isInsideComponentDecorator, isInsideInlineTemplateRegion, isInsideStringLiteral} from './embedded_support';

Expand Down
2 changes: 1 addition & 1 deletion client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import * as vscode from 'vscode';

import {ServerOptions} from '../common/initialize';
import {ServerOptions} from '../../common/initialize';

import {AngularLanguageClient} from './client';
import {ANGULAR_SCHEME, TcbContentProvider} from './providers';
Expand Down
2 changes: 1 addition & 1 deletion client/src/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../dist/client/tests"
"outDir": "../../../dist/client/src/tests"
},
"references": [
{
Expand Down
2 changes: 1 addition & 1 deletion client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "../dist/client",
"outDir": "../dist/client/src",
"rootDir": "src",
"rootDirs": [
".",
Expand Down
2 changes: 1 addition & 1 deletion common/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const RunNgccRequest =
export interface GetTcbResponse {
uri: lsp.DocumentUri;
content: string;
selections: lsp.Range[]
selections: lsp.Range[];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint

}

export const IsInAngularProject =
Expand Down
10 changes: 5 additions & 5 deletions esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const defaultOptions = {
/** @type esbuild.BuildOptions */
const clientConfig = {
...defaultOptions,
entryPoints: ['dist/client/extension.js'],
entryPoints: ['dist/client/src/extension.js'],
outfile: 'dist/npm/index.js',
external: [
'fs',
Expand All @@ -29,8 +29,8 @@ const clientConfig = {
/** @type esbuild.BuildOptions */
const bannerConfig = {
...defaultOptions,
entryPoints: ['dist/banner/banner.js'],
outfile: 'dist/banner/banner.esbuild.js',
entryPoints: ['dist/server/src/banner.js'],
outfile: 'dist/server/src/banner.esbuild.js',
external: [
'path',
],
Expand All @@ -43,7 +43,7 @@ const bannerConfig = {
/** @type esbuild.BuildOptions */
const serverConfig = {
...defaultOptions,
entryPoints: ['dist/server/server.js'],
entryPoints: ['dist/server/src/server.js'],
outfile: 'dist/npm/server/index.js',
external: [
'fs',
Expand All @@ -61,7 +61,7 @@ async function build() {
await esbuild.build(bannerConfig);
await esbuild.build({
...serverConfig,
banner: {js: fs.readFileSync('dist/banner/banner.esbuild.js', 'utf8')},
banner: {js: fs.readFileSync('dist/server/src/banner.esbuild.js', 'utf8')},
});
} catch (e) {
console.error(e);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@
"onLanguage:html",
"onLanguage:typescript"
],
"main": "./dist/client/extension",
"main": "./dist/client/src/extension",
"scripts": {
"ng-dev": "cross-env TS_NODE_PROJECT=$PWD/.ng-dev/tsconfig.json TS_NODE_TRANSPILE_ONLY=1 node --no-warnings --loader ts-node/esm node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.mjs",
"compile": "tsc -b server/banner.tsconfig.json && tsc -b && node esbuild.js",
"compile": "tsc -b && node esbuild.js",
"compile:test": "tsc -b test.tsconfig.json",
"compile:integration": "tsc -b integration && yarn --cwd integration/project build",
"compile:syntaxes-test": "tsc -b syntaxes/test",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pushd dist/npm
# on peer dependency conflicts (like `tslint@6` not being supported by `tslint-eslint-rules`).
npm install --production --ignore-scripts --force

sed -i -e 's#./dist/client/extension#./index#' package.json
sed -i -e 's#./dist/client/src/extension#./index#' package.json
../../node_modules/.bin/vsce package

popd
16 changes: 0 additions & 16 deletions server/banner.tsconfig.json

This file was deleted.

8 changes: 8 additions & 0 deletions server/src/banner.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* @license
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint

* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

import {parseCommandLine} from './cmdline_utils';
import {resolveTsServer} from './version_provider';

Expand Down
2 changes: 1 addition & 1 deletion server/src/ngcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {fork} from 'child_process';
import {dirname, resolve} from 'path';

import {Version} from '../common/resolver';
import {Version} from '../../common/resolver';

import {resolveNgcc} from './version_provider';

Expand Down
6 changes: 3 additions & 3 deletions server/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import * as ts from 'typescript/lib/tsserverlibrary';
import {promisify} from 'util';
import * as lsp from 'vscode-languageserver/node';

import {ServerOptions} from '../common/initialize';
import {NgccProgressEnd, OpenOutputChannel, ProjectLanguageService, ProjectLoadingFinish, ProjectLoadingStart, SuggestStrictMode} from '../common/notifications';
import {GetComponentsWithTemplateFile, GetTcbParams, GetTcbRequest, GetTcbResponse, GetTemplateLocationForComponent, GetTemplateLocationForComponentParams, IsInAngularProject, IsInAngularProjectParams, RunNgccParams, RunNgccRequest} from '../common/requests';
import {ServerOptions} from '../../common/initialize';
import {NgccProgressEnd, OpenOutputChannel, ProjectLanguageService, ProjectLoadingFinish, ProjectLoadingStart, SuggestStrictMode} from '../../common/notifications';
import {GetComponentsWithTemplateFile, GetTcbParams, GetTcbRequest, GetTcbResponse, GetTemplateLocationForComponent, GetTemplateLocationForComponentParams, IsInAngularProject, IsInAngularProjectParams, RunNgccParams, RunNgccRequest} from '../../common/requests';

import {readNgCompletionData, tsCompletionEntryToLspCompletionItem} from './completion';
import {tsDiagnosticToLspDiagnostic} from './diagnostic';
Expand Down
2 changes: 1 addition & 1 deletion server/src/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../dist/server/tests",
"outDir": "../../../dist/server/src/tests",
"esModuleInterop": false
},
"references": [
Expand Down
2 changes: 1 addition & 1 deletion server/src/version_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as fs from 'fs';
import * as path from 'path';
import url from 'url';

import {NodeModule, resolve, Version} from '../common/resolver';
import {NodeModule, resolve, Version} from '../../common/resolver';

const MIN_TS_VERSION = '4.3';
const MIN_NG_VERSION = '13.0';
Expand Down
3 changes: 1 addition & 2 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "../dist/server",
"outDir": "../dist/server/src",
"rootDir": "src",
"rootDirs": [
".",
Expand All @@ -19,7 +19,6 @@
"src/*.ts"
],
"exclude": [
"src/banner.ts",
"node_modules"
]
}