@bariskuran/create-base 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,15 +1,9 @@
1
1
  # @bariskuran/create-base
2
2
 
3
- Create a project from the Base starter template:
3
+ **An automated project setup tool for @bariskuran/base.**
4
4
 
5
- ```sh
6
- npm create @bariskuran/base
7
- ```
5
+ ## Documentation
8
6
 
9
- The setup asks for a workspace folder name, project name, title, description, URL, developer name, and contact details. It creates the project, installs dependencies with Yarn, and then you can start it with `yarn start`.
7
+ For features, usage instructions, and detailed documentation, visit:
10
8
 
11
- You can also run the initializer directly:
12
-
13
- ```sh
14
- npx @bariskuran/create-base
15
- ```
9
+ **[@bariskuran/base](https://www.npmjs.com/package/@bariskuran/base)**
@@ -100,7 +100,15 @@ async function collectAnswers(rl) {
100
100
  "Enter developer contact information.",
101
101
  );
102
102
 
103
- return { workspaceName, projectName, projectTitle, projectDescription, projectUrl, developerName, developerContact };
103
+ return {
104
+ workspaceName,
105
+ projectName,
106
+ projectTitle,
107
+ projectDescription,
108
+ projectUrl,
109
+ developerName,
110
+ developerContact,
111
+ };
104
112
  }
105
113
 
106
114
  function replaceEnvValue(envText, key, value) {
@@ -110,6 +118,20 @@ function replaceEnvValue(envText, key, value) {
110
118
  return envText.replace(matcher, `${key}=${encoded}`);
111
119
  }
112
120
 
121
+ function escapeMarkdownTableCell(value) {
122
+ return String(value)
123
+ .replaceAll("&", "&")
124
+ .replaceAll("<", "&lt;")
125
+ .replaceAll(">", "&gt;")
126
+ .replaceAll("|", "\\|")
127
+ .replace(/\r?\n/g, "<br>")
128
+ .replaceAll("`", "\\`");
129
+ }
130
+
131
+ function escapeMarkdownHeading(value) {
132
+ return String(value).replace(/[\\`*_{}\[\]<>#+.!|]/g, "\\$&").replace(/\r?\n/g, " ");
133
+ }
134
+
113
135
  async function writeCustomizedFiles(targetDir, answers) {
114
136
  if (!answers.skipped.has("package.json")) {
115
137
  const packagePath = path.join(targetDir, "package.json");
@@ -140,6 +162,25 @@ async function writeCustomizedFiles(targetDir, answers) {
140
162
  .replaceAll("[DEVELOPER_CONTACT]", answers.developerContact);
141
163
  await fs.promises.writeFile(licensePath, personalizedLicense);
142
164
  }
165
+
166
+ if (!answers.skipped.has("README.md")) {
167
+ const readmePath = path.join(targetDir, "README.md");
168
+ let readme = await fs.promises.readFile(readmePath, "utf8");
169
+ const replacements = {
170
+ "[PROJECT_TITLE_HEADING]": escapeMarkdownHeading(answers.projectTitle),
171
+ "[PROJECT_TITLE]": escapeMarkdownTableCell(answers.projectTitle),
172
+ "[PROJECT_DESCRIPTION]": escapeMarkdownTableCell(answers.projectDescription),
173
+ "[WORKSPACE_NAME]": escapeMarkdownTableCell(answers.workspaceName),
174
+ "[PROJECT_NAME]": escapeMarkdownTableCell(answers.projectName),
175
+ "[PROJECT_URL]": escapeMarkdownTableCell(answers.projectUrl),
176
+ "[DEVELOPER_NAME]": escapeMarkdownTableCell(answers.developerName),
177
+ "[DEVELOPER_CONTACT]": escapeMarkdownTableCell(answers.developerContact),
178
+ };
179
+ for (const [placeholder, value] of Object.entries(replacements)) {
180
+ readme = readme.replaceAll(placeholder, value);
181
+ }
182
+ await fs.promises.writeFile(readmePath, readme);
183
+ }
143
184
  }
144
185
 
145
186
  function promptOverwrite(relativePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bariskuran/create-base",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Create a project with @bariskuran/base.",
5
5
  "license": "MIT",
6
6
  "author": "Baris Kuran",
@@ -0,0 +1,46 @@
1
+ # [PROJECT_TITLE_HEADING]
2
+
3
+ > [PROJECT_DESCRIPTION]
4
+
5
+ ## Project details
6
+
7
+ | Field | Value |
8
+ | --- | --- |
9
+ | Workspace folder | `[WORKSPACE_NAME]` |
10
+ | Package name | `[PROJECT_NAME]` |
11
+ | Project title | [PROJECT_TITLE] |
12
+ | Project URL | `[PROJECT_URL]` |
13
+ | Developer | [DEVELOPER_NAME] |
14
+ | Contact | [DEVELOPER_CONTACT] |
15
+
16
+ ## Getting started
17
+
18
+ Dependencies are installed automatically when this project is created. Start the development server with:
19
+
20
+ ```sh
21
+ yarn start
22
+ ```
23
+
24
+ ## Available scripts
25
+
26
+ | Command | Description |
27
+ | --- | --- |
28
+ | `yarn start` | Start with the published `@bariskuran/base` package. |
29
+ | `yarn start:local` | Start with a local Base source checkout. |
30
+ | `yarn build` | Build with the published `@bariskuran/base` package. |
31
+ | `yarn build:local` | Build with a local Base source checkout. |
32
+ | `yarn autoFill` | Generate route files from the project sitemap. |
33
+ | `yarn images:index` | Index image catalogs under `src/imageCatalog` and `public/imageCatalog`. |
34
+
35
+ ## Project structure
36
+
37
+ - `public/imageCatalog` — public image catalog files.
38
+ - `src/assets` — project assets.
39
+ - `src/functions` — project functions.
40
+ - `src/hooks` — project hooks.
41
+ - `src/imageCatalog` — imported image catalog files.
42
+ - `src/views` — application pages.
43
+
44
+ ## License
45
+
46
+ This project uses the MIT License. See [LICENSE](./LICENSE).
@@ -4,7 +4,7 @@ const path = require("path");
4
4
 
5
5
  const MODE = process.argv[2]; // useGitBase | useLocalBase | buildLocal | buildRegistry
6
6
  const PKG_NAME = "@bariskuran/base";
7
- const BASE_SPEC = process.env.BASE_SPEC || `${PKG_NAME}@0.0.2`;
7
+ const BASE_SPEC = process.env.BASE_SPEC || `${PKG_NAME}@0.0.3`;
8
8
 
9
9
  function run(cmd) {
10
10
  execSync(cmd, { stdio: "inherit" });
@@ -19,12 +19,11 @@
19
19
  "images:index": "node node_modules/@bariskuran/base/src/libs/createImageCatalog/tools/base-image-index.cjs"
20
20
  },
21
21
  "dependencies": {
22
- "antd": "^6.3.0",
23
22
  "react": "19.2.3",
24
23
  "react-dom": "19.2.3",
25
24
  "react-router-dom": "7.12.0",
26
25
  "styled-components": "^6.3.8",
27
- "@bariskuran/base": "0.0.2"
26
+ "@bariskuran/base": "0.0.3"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@eslint/compat": "2.0.1",
File without changes
File without changes
File without changes
@@ -133,21 +133,6 @@ export const PROJECT_SETTINGS = {
133
133
  secondary: "#305A7A",
134
134
  },
135
135
  },
136
- makeAntdTheme: (t) => ({
137
- token: {
138
- colorPrimary: t.primary,
139
- colorSuccess: t.success,
140
- colorWarning: t.warning,
141
- colorError: t.error,
142
-
143
- colorText: t.foreground,
144
- colorTextBase: t.foreground,
145
-
146
- colorBgBase: t.background,
147
- colorBgContainer: t.background,
148
- colorBorder: t.grey,
149
- },
150
- }),
151
136
  },
152
137
 
153
138
  // BaseForm Settings
File without changes