You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build from the branch and ran into a couple of challenges that I need to ask about.
I'm building from source extracted from the CI4 branch.
The first question is why was the Application folder renamed to App. That change broke the scripts I used to use for the manual build. The second question is do I need to change my build procedure? It's a couple of years old. It was simple but worked back then. :-)
composer install
npm install
grunt --force
I also see that nearly all of the folder names were changed. Seems like the world has changed while I slept and that the scripts I was using must now be obsolete because the build scripts are still referring to the old folder names.
Yeah, sorry about the changes. They are all CI4 related. In CI4 everything is namespaced, which means all the structural changes and moving things around are so that the application will work in CI4. I'm sure it would be possible to "customize" the framework, but it would make it practically impossible to upgrade from one CI4 version to the next. Unfortunately it means that you'll need to modify the scripts.
@SteveIreland I have been doing the same build procedure, but when I run npm install I get some errors:
PS C:\Users\objec\PhpstormProjects\opensourcepos> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/grunt
npm ERR! dev grunt@"^1.5.3" from the root project
npm ERR! peer grunt@">=0.4.0" from [email protected]
npm ERR! node_modules/grunt-bower-concat
npm ERR! dev grunt-bower-concat@"^1.0.0" from the root project
npm ERR! 5 more (grunt-composer, grunt-contrib-clean, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer grunt@"~0.4.1" from [email protected]
npm ERR! node_modules/grunt-license-bower
npm ERR! dev grunt-license-bower@"~1.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/grunt
npm ERR! peer grunt@"~0.4.1" from [email protected]
npm ERR! node_modules/grunt-license-bower
npm ERR! dev grunt-license-bower@"~1.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\objec\AppData\Local\npm-cache\_logs\2023-02-05T11_58_10_117Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\objec\AppData\Local\npm-cache\_logs\2023-02-05T11_58_10_117Z-debug-0.log
And of course since those are related to grunt, when I run grunt --force I get problems:
grunt --force
grunt-cli: The grunt command line interface (v1.4.3)
Fatal error: Unable to find local grunt.
If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:
https://gruntjs.com/getting-started
I suspect that there are problems with the configuration files for npm that is causing the issue. That said, I'm still able to debug using xdebug, write code and test it at the browser level. @jekkos any thoughts on these npm errors?
I also see that nearly all of the folder names were changed. Seems like the world has changed while I slept and that the scripts I was using must now be obsolete because the build scripts are still referring to the old folder names.
Yeah, that's why I keep advocating to freeze changes on the master. CI4 has involved touching just about every file. Let me know what questions you have about things. The CI4 documentation has improved significantly. Also, other than locations and ci4 related function syntax, the shape of the MVC project is the same.
@SteveIreland I'm frequently pushing commits to ci4-upgrade, so make sure you do a fetch and pull each time you sit down to it. Also, let's make sure to coordinate if you plan to take any part of the work, so we don't accidentally double-up efforts.
@objecttothis The only way I have been able to get grunt to work is if I use the following.
npm install --only=dev The windows command displays lots of deprecated errors and the done but with errors but grunt runs fine afterwards. Hope this is usefull.
@objecttothis The only way I have been able to get grunt to work is if I use the following. npm install --only=dev The windows command displays lots of deprecated errors and the done but with errors but grunt runs fine afterwards. Hope this is usefull.
When I do this with the ci4-upgrade branch I get
npm WARN invalid config only="dev" set in command line options
npm WARN invalid config Must be one of: null, prod, production
No worries. If someone doesn't pick it up, eventually I'll get to it, but right now I'm working on functionality of the code, so as long as I don't need grunt, someone else can have it.
Now that I know I'm not in the wrong ball-park on this, I'll fiddle with the build scripts to see if I can get it working. I've been monitoring your commits so I am well aware of needing to fetch before I even look at it. :-) Thanks again for taking this epic effort on.
Now that I know I'm not in the wrong ball-park on this, I'll fiddle with the build scripts to see if I can get it working. I've been monitoring your commits so I am well aware of needing to fetch before I even look at it. :-) Thanks again for taking this epic effort on.
@objecttothis Was there a CI4 requirement that required dropping the database folder? (The one that contains the tables.sql and constraints.sql scripts)? I saw on another thread where there was a discussion about extending the migration to begin at the 2.x version of the system so I'm thinking that dropping the folder must have been accidental.
After restoring the document folder and correcting the folder names in the configuration files I was able to complete a build. After setting up the test environment I got this cute message. Did you want me to submit a pull request for the changes I made? I'm going to do a bit more testing to make sure I didn't miss anything.
I was so bold as to try to log in. :-) There seems to be a lot of errors in the area of the migration scripts - shouldn't be too hard to resolve - it's just going to take some time. This is an area I have some competence in - would you like me to dive into it or do you already have something in progress?
@objecttothis Was there a CI4 requirement that required dropping the database folder? (The one that contains the tables.sql and constraints.sql scripts)? I saw on another thread where there was a discussion about extending the migration to begin at the 2.x version of the system so I'm thinking that dropping the folder must have been accidental.
Yep, it is now in \app\Database\. Technically we can place tables.sql, constraints.sql and database.sql anywhere we want since CI4 is not dependent on them existing, but IMO it makes no sense to have \database\ and \app\Database.
tables.sql, constraints.sql and database.sql were in \app\Database\Migrations\sqlscripts\ but they are not technically migrations, so I just pushed a commit moving them to \app\Database. All the pre-3.0.2 migrations that were in \database\ are now in \app\Database\Migrations\sqlscripts\pre-3.0.2\. IMO that's the best place for them because A- we may soon incorporate them into migrations and B- they are sql scripts and migrations, so having them elsewhere seems redundant.... but perhaps there is something I'm not seeing.
I came across this error while trying to load the Cashups form. It also does not like the ways files are loaded on line 1.
"title": "ErrorException",
"type": "ErrorException",
"code": 500,
"message": "Array to string conversion",
"file": "C:\wamp64\www\newci4\app\Views\partial\datepicker_locale.php",
"line": 28,
An array is being passed when it wants a string. Likely needs to have a parameter in a function call changed from have_fun($foo); to have_fun($foo['bar']);
I came across this issue today.
CRITICAL - 2023-03-17 23:54:51 --> A void function must not return a value
in APPPATH\Controllers\Suppliers.php on line 100.
The build is running again, Currently on CI4 branch we have this issue
Warning: Task "package" not found.� Use --force to continue.
Aborted due to warnings.
The command "docker run --rm -it -v $(pwd):/app -w /app opensourcepos/node-grunt-bower sh -c "npm install && bower install && grunt package"" exited with 3.
I'll need to take a further look to see how this needs to be fixed
I'm going to go ahead and close this issue since the build for development purposes is working. I'm going to open up a new ticket for CI4 to migrate to a Webpack flavored build. I spent the weekend working on it and although I've made some progress there is a lot of detailed crafting that is required.
Ok I bumped the node version in the buildbox, but it seems that composer is also being started from node. I have made some local changes to separate those as the docker contains only node/grunt/bower and not composer, which comes from the official php repo.
Activity
objecttothis commentedon Feb 5, 2023
Yeah, sorry about the changes. They are all CI4 related. In CI4 everything is namespaced, which means all the structural changes and moving things around are so that the application will work in CI4. I'm sure it would be possible to "customize" the framework, but it would make it practically impossible to upgrade from one CI4 version to the next. Unfortunately it means that you'll need to modify the scripts.
objecttothis commentedon Feb 5, 2023
@SteveIreland I have been doing the same build procedure, but when I run
npm installI get some errors:And of course since those are related to grunt, when I run
grunt --forceI get problems:I suspect that there are problems with the configuration files for npm that is causing the issue. That said, I'm still able to debug using xdebug, write code and test it at the browser level. @jekkos any thoughts on these npm errors?
objecttothis commentedon Feb 5, 2023
Yeah, that's why I keep advocating to freeze changes on the master. CI4 has involved touching just about every file. Let me know what questions you have about things. The CI4 documentation has improved significantly. Also, other than locations and ci4 related function syntax, the shape of the MVC project is the same.
objecttothis commentedon Feb 5, 2023
@SteveIreland I'm frequently pushing commits to ci4-upgrade, so make sure you do a fetch and pull each time you sit down to it. Also, let's make sure to coordinate if you plan to take any part of the work, so we don't accidentally double-up efforts.
odiea commentedon Feb 5, 2023
@objecttothis The only way I have been able to get grunt to work is if I use the following.
npm install --only=dev The windows command displays lots of deprecated errors and the done but with errors but grunt runs fine afterwards. Hope this is usefull.
objecttothis commentedon Feb 5, 2023
When I do this with the ci4-upgrade branch I get
before it gives the same errors about grunt
odiea commentedon Feb 5, 2023
Sorry I guess that I am not updated to the latest versions.
objecttothis commentedon Feb 5, 2023
No worries. If someone doesn't pick it up, eventually I'll get to it, but right now I'm working on functionality of the code, so as long as I don't need grunt, someone else can have it.
SteveIreland commentedon Feb 5, 2023
Now that I know I'm not in the wrong ball-park on this, I'll fiddle with the build scripts to see if I can get it working. I've been monitoring your commits so I am well aware of needing to fetch before I even look at it. :-) Thanks again for taking this epic effort on.
objecttothis commentedon Feb 5, 2023
Super, thanks. Let me know if you get stuck.
SteveIreland commentedon Feb 5, 2023
@objecttothis Was there a CI4 requirement that required dropping the database folder? (The one that contains the tables.sql and constraints.sql scripts)? I saw on another thread where there was a discussion about extending the migration to begin at the 2.x version of the system so I'm thinking that dropping the folder must have been accidental.
SteveIreland commentedon Feb 6, 2023
After restoring the document folder and correcting the folder names in the configuration files I was able to complete a build. After setting up the test environment I got this cute message. Did you want me to submit a pull request for the changes I made? I'm going to do a bit more testing to make sure I didn't miss anything.
SteveIreland commentedon Feb 6, 2023
Okay, tweaked a few more things and got to the login page. I'm feeling optimistic!
SteveIreland commentedon Feb 6, 2023
I was so bold as to try to log in. :-) There seems to be a lot of errors in the area of the migration scripts - shouldn't be too hard to resolve - it's just going to take some time. This is an area I have some competence in - would you like me to dive into it or do you already have something in progress?
objecttothis commentedon Feb 6, 2023
Yep, it is now in
\app\Database\. Technically we can place tables.sql, constraints.sql and database.sql anywhere we want since CI4 is not dependent on them existing, but IMO it makes no sense to have \database\ and \app\Database.tables.sql, constraints.sql and database.sql were in \app\Database\Migrations\sqlscripts\ but they are not technically migrations, so I just pushed a commit moving them to \app\Database. All the pre-3.0.2 migrations that were in \database\ are now in
\app\Database\Migrations\sqlscripts\pre-3.0.2\. IMO that's the best place for them because A- we may soon incorporate them into migrations and B- they are sql scripts and migrations, so having them elsewhere seems redundant.... but perhaps there is something I'm not seeing.88 remaining items
odiea commentedon Mar 12, 2023
Has anyone else got the tables to show? Or the forms to show in the Modals?
odiea commentedon Mar 15, 2023
I came across this error while trying to load the Cashups form. It also does not like the ways files are loaded on line 1.
"title": "ErrorException",
"type": "ErrorException",
"code": 500,
"message": "Array to string conversion",
"file": "C:\wamp64\www\newci4\app\Views\partial\datepicker_locale.php",
"line": 28,
objecttothis commentedon Mar 16, 2023
An array is being passed when it wants a string. Likely needs to have a parameter in a function call changed from
have_fun($foo);tohave_fun($foo['bar']);odiea commentedon Mar 17, 2023
A new one is saving a new form use getsave update a form is looking for postSave
odiea commentedon Mar 18, 2023
I came across this issue today.
CRITICAL - 2023-03-17 23:54:51 --> A void function must not return a value
in APPPATH\Controllers\Suppliers.php on line 100.
objecttothis commentedon Mar 18, 2023
@odiea what is the function on that line?
Lets move this conversation to the PR. It's off topic from the original issue so it makes it difficult to find later.
jekkos commentedon Mar 25, 2023
The build is running again, Currently on CI4 branch we have this issue
I'll need to take a further look to see how this needs to be fixed
SteveIreland commentedon Apr 30, 2023
I'm going to go ahead and close this issue since the build for development purposes is working. I'm going to open up a new ticket for CI4 to migrate to a Webpack flavored build. I spent the weekend working on it and although I've made some progress there is a lot of detailed crafting that is required.
jekkos commentedon Apr 30, 2023
Good news @SteveIreland , thanks for all the hard work
jekkos commentedon May 1, 2023
I bumped the base image to php8 now, what commands do you use to do the js build exactly?
SteveIreland commentedon May 1, 2023
If you're referring to the classic build for CI4 the two steps are:
I documented the build in https://github.com/opensourcepos/opensourcepos/blob/ci4-upgrade/BUILD.md
jekkos commentedon May 2, 2023
Thanks for the reference, which version of npm and node are you using? It seems that the ones in the buildbox are too old.
SteveIreland commentedon May 3, 2023
I've been using node version 18.14.0 and the build is configured to require npm 9.4.2.
jekkos commentedon May 5, 2023
Ok I bumped the node version in the buildbox, but it seems that composer is also being started from node. I have made some local changes to separate those as the docker contains only node/grunt/bower and not composer, which comes from the official php repo.