xpine 0.0.52 → 0.0.56
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 +23 -1
- package/dist/index.js +22 -2
- package/dist/src/scripts/build.d.ts.map +1 -1
- package/dist/src/scripts/xpine-build.js +22 -2
- package/dist/src/scripts/xpine-dev.js +22 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -453,4 +453,26 @@ export default {
|
|
|
453
453
|
}
|
|
454
454
|
]
|
|
455
455
|
}
|
|
456
|
-
```
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Pages public scripts
|
|
459
|
+
|
|
460
|
+
If you need to add a one-off public script, add a folder in the `/public/scripts` directory called `pages`.
|
|
461
|
+
|
|
462
|
+
For example: `/public/scripts/pages/my-awesome-page/sw.js`
|
|
463
|
+
|
|
464
|
+
Which will result in the public path of `/scripts/pages/my-awesome-page/sw.js`
|
|
465
|
+
|
|
466
|
+
Any `.js` or `.ts` file in this directory will be added as-is to the `public` folder and can be used in a script tag:
|
|
467
|
+
|
|
468
|
+
```
|
|
469
|
+
<script src="/scripts/pages/my-awesome-page/sw.js" />
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Standalone public files
|
|
473
|
+
|
|
474
|
+
If you need to add a file that needs direct routing, like a service worker file, add a folder in the `/public` directory called `standalone`.
|
|
475
|
+
|
|
476
|
+
For example : `/public/standalone/my-page/sw.js`
|
|
477
|
+
|
|
478
|
+
Which will result in the public path of `/my-page/sw.js`
|
package/dist/index.js
CHANGED
|
@@ -884,10 +884,14 @@ async function buildClientSideFiles(alpineDataFiles = [], isDev2, tempClientSide
|
|
|
884
884
|
const tempFilePath = path6.join(config.distTempFolder, tempClientSidePath || "./app.ts");
|
|
885
885
|
fs7.ensureFileSync(tempFilePath);
|
|
886
886
|
const pagesScriptsGlob = config.publicDir + "/scripts/pages/**/*.{js,ts}";
|
|
887
|
+
const standaloneFolderGlob = config.publicDir + "/standalone/**/*.*";
|
|
887
888
|
const clientFiles = globSync3(
|
|
888
889
|
config.publicDir + "/**/*.{js,ts}",
|
|
889
890
|
{
|
|
890
|
-
ignore:
|
|
891
|
+
ignore: [
|
|
892
|
+
pagesScriptsGlob,
|
|
893
|
+
standaloneFolderGlob
|
|
894
|
+
]
|
|
891
895
|
}
|
|
892
896
|
);
|
|
893
897
|
convertEntryPointsToSingleFile(alpineDataFiles.concat(clientFiles), tempFilePath);
|
|
@@ -977,8 +981,12 @@ async function buildAlpineDataFile(componentData, dataFiles, bundleID) {
|
|
|
977
981
|
}
|
|
978
982
|
async function buildPublicFolderSymlinks() {
|
|
979
983
|
const files = globSync3(config.publicDir + "/**/*.*", {
|
|
980
|
-
ignore:
|
|
984
|
+
ignore: [
|
|
985
|
+
"/**/*.{css,js,ts,tsx,jsx}",
|
|
986
|
+
"/**/standalone/**/*.*"
|
|
987
|
+
]
|
|
981
988
|
});
|
|
989
|
+
const standaloneFiles = globSync3(config.publicDir + "/standalone/**/*.*");
|
|
982
990
|
for (const file of files) {
|
|
983
991
|
try {
|
|
984
992
|
const newPath = file.replace(config.srcDir, config.distDir);
|
|
@@ -990,6 +998,18 @@ async function buildPublicFolderSymlinks() {
|
|
|
990
998
|
} catch {
|
|
991
999
|
}
|
|
992
1000
|
}
|
|
1001
|
+
for (const file of standaloneFiles) {
|
|
1002
|
+
try {
|
|
1003
|
+
const newPath = file.replace(config.srcDir, config.distDir);
|
|
1004
|
+
const splitNewPath = newPath.split("/").filter((item) => item !== "standalone");
|
|
1005
|
+
const updatedNewPath = splitNewPath.join("/");
|
|
1006
|
+
splitNewPath.pop();
|
|
1007
|
+
const newDir = splitNewPath.join("/");
|
|
1008
|
+
fs7.ensureDirSync(newDir);
|
|
1009
|
+
fs7.symlinkSync(file, updatedNewPath);
|
|
1010
|
+
} catch {
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
993
1013
|
}
|
|
994
1014
|
async function logSize(pathName, type, validExtensions = [".js", ".css"]) {
|
|
995
1015
|
const files = globSync3(pathName + "/**/*" + (type === "css" ? ".css" : ""));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAA2B,aAAa,EAAE,MAAM,aAAa,CAAC;AAajF,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,iBAgDhD;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,UAAU,EAA2B,aAAa,EAAE,MAAM,aAAa,CAAC;AAajF,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,iBAgDhD;AA4JD,wBAAsB,yBAAyB,kBAiC9C;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,WAAkB,iBAa9F;AAED,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,aAAa,EAAE,iBAezE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,iBA2FpI;AAED,wBAAgB,gCAAgC,CAAC,kBAAkB,EAAE,MAAM,EAAE,qBAAqB,CAAC,EAAE,MAAM,EAAE,UAe5G;AAED,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CAQxE;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAA;AAGD,wBAAsB,eAAe,CAAC,aAAa,EAAE,aAAa,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,iBAoDpF;AAED,wBAAsB,YAAY,kBA4CjC"}
|
|
@@ -657,10 +657,14 @@ async function buildClientSideFiles(alpineDataFiles = [], isDev3, tempClientSide
|
|
|
657
657
|
const tempFilePath = path5.join(config.distTempFolder, tempClientSidePath || "./app.ts");
|
|
658
658
|
fs7.ensureFileSync(tempFilePath);
|
|
659
659
|
const pagesScriptsGlob = config.publicDir + "/scripts/pages/**/*.{js,ts}";
|
|
660
|
+
const standaloneFolderGlob = config.publicDir + "/standalone/**/*.*";
|
|
660
661
|
const clientFiles = globSync3(
|
|
661
662
|
config.publicDir + "/**/*.{js,ts}",
|
|
662
663
|
{
|
|
663
|
-
ignore:
|
|
664
|
+
ignore: [
|
|
665
|
+
pagesScriptsGlob,
|
|
666
|
+
standaloneFolderGlob
|
|
667
|
+
]
|
|
664
668
|
}
|
|
665
669
|
);
|
|
666
670
|
convertEntryPointsToSingleFile(alpineDataFiles.concat(clientFiles), tempFilePath);
|
|
@@ -750,8 +754,12 @@ async function buildAlpineDataFile(componentData, dataFiles, bundleID) {
|
|
|
750
754
|
}
|
|
751
755
|
async function buildPublicFolderSymlinks() {
|
|
752
756
|
const files = globSync3(config.publicDir + "/**/*.*", {
|
|
753
|
-
ignore:
|
|
757
|
+
ignore: [
|
|
758
|
+
"/**/*.{css,js,ts,tsx,jsx}",
|
|
759
|
+
"/**/standalone/**/*.*"
|
|
760
|
+
]
|
|
754
761
|
});
|
|
762
|
+
const standaloneFiles = globSync3(config.publicDir + "/standalone/**/*.*");
|
|
755
763
|
for (const file of files) {
|
|
756
764
|
try {
|
|
757
765
|
const newPath = file.replace(config.srcDir, config.distDir);
|
|
@@ -763,6 +771,18 @@ async function buildPublicFolderSymlinks() {
|
|
|
763
771
|
} catch {
|
|
764
772
|
}
|
|
765
773
|
}
|
|
774
|
+
for (const file of standaloneFiles) {
|
|
775
|
+
try {
|
|
776
|
+
const newPath = file.replace(config.srcDir, config.distDir);
|
|
777
|
+
const splitNewPath = newPath.split("/").filter((item) => item !== "standalone");
|
|
778
|
+
const updatedNewPath = splitNewPath.join("/");
|
|
779
|
+
splitNewPath.pop();
|
|
780
|
+
const newDir = splitNewPath.join("/");
|
|
781
|
+
fs7.ensureDirSync(newDir);
|
|
782
|
+
fs7.symlinkSync(file, updatedNewPath);
|
|
783
|
+
} catch {
|
|
784
|
+
}
|
|
785
|
+
}
|
|
766
786
|
}
|
|
767
787
|
async function logSize(pathName, type, validExtensions = [".js", ".css"]) {
|
|
768
788
|
const files = globSync3(pathName + "/**/*" + (type === "css" ? ".css" : ""));
|
|
@@ -664,10 +664,14 @@ async function buildClientSideFiles(alpineDataFiles = [], isDev2, tempClientSide
|
|
|
664
664
|
const tempFilePath = path5.join(config.distTempFolder, tempClientSidePath || "./app.ts");
|
|
665
665
|
fs7.ensureFileSync(tempFilePath);
|
|
666
666
|
const pagesScriptsGlob = config.publicDir + "/scripts/pages/**/*.{js,ts}";
|
|
667
|
+
const standaloneFolderGlob = config.publicDir + "/standalone/**/*.*";
|
|
667
668
|
const clientFiles = globSync3(
|
|
668
669
|
config.publicDir + "/**/*.{js,ts}",
|
|
669
670
|
{
|
|
670
|
-
ignore:
|
|
671
|
+
ignore: [
|
|
672
|
+
pagesScriptsGlob,
|
|
673
|
+
standaloneFolderGlob
|
|
674
|
+
]
|
|
671
675
|
}
|
|
672
676
|
);
|
|
673
677
|
convertEntryPointsToSingleFile(alpineDataFiles.concat(clientFiles), tempFilePath);
|
|
@@ -757,8 +761,12 @@ async function buildAlpineDataFile(componentData, dataFiles, bundleID) {
|
|
|
757
761
|
}
|
|
758
762
|
async function buildPublicFolderSymlinks() {
|
|
759
763
|
const files = globSync3(config.publicDir + "/**/*.*", {
|
|
760
|
-
ignore:
|
|
764
|
+
ignore: [
|
|
765
|
+
"/**/*.{css,js,ts,tsx,jsx}",
|
|
766
|
+
"/**/standalone/**/*.*"
|
|
767
|
+
]
|
|
761
768
|
});
|
|
769
|
+
const standaloneFiles = globSync3(config.publicDir + "/standalone/**/*.*");
|
|
762
770
|
for (const file of files) {
|
|
763
771
|
try {
|
|
764
772
|
const newPath = file.replace(config.srcDir, config.distDir);
|
|
@@ -770,6 +778,18 @@ async function buildPublicFolderSymlinks() {
|
|
|
770
778
|
} catch {
|
|
771
779
|
}
|
|
772
780
|
}
|
|
781
|
+
for (const file of standaloneFiles) {
|
|
782
|
+
try {
|
|
783
|
+
const newPath = file.replace(config.srcDir, config.distDir);
|
|
784
|
+
const splitNewPath = newPath.split("/").filter((item) => item !== "standalone");
|
|
785
|
+
const updatedNewPath = splitNewPath.join("/");
|
|
786
|
+
splitNewPath.pop();
|
|
787
|
+
const newDir = splitNewPath.join("/");
|
|
788
|
+
fs7.ensureDirSync(newDir);
|
|
789
|
+
fs7.symlinkSync(file, updatedNewPath);
|
|
790
|
+
} catch {
|
|
791
|
+
}
|
|
792
|
+
}
|
|
773
793
|
}
|
|
774
794
|
async function logSize(pathName, type, validExtensions = [".js", ".css"]) {
|
|
775
795
|
const files = globSync3(pathName + "/**/*" + (type === "css" ? ".css" : ""));
|