-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,011 additions
and
151 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
import { PackageJson } from '../interface/PackageJson.js'; | ||
/** | ||
* A class for creating a package.json file for a project. | ||
*/ | ||
declare class PackageCreator { | ||
private packageJson; | ||
/** | ||
* Configuration for the Package.json. | ||
*/ | ||
config: any; | ||
/** | ||
* Default configuration for Package.json. | ||
*/ | ||
private static defaultConfig; | ||
/** | ||
* Initializes a new instance of the PackageCreator class. | ||
* @param {PackageJson} packageJson - The content to be written into package.json. | ||
* @param {PackageJson} customConfig - The content to be written into package.json. | ||
*/ | ||
constructor(packageJson: PackageJson); | ||
constructor(customConfig?: any); | ||
/** | ||
* Creates a package.json file in the specified directory. | ||
* @param {string} outputDir - The directory where package.json will be created. | ||
* Creates the directory if it does not exist. | ||
* @param outputDir - The directory where package.json will be created. | ||
*/ | ||
createPackageJson(outputDir: string): Promise<void>; | ||
/** | ||
* Ensures that the given directory exists. Creates it if it does not exist. | ||
* @param dirPath - The path of the directory to check and create. | ||
*/ | ||
private ensureDirectoryExists; | ||
} | ||
export default PackageCreator; |
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,12 @@ | ||
declare const packageConfig: { | ||
name: string; | ||
version: string; | ||
description: string; | ||
keywords: string; | ||
license: string; | ||
homepage: string; | ||
main: string; | ||
types: string; | ||
files: string[]; | ||
}; | ||
export default packageConfig; |
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,43 @@ | ||
"use strict"; | ||
// config/package.config.ts | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Copyright 2023 Scape Agency BV | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ============================================================================ | ||
// Constants | ||
// ============================================================================ | ||
const packageConfig = { | ||
name: "", | ||
version: "", | ||
description: "", | ||
keywords: "", | ||
license: "Apache-2.0", | ||
homepage: "https://www.scape.agency", | ||
main: "js/index", | ||
types: "js/index", | ||
// main: "js/index.js", | ||
// types: "js/index.d.ts", | ||
// main: 'index.js', | ||
files: [ | ||
"svg/**/*.svg", | ||
"js/**/*.d.ts", | ||
"js/**/*.{js,map}", | ||
"ts/**/*.ts", | ||
"css/**/*.{css,map}", | ||
"scss/**/*.scss", | ||
"font/**/*.{eot,otf,ttf,woff,woff2}", | ||
"!.DS_Store" | ||
] | ||
}; | ||
// ============================================================================ | ||
// Export | ||
// ============================================================================ | ||
exports.default = packageConfig; |
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
Oops, something went wrong.