sasjs / cli

Command line interface for creating, compiling, and building SAS® projects
https://cli.sasjs.io
MIT License
37 stars 5 forks source link

Use project directories when compiling `webout()` #1191

Closed allanbowe closed 1 year ago

allanbowe commented 2 years ago

Currently when compiling Services and Tests we take the following macros directly from the CORE library folder:

      content += await readFile(`${macroCorePath}/base/mf_getuser.sas`)
      content += await readFile(`${macroCorePath}/base/mp_jsonout.sas`)
      content += await readFile(`${macroCorePath}/server/ms_webout.sas`)

This is problematic as it means that developers cannot provide overrides to those macro definitions.

A better approach might be to turn the following string:

      content +=
        '  %macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);\n' +
        '    %ms_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt\n' +
        '      ,missing=&missing\n' +
        '      ,showmeta=&showmeta\n' +
        '    )' +
        '  %mend;\n'

into an actual compilable file, eg as follows:

/**
  <h4> SAS Macros </h4>
  @li ms_webout.sas
**/
%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);
  %ms_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt
    ,missing=&missing
    ,showmeta=&showmeta
  )
%mend;

When compiling Services and Tests, this generated file should be added to the list of top-level dependencies, thereby also closing the following issue: https://github.com/sasjs/cli/issues/1095

sasjsbot commented 1 year ago

:tada: This issue has been resolved in version 3.21.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: