create-absolutejs 0.1.8 → 0.1.10
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/dist/index.js +28 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -884,6 +884,16 @@ var absoluteAuthPlugin = {
|
|
|
884
884
|
latestVersion: "0.3.2",
|
|
885
885
|
value: "@absolutejs/auth"
|
|
886
886
|
};
|
|
887
|
+
var eslintAndPrettierDependencies = [
|
|
888
|
+
{
|
|
889
|
+
latestVersion: "9.27.0",
|
|
890
|
+
value: "eslint"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
latestVersion: "3.5.3",
|
|
894
|
+
value: "prettier"
|
|
895
|
+
}
|
|
896
|
+
];
|
|
887
897
|
var defaultDependencies = [
|
|
888
898
|
{
|
|
889
899
|
imports: [{ isPlugin: false, packageName: "Elysia" }],
|
|
@@ -1503,7 +1513,8 @@ var createPackageJson = ({
|
|
|
1503
1513
|
plugins,
|
|
1504
1514
|
useTailwind,
|
|
1505
1515
|
latest,
|
|
1506
|
-
frontendConfigurations
|
|
1516
|
+
frontendConfigurations,
|
|
1517
|
+
codeQualityTool
|
|
1507
1518
|
}) => {
|
|
1508
1519
|
const s = Y2();
|
|
1509
1520
|
latest && s.start("Resolving package versions…");
|
|
@@ -1522,6 +1533,11 @@ var createPackageJson = ({
|
|
|
1522
1533
|
continue;
|
|
1523
1534
|
dependencies[meta.value] = resolveVersion(meta.value, meta.latestVersion);
|
|
1524
1535
|
}
|
|
1536
|
+
if (codeQualityTool === "eslint+prettier") {
|
|
1537
|
+
eslintAndPrettierDependencies.forEach((dep) => {
|
|
1538
|
+
devDependencies[dep.value] = resolveVersion(dep.value, dep.latestVersion);
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1525
1541
|
if (useTailwind) {
|
|
1526
1542
|
devDependencies["autoprefixer"] = resolveVersion("autoprefixer", "10.4.21");
|
|
1527
1543
|
devDependencies["postcss"] = resolveVersion("postcss", "8.5.3");
|
|
@@ -1646,9 +1662,12 @@ var createServerFile = ({
|
|
|
1646
1662
|
}
|
|
1647
1663
|
});
|
|
1648
1664
|
uniqueDependencies.sort((firstDependency, secondDependency) => firstDependency.value.localeCompare(secondDependency.value));
|
|
1649
|
-
const importLines = uniqueDependencies.flatMap((dependency) =>
|
|
1650
|
-
|
|
1651
|
-
|
|
1665
|
+
const importLines = uniqueDependencies.flatMap((dependency) => {
|
|
1666
|
+
const importsArray = dependency.imports ?? [];
|
|
1667
|
+
return importsArray.length > 0 ? [
|
|
1668
|
+
`import { ${importsArray.map((importEntry) => importEntry.packageName).join(", ")} } from '${dependency.value}';`
|
|
1669
|
+
] : [];
|
|
1670
|
+
});
|
|
1652
1671
|
const absoluteImportLineIndex = importLines.findIndex((importLine) => importLine.includes("from '@absolutejs/absolute'"));
|
|
1653
1672
|
if (absoluteImportLineIndex >= 0) {
|
|
1654
1673
|
const originalImportLine = importLines[absoluteImportLineIndex];
|
|
@@ -1667,9 +1686,9 @@ var createServerFile = ({
|
|
|
1667
1686
|
const reactImportSource = isSingleFrontend ? "../frontend/pages/ReactExample" : "../frontend/react/pages/ReactExample";
|
|
1668
1687
|
importLines.push(`import { ReactExample } from '${reactImportSource}';`);
|
|
1669
1688
|
}
|
|
1670
|
-
const useStatements = uniqueDependencies.flatMap((dependency) => dependency.imports).filter((importEntry) => importEntry
|
|
1671
|
-
if (importEntry
|
|
1672
|
-
return `.use(${importEntry
|
|
1689
|
+
const useStatements = uniqueDependencies.flatMap((dependency) => dependency.imports).filter((importEntry) => importEntry?.isPlugin).map((importEntry) => {
|
|
1690
|
+
if (importEntry?.config === undefined) {
|
|
1691
|
+
return `.use(${importEntry?.packageName})`;
|
|
1673
1692
|
}
|
|
1674
1693
|
if (importEntry.config === null) {
|
|
1675
1694
|
return `.use(${importEntry.packageName}())`;
|
|
@@ -1679,7 +1698,7 @@ var createServerFile = ({
|
|
|
1679
1698
|
const manifestOptions = [
|
|
1680
1699
|
`buildDirectory: '${buildDirectory}'`,
|
|
1681
1700
|
`assetsDirectory: '${assetsDirectory}'`,
|
|
1682
|
-
...frontendConfigurations.map((configuration) => configuration.directory ? `${configuration.name}Directory: './src/frontend/${configuration.directory}'` :
|
|
1701
|
+
...frontendConfigurations.map((configuration) => configuration.directory ? `${configuration.name}Directory: './src/frontend/${configuration.directory}'` : `${configuration.name}Directory: './src/frontend/'`).filter((option) => option !== ""),
|
|
1683
1702
|
tailwind ? `tailwind: ${JSON.stringify(tailwind)}` : ""
|
|
1684
1703
|
];
|
|
1685
1704
|
const buildStatement = `const manifest = await build({
|
|
@@ -2064,6 +2083,7 @@ var scaffold = ({
|
|
|
2064
2083
|
});
|
|
2065
2084
|
createPackageJson({
|
|
2066
2085
|
authProvider,
|
|
2086
|
+
codeQualityTool,
|
|
2067
2087
|
frontendConfigurations,
|
|
2068
2088
|
latest,
|
|
2069
2089
|
plugins,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-absolutejs",
|
|
3
3
|
"description": "A CLI tool to create a new AbsoluteJS project",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"license": "CC BY-NC 4.0",
|
|
6
6
|
"author": "Alex Kahn",
|
|
7
7
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"autoprefixer": "10.4.21",
|
|
31
31
|
"drizzle-kit": "0.31.1",
|
|
32
32
|
"drizzle-orm": "0.41.0",
|
|
33
|
-
"eslint": "9.
|
|
33
|
+
"eslint": "9.27.0",
|
|
34
34
|
"eslint-plugin-absolute": "0.0.3",
|
|
35
35
|
"eslint-plugin-import": "2.31.0",
|
|
36
36
|
"eslint-plugin-promise": "7.2.1",
|