Skip to content

Commit

Permalink
Merge magicspace changes (update)
Browse files Browse the repository at this point in the history
  • Loading branch information
vilicvane committed Oct 27, 2023
2 parents 2aea972 + b6f1a68 commit a248219
Show file tree
Hide file tree
Showing 11 changed files with 365 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"extends": ["plugin:@mufan/javascript"],
"overrides": [
{
"files": "**/*.{js,cjs}",
"files": "**/*.{js,mjs}",
"parserOptions": {
"sourceType": "script"
"sourceType": "module"
}
},
{
"files": "**/*.mjs",
"files": "**/*.cjs",
"parserOptions": {
"sourceType": "module"
"sourceType": "script"
}
}
]
Expand Down
2 changes: 2 additions & 0 deletions .magicspace/boilerplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"license": "MIT",
"author": "Chengdu Mufan Technology Co., Ltd.",
"defaultBranch": "master",
"packageManager": "yarn",
"type": "module",
"projects": [
{
"name": "general-composables",
Expand Down
8 changes: 7 additions & 1 deletion .magicspace/boilerplate.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
},
"license": {
"type": "boolean"
},
"discord": {
"type": "string"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -451,7 +454,10 @@
"type-32": {
"type": "object",
"required": [
"name"
"name",
"type",
"defaultBranch",
"packageManager"
],
"properties": {
"name": {
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.rulers": [80],
"files.associations": {
"boilerplate.json": "jsonc"
},
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
Expand Down
4 changes: 2 additions & 2 deletions general/src/composables/README.md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export default composable<ResolvedOptions>(options => {
];
});

interface Badge {
type Badge = {
title: string;
image: string;
url: string;
}
};

function buildBadges(
{
Expand Down
2 changes: 1 addition & 1 deletion general/src/composables/eslintrc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {JSONFileOptions} from '@magicspace/core';
import {json, composable} from '@magicspace/core';
import {composable, json} from '@magicspace/core';

import type {ResolvedOptions} from '../library/index.js';

Expand Down
9 changes: 5 additions & 4 deletions general/src/library/boilerplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,21 @@ export const Options = x.object({

export type Options = x.TypeOf<typeof Options>;

export interface ResolvedPackageOptions extends PackageOptions {
export type ResolvedPackageOptions = {
alias?: string;
resolvedDir: string;
packageJSONPath: string;
}
} & PackageOptions;

export interface ResolvedOptions extends Options, BoilerplateBuilderContext {
export type ResolvedOptions = {
defaultBranch: string;
packageManager: 'pnpm' | 'yarn';
packagesDir: string | undefined;
packages: ResolvedPackageOptions[];
packagesSortedByName: ResolvedPackageOptions[];
packagesSortedByAlias: ResolvedPackageOptions[];
}
} & Options &
BoilerplateBuilderContext;

export function resolveOptions<TOptions extends Options>(
options: TOptions,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"repository": "https://github.com/makeflow/mufan-code-boilerplates.git",
"author": "Chengdu Mufan Technology Co., Ltd.",
"license": "MIT",
"type": "module",
"exports": {
"./general": {
"types": "./general/bld/library/index.d.ts",
Expand Down Expand Up @@ -33,10 +34,10 @@
"typescript": "^5.2.2"
},
"devDependencies": {
"@mufan/eslint-plugin": "^0.2.5",
"@mufan/eslint-plugin": "^0.2.13",
"@types/lodash": "^4.14.159",
"@types/node": "^14.0.27",
"eslint": "^8.51.0",
"eslint": "^8.52.0",
"rimraf": "^5.0.5",
"run-in-every": "^0.2.0",
"yarn-deduplicate": "^6.0.2"
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/composables/package.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
import _ from 'lodash';

import type {
ResolvedPackageOptions,
PackageExports,
ResolvedOptions,
ResolvedPackageOptions,
ResolvedTypeScriptProjectOptions,
} from '../library/index.js';

Expand Down
17 changes: 8 additions & 9 deletions typescript/src/library/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ export const Options = GeneralOptions.extend({

export type Options = x.TypeOf<typeof Options>;

export interface ResolvedTypeScriptBuild {
export type ResolvedTypeScriptBuild = {
outDir: string;
module: BuildModuleType;
}
};

export interface ResolvedTypeScriptProjectOptions {
export type ResolvedTypeScriptProjectOptions = {
name: string;
srcDir: string;
bldDir: string;
Expand All @@ -162,14 +162,14 @@ export interface ResolvedTypeScriptProjectOptions {
entrances: string[];
package: ResolvedPackageOptions;
references: ResolvedTypeScriptProjectReference[] | undefined;
}
};

export type ResolvedPackageOptions = ResolvedGeneralPackageOptions &
PackageOptions;

export interface ResolvedTypeScriptProjectReference {
export type ResolvedTypeScriptProjectReference = {
path: string;
}
};

export type ResolvedOptions = Options &
ResolvedGeneralOptions & {
Expand Down Expand Up @@ -245,10 +245,9 @@ export function resolveOptions(
};
}

interface ResolvedTypeScriptProjectOptionsWithRawReferences
extends OmitValueOfKey<ResolvedTypeScriptProjectOptions, 'references'> {
type ResolvedTypeScriptProjectOptionsWithRawReferences = {
references?: GeneralTypeScriptProjectReferenceOptions[];
}
} & OmitValueOfKey<ResolvedTypeScriptProjectOptions, 'references'>;

export function buildResolvedTypeScriptProjectOptions(
{
Expand Down
Loading

0 comments on commit a248219

Please sign in to comment.