-
-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose generateManifest as reusable function (#2411)
* Expose as module * Update typescript version * Make typescript compilation a prebuild command * Update package.json scripts * Add config for declarations * Refacor code * Refactor project * Format code * Refactor project * Update project structure * Update imports * Update comment * Update dependency to extension module * Adjust imports * Update import * Enable minification * Fix issue with hash * Update exposed core modules * Minor improvements * Update comment * Update ignore files * Update imports * Update module structure * Move tests into core * Update prepublish script * Update npm scripts * Update prepublish script * Update version * Update version * Fix unit tests * Update hash generation * Update sheriff config * Update types * Update custom file paths * Update IconPack types * Update project * Update types * Update reference to readme * Update customIconPaths * Format code
- Loading branch information
Showing
129 changed files
with
1,923 additions
and
1,750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import esbuild from "esbuild"; | ||
import config from "./esbuild.config"; | ||
import esbuild from 'esbuild'; | ||
import config from './esbuild.config'; | ||
|
||
esbuild.build(config).catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
import type { BuildOptions } from "esbuild"; | ||
import type { BuildOptions } from 'esbuild'; | ||
|
||
const config: BuildOptions = { | ||
entryPoints: ["./src/extension.ts", "./src/web/extension.ts"], | ||
entryPoints: [ | ||
'./src/extension/desktop/extension.ts', | ||
'./src/extension/web/extension.ts', | ||
'./src/module/index.ts', | ||
], | ||
minify: false, | ||
bundle: true, | ||
platform: "node", | ||
target: "node12", | ||
outdir: "./dist", | ||
outbase: "./src", | ||
platform: 'node', | ||
target: 'node12', | ||
outdir: './dist', | ||
outbase: './src', | ||
outExtension: { | ||
".js": ".cjs", | ||
'.js': '.cjs', | ||
}, | ||
format: "cjs", | ||
external: ["vscode"], | ||
format: 'cjs', | ||
external: ['vscode'], | ||
loader: { | ||
".ts": "ts", | ||
".js": "js", | ||
'.ts': 'ts', | ||
'.js': 'js', | ||
}, | ||
logLevel: "info", | ||
logLevel: 'info', | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import esbuild from "esbuild"; | ||
import config from "./esbuild.config"; | ||
import esbuild from 'esbuild'; | ||
import config from './esbuild.config'; | ||
|
||
try { | ||
const context = await esbuild.context(config); | ||
await context.watch(); | ||
} catch (e) { | ||
console.error(e); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[test] | ||
# Load these modules before running tests. | ||
preload = ["./src/tests/mocks"] | ||
preload = ["./src/core/tests/mocks"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { type SheriffConfig } from '@softarc/sheriff-core'; | ||
|
||
export const sheriffConfig: SheriffConfig = { | ||
entryFile: 'src/module/index.ts', | ||
version: 1, | ||
autoTagging: true, | ||
tagging: { | ||
'src/extension': 'extension', | ||
'src/core': 'core', | ||
'src/module': 'module', | ||
}, | ||
depRules: { | ||
root: ['core'], | ||
extension: ['core'], | ||
module: ['core'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Architecture | ||
|
||
The project is structured in a way that the core logic is separated from the extension logic. The core logic is used for the generation of the icon manifest, for the definition of the icon associations and for the translation logic. The extension logic is used for the interaction with the VS Code extension API (e.g. getting the user configuration, providing commands etc.). | ||
|
||
```text | ||
📦 src | ||
┣ 📂 core <-- Logic for generating icon manifest, icon associations, translation logic, models, tests | ||
┣ 📂 extension <-- Code which uses VS Code extension API (get user config, providing commands etc) | ||
┣ 📂 module <-- Control which part of the core is exposed to the npm module | ||
┗ 📂 scripts <-- Scripts which are executed during build time (in the package.json) | ||
``` | ||
|
||
By using the [sheriff](https://github.com/softarc-consulting/sheriff) library dependencies between the modules can be verified. The command `bun run verify` checks if the imports between the modules are allowed. For instance it's not allowed, that any of the other modules imports something from the `extension` module because of it's dependency to `vscode`. But the `extension` module itself is allowed to import from `core`. | ||
|
||
This is realized by using the dependency rules in the sheriff.config.ts file: | ||
|
||
```ts | ||
depRules: { | ||
root: ['core'], | ||
extension: ['core'], | ||
module: ['core'], | ||
} | ||
``` | ||
|
||
## Npm module | ||
|
||
The npm module exposes some of the functions so that the icon manifest can be generated programmatically. More information can be found in the [README.md](./module/README.md) of the module. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.